Finally got around to creating a custom component for the Hue motion sensors and 4 button remotes.
Please note that I don’t think reducing the SCAN_INTERVAL will make much practical difference.
Please let me know any config or usage issues here, technical issues (i.e. related to the actual .py file) please submit on Github.
Cheers
I’e update the icons displayed on the front end, should be more appropriate now.
I am loving these 4 button remotes which can have 2 states: I have short presses toggling a lamp on/off and long press of the same button toggling the tv on/off
I got the motion sensors working in HA by setting up custom rules using WinHue3 (https://hyrules.github.io/WinHue3/) and then grabbing the states via REST.
This looks far easier so i’ll give it a go with my motion sensors
Make sure to checkout the modelid of your hue switch folks! Just ordered mine off amazon, its a RWL020 not RWL021. Change parse_hue_api_response() accordingly.
I have been using this component for a couple of days now, and it is very nice!
But today i had a issue with a Tap:
.hue_sensors] {‘state’: {‘buttonevent’: None, ‘lastupdated’: ‘none’},
…
TypeError: ‘NoneType’ object is not subscriptable
I guess the Bridge forgot about the last state, because it was unused for many hours.
After pressing a button and restarted Homeassistant it was working again.
2017-10-12 15:11:34 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform hue
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_component.py”, line 164, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
File “/usr/lib/python3.6/asyncio/tasks.py”, line 352, in wait_for
return fut.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 25, in setup_platform
url = hass.data[DOMAIN] + ‘/sensors’
KeyError: ‘hue’