My Philips Hue is running in parallel / autonomous from Hass; rules for lights automation are primarily created and run using the Hue app, and occasionally I use Hass to change a scene or toggle a specific light. I am doing this for (1) keeping the Hue app functional (WAF) (2) because I’m too lazy to write redundant rules into Hass when Hue is satisfactory
Now the question is:
I would like to be able to disable the Hue motion sensor from Hass temporarily (projector, movie) instead of launching the Hue app and disabling the sensor manually.
Any ideas where I should start looking for an answer?
Did you ever get an answer to this? I too have this issue and thought that a REST switch may help, but I have to confess that I don’t understand the syntax well enough to get it to work.
I couldnt get the REST switch to work because syntax requires command and state endpoints to match, whereas for Hue the switch and state endpoints differ. Workaround in my case was a command line switch to set the state of the Hue motion sensor on / off.
I currently have a hue motion sensor in the bathroom that switches off the light after no motion for a few minutes. The undesirable side effect being that if you lie still in the bath you end up in the dark.
I was going to transfer the automation over to homeassistant and add a bath time switch that keeps the light on.
Will your command line switch work for this use case instead? (ie disable the sensor when someone is in the bath and re-enable afterwards?)
Well, no, if that code works then that’s the only code I need. (8 lines)
To bring it in to homeassistant I would need either a complicated automation with templated off time/on time etc, or a combination of a couple of automations. (minimum 14 lines, probably more).
Bearing in mind that I still need to tell homeassistant it’s bath time somehow, so I can just use that switch (probably exposed to emulated_hue) and its done. Otherwise it would be an input boolean to use as a condition etc etc.
If you have Alexa or Google Home, exposing the input_boolean or switch would be one super easy way to do it. Alternatively, Dasher could be a great solution for this. Not sure if Dasher supports the PUT function as is required here, but it could turn off or on an input_boolean or switch if you had already set up the command line as noted above.
Dash buttons are $5 or cheaper (if they have a sale). Setup in Hassio is super easy, but I found the hass setup to be much more complex. Details for HASS are here:
A laudable goal, for sure. For what it’s worth, I put a 5-minute delay on restarting the motion sensor after my scene completed. I didn’t want to get out of my chair to go upstairs and immediately set off the sensor again. You may have the same issue on your end.
it seems to boil down to the command_state that wont stop running. tried with and without quotes. not sure if theres a solution there. Shouldn’t there be a GET in the state command?
I tried the same for a rule. But i can’t get the state. command_on and command_off are working.
Could anyone tell me, how to get the correct state, to toggle the switch in Home Assistant?
I do not know about Hue rules, but for sensors the state endpoint is different from the command endpoint.
Your command_state is probably looking for state in the wrong place.