Error in pydeconz/sensor.py", line 128

Hi, i don’t know why but suddenly the following error occurs and hass.io starts very,very slowly. any ideas ?

thx, alex

2018-05-10 23:46:58 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py”, line 316, in _async_add_entity
await entity.async_update_ha_state()
File “/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py”, line 215, in async_update_ha_state
state = self.state
File “/usr/lib/python3.6/site-packages/homeassistant/components/sensor/deconz.py”, line 71, in state
return self._sensor.state
File “/usr/lib/python3.6/site-packages/pydeconz/sensor.py”, line 128, in state
consumption = float(self.consumption/1000)
TypeError: unsupported operand type(s) for /: ‘NoneType’ and ‘int’

You didn’t have this before today?

What versions are you running of hass and deconz?

My initial thought is that your plug hasn’t reported any consumption numbers yet, but none of this should affect your start times.

You can enable debug for deconz like this: https://www.home-assistant.io/components/deconz/#debugging-component

With the debug prints you can see if the device has got any consumption value or not.

I’ve asked the deconz devs whether the consumption value can be omitted on report or not

hi, i’m running ha 0.68.1 and deconz Version 2.05.23 / 24.4.2018; Firmware 261F0500. you are right, the plugs have not reported any consumption numbers yet. Is there a way to disable the consumption reporting ?

I don’t think so. But I also got an answer from Deconz devs and I need to take into consideration that a value might not be available yet so I will try to fix this next week

I’ve put up a fix for this issue https://github.com/home-assistant/home-assistant/pull/14452