HA 0.42.2 'Sensor has no attribute _battery_level' error

  • After the upgrade to 0.42.2 all my sensors are being rejected by HA because of the error:

    File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/mysensors.py", line 391, in device_state_attributes
        ATTR_BATTERY_LEVEL: node.battery_level,
      File "/home/homeassistant/.homeassistant/deps/mysensors/__init__.py", line 420, in battery_level
        return self._battery_level
    AttributeError: 'Sensor' object has no attribute '_battery_level'` 

    I haven't tried rolling back to 0.41 or debugging the code yet. Wanted to throw it out there to see if anyone else has experienced similar behaviour?

  • Plugin Developer


    Are you using persistence with a pickle file? I think I've found a bug in that scenario.

    PR with fix:

  • Yes, I'm using the persistence & pickle file. The PR fixes the problem. Just tested with latest HA dev branch. Thanks for the quick answer Martin.

Log in to reply

Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.