I'm getting this error when HASS boots
2018-01-21 09:39:45 ERROR (MainThread) [homeassistant.components.sensor] Error on device update!
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_component.py", line 217, in async_add_entity
yield from entity.async_device_update(warning=False)
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 306, in async_device_update
yield from self.hass.async_add_job(self.update)
File "/usr/lib/python3.6/asyncio/futures.py", line 332, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.6/asyncio/tasks.py", line 250, in _wakeup
future.result()
File "/usr/lib/python3.6/asyncio/futures.py", line 245, in result
raise self._exception
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/sensor/hue.py", line 214, in update
self._hue_id]['lux']
KeyError: 'lux'
And here is the response from Philips Hue:
{"1":{"state":{"daylight":true,"lastupdated":"2018-01-21T08:05:00"},"config":{"on":true,"configured":true,"sunriseoffset":30,"sunsetoffset":-30},"name":"Daylight","type":"Daylight","modelid":"PHDL00","manufacturername":"Philips","swversion":"1.0"},"2":{"state":{"temperature":1725,"lastupdated":"2018-01-21T08:43:39"},"swupdate":{"state":"noupdates","lastinstall":null},"config":{"on":true,"battery":100,"reachable":true,"alert":"none","ledindication":false,"usertest":false,"pending":[]},"name":"Hue temperature sensor 1","type":"ZLLTemperature","modelid":"SML001","manufacturername":"Philips","swversion":"6.1.0.18912","uniqueid":"00:17:88:01:02:12:dc:d0-02-0402"},"3":{"state":{"presence":false,"lastupdated":"2018-01-21T08:44:02"},"swupdate":{"state":"noupdates","lastinstall":null},"config":{"on":true,"battery":100,"reachable":true,"alert":"none","ledindication":false,"usertest":false,"sensitivity":0,"sensitivitymax":2,"pending":[]},"name":"Kitchen Sensor","type":"ZLLPresence","modelid":"SML001","manufacturername":"Philips","swversion":"6.1.0.18912","uniqueid":"00:17:88:01:02:12:dc:d0-02-0406"},"4":{"state":{"lightlevel":16455,"dark":false,"daylight":false,"lastupdated":"2018-01-21T08:44:07"},"swupdate":{"state":"noupdates","lastinstall":null},"config":{"on":true,"battery":100,"reachable":true,"alert":"none","tholddark":13331,"tholdoffset":7000,"ledindication":false,"usertest":false,"pending":[]},"name":"Hue ambient light sensor 1","type":"ZLLLightLevel","modelid":"SML001","manufacturername":"Philips","swversion":"6.1.0.18912","uniqueid":"00:17:88:01:02:12:dc:d0-02-0400"},"9":{"state":{"buttonevent":1002,"lastupdated":"2018-01-21T07:52:07"},"swupdate":{"state":"noupdates","lastinstall":null},"config":{"on":true,"battery":100,"reachable":true,"pending":[]},"name":"Kitchen switch","type":"ZLLSwitch","modelid":"RWL021","manufacturername":"Philips","swversion":"5.45.1.17846","uniqueid":"00:17:88:01:10:5e:e1:eb-02-fc00"},"14":{"state":{"buttonevent":1002,"lastupdated":"2018-01-21T08:10:23"},"swupdate":{"state":"noupdates","lastinstall":null},"config":{"on":true,"battery":100,"reachable":true,"pending":[]},"name":"Living room switch","type":"ZLLSwitch","modelid":"RWL021","manufacturername":"Philips","swversion":"5.45.1.17846","uniqueid":"00:17:88:01:10:6f:1b:10-02-fc00"},"15":{"state":{"status":0,"lastupdated":"2018-01-21T08:10:33"},"config":{"on":true,"reachable":true},"name":"Dimmer Switch 14 SceneCycle","type":"CLIPGenericStatus","modelid":"PHWA01","manufacturername":"Philips","swversion":"1.0","uniqueid":"WA0001","recycle":true},"16":{"state":{"temperature":1905,"lastupdated":"2018-01-21T08:44:21"},"swupdate":{"state":"noupdates","lastinstall":null},"config":{"on":true,"battery":100,"reachable":true,"alert":"none","ledindication":false,"usertest":false,"pending":[]},"name":"Hue temperature sensor 2","type":"ZLLTemperature","modelid":"SML001","manufacturername":"Philips","swversion":"6.1.0.18912","uniqueid":"00:17:88:01:02:12:f7:ad-02-0402"},"17":{"state":{"presence":false,"lastupdated":"2018-01-21T08:31:31"},"swupdate":{"state":"noupdates","lastinstall":null},"config":{"on":true,"battery":100,"reachable":true,"alert":"none","ledindication":false,"usertest":false,"sensitivity":1,"sensitivitymax":2,"pending":[]},"name":"Corridor","type":"ZLLPresence","modelid":"SML001","manufacturername":"Philips","swversion":"6.1.0.18912","uniqueid":"00:17:88:01:02:12:f7:ad-02-0406"},"18":{"state":{"lightlevel":8874,"dark":true,"daylight":false,"lastupdated":"2018-01-21T08:41:30"},"swupdate":{"state":"noupdates","lastinstall":null},"config":{"on":true,"battery":100,"reachable":true,"alert":"none","tholddark":11228,"tholdoffset":7000,"ledindication":false,"usertest":false,"pending":[]},"name":"Hue ambient light sensor 2","type":"ZLLLightLevel","modelid":"SML001","manufacturername":"Philips","swversion":"6.1.0.18912","uniqueid":"00:17:88:01:02:12:f7:ad-02-0400"},"19":{"state":{"status":0,"lastupdated":"2018-01-21T08:32:16"},"config":{"on":true,"reachable":true},"name":"MotionSensor 17.Companion","type":"CLIPGenericStatus","modelid":"PHA_STATE","manufacturername":"Philips","swversion":"1.0","uniqueid":"MotionSensor 17.Companion","recycle":true},"27":{"state":{"temperature":1927,"lastupdated":"2018-01-21T08:44:39"},"swupdate":{"state":"noupdates","lastinstall":null},"config":{"on":true,"battery":100,"reachable":true,"alert":"none","ledindication":false,"usertest":false,"pending":[]},"name":"Hue temperature sensor 3","type":"ZLLTemperature","modelid":"SML001","manufacturername":"Philips","swversion":"6.1.0.18912","uniqueid":"00:17:88:01:02:12:d9:97-02-0402"},"28":{"state":{"presence":false,"lastupdated":"2018-01-20T22:26:12"},"swupdate":{"state":"noupdates","lastinstall":null},"config":{"on":true,"battery":100,"reachable":true,"alert":"none","ledindication":false,"usertest":false,"sensitivity":2,"sensitivitymax":2,"pending":[]},"name":"Dining Room sensor","type":"ZLLPresence","modelid":"SML001","manufacturername":"Philips","swversion":"6.1.0.18912","uniqueid":"00:17:88:01:02:12:d9:97-02-0406"},"29":{"state":{"lightlevel":0,"dark":true,"daylight":false,"lastupdated":"2018-01-21T08:45:00"},"swupdate":{"state":"noupdates","lastinstall":null},"config":{"on":true,"battery":100,"reachable":true,"alert":"none","tholddark":13665,"tholdoffset":7000,"ledindication":false,"usertest":false,"pending":[]},"name":"Hue ambient light sensor 3","type":"ZLLLightLevel","modelid":"SML001","manufacturername":"Philips","swversion":"6.1.0.18912","uniqueid":"00:17:88:01:02:12:d9:97-02-0400"},"30":{"state":{"temperature":null,"lastupdated":"none"},"swupdate":{"state":"noupdates","lastinstall":null},"config":{"on":false,"battery":null,"reachable":false,"alert":"none","ledindication":false,"usertest":false,"pending":[]},"name":"Hue temperature sensor 4","type":"ZLLTemperature","modelid":"SML001","manufacturername":"Philips","swversion":"6.1.0.18912","uniqueid":"00:17:88:01:02:12:d6:74-02-0402"},"31":{"state":{"presence":null,"lastupdated":"none"},"swupdate":{"state":"noupdates","lastinstall":null},"config":{"on":false,"battery":null,"reachable":false,"alert":"none","ledindication":false,"usertest":false,"sensitivity":1,"sensitivitymax":2,"pending":[]},"name":"Hue motion sensor 1","type":"ZLLPresence","modelid":"SML001","manufacturername":"Philips","swversion":"6.1.0.18912","uniqueid":"00:17:88:01:02:12:d6:74-02-0406"},"32":{"state":{"lightlevel":null,"dark":null,"daylight":null,"lastupdated":"none"},"swupdate":{"state":"noupdates","lastinstall":null},"config":{"on":false,"battery":null,"reachable":false,"alert":"none","tholddark":16000,"tholdoffset":7000,"ledindication":false,"usertest":false,"pending":[]},"name":"Hue ambient light sensor 4","type":"ZLLLightLevel","modelid":"SML001","manufacturername":"Philips","swversion":"6.1.0.18912","uniqueid":"00:17:88:01:02:12:d6:74-02-0400"},"33":{"state":{"status":0,"lastupdated":"2018-01-21T07:52:17"},"config":{"on":true,"reachable":true},"name":"Dimmer Switch 9 SceneCycle","type":"CLIPGenericStatus","modelid":"PHWA01","manufacturername":"Philips","swversion":"1.0","uniqueid":"WA0001","recycle":true}}