Skip to content
This repository has been archived by the owner on Jul 23, 2021. It is now read-only.

Not loading if motion sensor is off #16

Closed
sti0 opened this issue Dec 12, 2017 · 3 comments · Fixed by #91
Closed

Not loading if motion sensor is off #16

sti0 opened this issue Dec 12, 2017 · 3 comments · Fixed by #91

Comments

@sti0
Copy link

sti0 commented Dec 12, 2017

If I switch the motion sensor off in the HUE APP the component is not loading at home assistant startup.

Error Log:
2017-12-12 23:00:58 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 331, in iter
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.6/asyncio/tasks.py", line 244, in _wakeup
future.result()
File "/usr/lib/python3.6/asyncio/futures.py", line 244, in result
raise self._exception
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/sensor/hue.py", line 102, in update
self._hue_id]['lux']
KeyError: 'lux'

If I turn it back on, the component is loading at home assistant startup.

I think you should consider the "on" state at the config parameter:
....
"config": {
"on": true,
"battery": 100,
"reachable": true,
"alert": "none",
"ledindication": false,
"usertest": false,
"pending": []
},
....

Maybe "reachable" as well.

@robmarkcole
Copy link
Owner

Thanks for the suggestion, will incorporate into the next version.
Cheers

@rafuz
Copy link

rafuz commented Sep 12, 2018

If I turn off a motion sensor from the hue app or with a command I still get "Error updating Hue sensors" in home assistant log. Moreover the sensor attribute "on" stays on true even when the sensor is turned off. Maybe the component does not read the "on" attribute in config correctly?

@robmarkcole
Copy link
Owner

@rafuz I've not tested the component under all possible conditions, PR to fix issues are welcomed :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants