Don’t understand, how delays work
Hello. Want to make an automation that contains a delay and after delay - a repeat loop (repeat until temp is below desired) with delays (delay - start a heater - delay - stop a heater). So sequence look like this
alias: heat_script sequence: - delay: hours: 0 minutes: 5 seconds: 0 milliseconds: 0 - repeat: until: - condition: numeric_state below: input_number.t_otkrytiia_okna_mk entity_id: sensor.temperatura sequence: - type: turn_on device_id: 9baf3d00aaed113fb23489155460faba entity_id: switch.rozetka_3_switch domain: switch - delay: hours: 0 minutes: 3 seconds: 0 milliseconds: 0 - type: turn_off device_id: 9baf3d00aaed113fb23489155460faba entity_id: switch.rozetka_3_switch domain: switch - delay: hours: 0 minutes: 3 seconds: 0 milliseconds: 0
But I can’t call it inside a Time Pattern trigger (2 minutes).
The idea is whole automation should start every 2 minutes, but if condition chooses my sequence, all automation should wait until sequence finished. In a real my automation triggered every 2 minutes and never wait a delay 5 minutes. So ot never entered a loop.
What I did? I moved all this sequence with delays in a separate script and called it from automation- no result. Automation starts every 2 minutes and didn’t waiting my script.
How can I avoid this? I want to start automation every 2 minutes, but, if choosed a delay-loop sequence, trigger must waiting for sequence finished and restart automation only after my loop ended. How can I do that?