I was able to replicate the failure you experienced. It’s this line in your version of the automation:
event_type: timer.started,timer.finished,timer.paused,timer.restarted,timer.cancelled
I used that version of event_type
and the Event Trigger failed to detect the timer’s events (which is crucial for controlling the operation of the switches).
A bit of background:
This is how you can define a list in YAML:
- timer.started
- timer.finished
- timer.paused
- timer.restarted
- timer.cancelled
Here’s the same list in JSON:
[ "timer.started", "timer.finished", "timer.paused", "timer.restarted", "timer.cancelled" ]
You’ll notice that the JSON equivalent is not this:
timer.started, timer.finished, timer.paused, timer.restarted, timer.cancelled
However, the Automation Editor converted the YAML version into that format, rendering Event Trigger useless for detecting a timer’s individual events. Why the Automation Editor does that is a separate discussion; the key point is that it shouldn’t do that for an Event Trigger.
Replace this:
event_type: timer.started,timer.finished,timer.paused,timer.restarted,timer.cancelled
with this:
event_type: [ "timer.started", "timer.finished", "timer.paused", "timer.restarted", "timer.cancelled" ]
That allows the Event Trigger to work properly and, I believe, the Automation Editor will leave it unchanged. If it still changes it then you will have to do what’s described below.
< soapbox >
This is one of several reasons I stopped using the Automation Editor a long time ago. It’s fine for composing simple automations but it has enough quirks, notably how it formats YAML according to an inflexible set of rules, that make it less than productive for complex automations. There’s an easy way to separate the automations you compose with a text editor from those composed with the Automation Editor and that’s what I have done. It prevents the Automation Editor from touching anything I create with a text editor (VS Code).
</ soapbox >