I have an automation that stopped functioning lately. The trace states “Stopped because only a single execution is allowed.” No changes were made to the automation. I assume the issue is with the wait_for_trigger which I found/hobbled together from other automations here on the forum. The idea of the wait_for_trigger is to have the shades reopen once the sun’s elevation is high enough to not blind my eyes while sitting here at my desk. Any advice to resolve this?
- id: '22028368334373038'
alias: entry blinds blinding sun so close the shade
trigger:
- platform: time
at: 08:30:00
- platform: time
at: 08:45:00
- platform: time
at: 09:00:00
- platform: time
at: 09:15:00
- platform: time
at: 09:30:00
- platform: time
at: 09:45:00
- platform: time
at: '10:00:00'
condition:
- condition: and
conditions:
- condition: numeric_state
entity_id: sun.sun
attribute: azimuth
above: '120'
below: '137'
- condition: numeric_state
entity_id: sun.sun
attribute: elevation
below: '29'
above: '10'
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
- condition: numeric_state
entity_id: sensor.lightlevel_entryway
above: 60
action:
- service: scene.turn_on
target:
entity_id: scene.closedentry
- wait_for_trigger:
- platform: numeric_state
entity_id: sun.sun
attribute: elevation
above: '30'
continue_on_timeout: false
- service: scene.turn_on
target:
entity_id: scene.daytimeentry
Don’t you use the mode of the automation?
I mean, I did not read and understand your automation thoroughly, sorry, I’m giving a hint (that might be not appropriate, sorry again) Mode is described here, maybe you should select one or another?
If you need single, it is perfectly fine.
But then, if the automation is triggered again while the previous execution is still waiting on one of the actions, like the wait_for_trigger, you’ll get the exception you described “Stopped because only a single execution is allowed.”
I’m always confused by the continue_on_timeout set to false because it is meant to abort the script but on the other hand, if true what does that mean? Execute the remaining actions?
I believe also that reaching 30 as elevation could take more or less time depending on the season and where you live. Might be the reason why the automation is triggered while the previous occurrence is still running?
The question is “Is it possible that waiting for the elevation to get to 30 is taking more than the 15 minutes before your next time platform trigger?”
The solution of Taras is the best as it is replacing multiple events by one.
But template triggers is not always easy for beginners, don’t know your level in coding (btw, if you are wondering, this is Jinja2 language) and you can always test your code in