Hi,
Sorry for a dumb question, fairly new to this. There is likely an easier solution to this than creating an automation, if so please let me know.
I have some Philips hue bulbs that I have connected to hass using zigbee (Z2M). I also have some light switches such as the hue dimmer switch (the rectangular one, both old and new version) as well as a friends of hue switch (sunricher). The switches are connected to my hue bridge and then I have an integration with that bridge from hass.
What I’d like to accomplish is to be able to control the lights using the four buttons on the switches just like as I have used the lights as well on the hue bridge. So, if I press the on botton (“I” on the old hue switch) I want the lights to turn on in the room, and if I press off (“O” on the old switch) i would like the lights to turn off and when pressing the dimmer buttons the light should dim up and down respectively.
On top of that, I have a Tuya blind roller that I intend to control together with the FoH switch. For example:
if top left button is pressed but not held down, the light should go on, if the button below is pressed the light should turn off. The other two buttons should move the tuya blind controller up and down.
The problem that I am running into is that it appears that my automations are limited and cannot filter on the trigger for the light switch, hence I am forced to create one automation for each action and that seems a bit suboptimal. When trying to use a Trigger condition in the automation the UI, it simply states that there are no triggers available.
Since all of the switches cannot be direclty zigbee paired I am unable to use z2m to create bindings.
Are there any better ways?
@automation_user — first step is to work out what entities you have and what states they show. Try to find your switches in Developer Tools / States and look at what states they show in response to being used.
Thanks for the reply @Troon. The problem is that there are no states present and I only see entries in the logbook for the device. Apart from battery level, there are no entities tied to these switches.
Can I create conditions for log entries when it comes to triggers?
Thx for your reply @Troon.
According to the documentation the switches are stateless and only emit a hue_event when a button is pressed. I have listened to these event in the developer console, and have the data but I am still unable to figure out a way to use these in a condition in the automation.
As a workaround I tried creating a button helper and then rely on that button in my automation but I bet there are better alternatives.
Any ideas?
I can see the devices from the philips hue integration but none of them has any entities related to the buttons. Here is a screenshot of the dimmer switch device:
The logbook entries are a neat version of the hue_event that comes in if I am not mistaken.
edit: Found the input_bottun.press service and now have a workaround, but it still requires me to create many automations.
Thanks. Made some progress and finally figured out how to get trigger id’s working. So now I have a semi working solution.
The next problem seems like a glitch to me, but perhaps I am doing it wrong.
Based on the trigger id i have achoose option where one trigger turns a bolean helper on and the other off.
This works very well when I am in Developers tools and tests the service. For some reason the service doesnt change the status of the helper when using automation. I have copied the yaml config from the developer tools and put it into the automation but the helper just isnt changed as long as I use the automation.
Am I doing this worng? My yaml for the service:
Found the issue, turns out it was a mislabling of entities compared to the expected result. When I expected the entity to be turned off it was actually turned on and the other way around.