Hi All,
I have an automation (1) that doesn’t always complete once a delay is added. For as far as I can tell the automation does not complete once another automation (2) is triggered that turns on a light that is part of the group the automation (1) will turn off after the delay.
Now I am first of all curious if someone can confirm this behavior.
Secondly
I rebuild my automation to work around the delay function by using a DateTime-helper to trigger a turn-all lights of automation, which works as designed. The downer is that the trigger, using ‘sensor.date_time’, is exact to the minute and not the second. So say the helper is set to 23:45:54, it is triggered at 23:45. Adding a delay for the resulting seconds reintroduces the same issue. Is there a way to make it trigger to the exact second?
If you are running a version below 0.113 the answer to your question is - yes. If your trigger fires while waiting in a delay the delay will be cancelled and the actions after it will be executed.
After I took another look at the Template trigger docs I realized that the option for -> seconds could be my solution. It has to be the amount of seconds past the specified minute before it triggers. Below my tested solution.
I did however had to edit the automations.yaml because the ‘for: seconds:’ got removed. So I am not sure how future proof this is, but it does work perfectly at the moment.