I have ISY994 which generates an event isy994_control with either DON or DOF data. I want to write a single automation to turn a switch on or off depending on DON or DOF. How would I do it? Here are the DON and DOF event data and desired action.
Very correct. The DON and DOF are generated by a mini remote switch and it blinks green on ON and red on OFF. If I used toggle, then things will get out of sync.
Thank you so much for the solution. I really wrote the pseudo code without any knowledge. Is there any documentation on what attributes of any object I can use? I am have read so much but this part still eludes me. This kind of code imparts true power to the Home Assistant.
The main variables are described here, with the link to the state object telling you what you can access from there for state triggers. For events, you start with trigger.event.data and then follow the event structure to the member you want, as you did.