@robmarkcole thanks a lot for your work, just updated to 0.66.1, modified component, everything works.
But could you please help me to solve two little problems:
at this moment IP and Key of hub are in hue.py. It’s normal, but… a little bit unsecure) I like concept of putting all sensitive stuff like ips, keys, passwords to secrets.yaml, without publishing it to GitHub. Hope in future sensitive information will be excluded from component.
more important problem is state changes. I don’t like to multiple entities and always try to make as few automations as I can, using templates. Now my automation for Hue dimmers looks like this:
So, one automation covers all three dimmers I have and fires appropriate scene in appropriate room according which button on which dimmer pressed. But it’s unusable, because state change event is being triggered even on attributes changes (battery level, etc). And if I, for example, turn light on with first dimmer button, than turn light off via Siri/another automation/HomeKit than after some time lights up again, because some dimmer attributes have been changed and automation triggered.
I tried to solve by adding condition:
but now if I triggered lights by 1st button, than lights turned off by something another and I again press 1st button - nothing happens because to/from states are the same.
So… Is there any way to watch only press button events, not every state change?
I know I can use to: option in trigger block, but than I need automation for every button of every dimmer, 4 x 3 = 12 automations istead of 1.
Im not sure i should upgrade… reading all issues with Hue in the first place, rgb_color and brightness issues, and secondly losing all switches and sensors your CC creates so beautifully ?
Been reinstating my rest and json sensors just to be sure i dont miss out on the functionality just in case, but still. What should we do?
Somebody solved the button problem previously on this thread, please have a look through. As a note to all, this component will be written correctly using the async hue, and the remotes implemented as remotes.
Cheers
Really like your data_template, shows the power of templates
I recently found out about the service_template, which also makes automations like this possible.
This is one way that works if you want to use both click and hold function of the buttons:
Then the automation get triggered by the last_updated attribute, so it will trigger anyway if the state of the switch is the same.
If you don’t want to use the hold function, there is no meaning with the for: 1 second part.
You could probably implement this function inside the data_template, so please share if you can make that work, since that can reduce my automations too
That is fantastic! Can’t wait for the hue sensors to be implementet in homeassistant without being a custom component. Will this also fix the problem with the alert messages we now have if we set the update_interval for the sensors too low?
Thanks a lot for code. But won’t action be triggered on every state change? If battery level (or any other attribute) changes, it should cause state update => sensor state “last_updated” should be changed too, right?
I’ll try to cobine it with my automation, check if it works and post result code here.
No, at least for me, I had no changes to last_updated except when the buttons have been pressed. But I have never seen the battery level changed from 100% either.
Hey,
I fixed the state command issue which you were having. Instead of using the command_line platform, I used the rest platform.
Here is my configuration if you are interested in this:
its not that mine don’t switch, they do perfectly. Its the state picking up that yours do more reliably. If the sensors are switched elsewhere mine dont show the correct state, the template must be off somehow. Yours follow the correct state, also when switched off/on by other controls, like the Hue App.
So, changed setup, with a little customization:
Great project! Finally some nice, responsive remotes!
I’m getting alot of updating errors in the log. Right now I’m just testing with one and tried http://IP/api/KEY/sensors/26, but no success.
Could it help if I only poll the remotes I want? If so, is it possible?
This might not be the appropriate place to ask, but how do I customise the state of various motion sensors?
The hue custom component motion sensors display as On or Off in the UI, but the Xiaomi motion sensors I have display as Clear or Detected. See below, the Downstairs and Sitting Room sensors are Hue.
Ideally I would like these to be consistent. ie Clear or Detected for all, or One or Off for all.
Additionally, the hue component sensors don’t highlight in yellow when motion is detected, do we have any control over that, is there a setting I can change somewhere? Thanks in advance
The issue here is that the motion sensors are implemented as vanilla sensors rather than binary_sensors. I actually use a template_binary to detect motion at home (in binary_sensors.yaml):
- platform: template
sensors:
motion_at_home:
value_template: >-
{%- if is_state("sensor.hall_motion_sensor", "on")
or is_state("sensor.living_room_motion_sensor", "on")
or is_state("sensor.bedroom_motion_sensor", "on")
-%}
True
{%- else -%}
False
{%- endif %}
I hadn’t given this much thought, but IMO motion sensors should be implemented as binary sensors. Added to to-do list.
Hi, any progress since 0.66? The HUE refactor at 0.66 caused me to loose connection to a couple of Tasmota Sonoffs that were pretending to be HUE bridges. I changed them to pretend to be Wemo, but they are now limited to one output. I also lost effects from the faceplates of any bulbs that have effects but can still call the service with other methods. I ask as I saw in another thread, that you were thinking of helping with the platform and then the thread went private by the author of the platform.
for now use mdi: run-fast and mdi:human-male/female … (might have to take out the line in the CC for the icon) is this possible @robmarkcole ? or maybe add the possibility for the on/off in the CC itself?