In your second attempt you use the event entity values for your condition. There is a race condition risk that from the trigger happens till you test the condition, the event entity value may have changed. My examples use the trigger.to_stateā¦ which gets frozen in time at the moment of the trigger. That is the safe way to do it. Not only for this but any trigger.
I want to get the trigger.to_state.attributes.event_type to work. But, Iām still having difficulty getting it into the automation. Can it only be entered using yaml, or can it be done via visual editor?
The switch.toggle action should just work. No need to check if switch is on or off. And since you only have one button type it can go directy in the condition of the automation instead of if then or a choose in the action
Thank you @KennethLavrsen. I believe I have things working correctly now. The if/then was a remnant of a larger script I tried to trim down for simplicity. But, it was just confusing. Here is the full script that toggles 2 different lights on/off using either the single press (light #1) or double press (light #2).
Cool. But note that you can reduce your automation to half the size by skipping checking the state of the switches and just use switch.toggle like both 123 and I posted minutes ago. For lights it it light.toggle
Since this seemed to get lostā¦ is there somewhere that clearly lists actions that need to be taken before upgrading to v2?
Seems to be a mess of information throughout threads and frankly I donāt want to have to troubleshoot yet another failed update in my HA after AlexaMediaPlayer last month, and ESPhome a couple of months before thatā¦
Iām all working after rollback, but these breaking changes which are not properly telegraphed in the UI are silly