I have a script that turns on my sprinklers, delays for a few minutes, then turns off.
Is there a way to interrupt the delay?
In other words, let’s say I start Zone 1 and the relay turns on.
I want to stop Zone 1, but I can’t because the process is stuck in the delay.
Is there a better way, like a separate script for on and off? (Where do I put the delay?)
alias: Sprinkler Zone01 run
sequence:
- condition: state
entity_id: input_boolean.zone1_enable
state: 'on'
- service: switch.turn_on
data: {}
target:
entity_id: switch.sprinkler1_relay_1
- delay: '{{states(''input_number.irrigation_zone1_duration'')|int *60}}'
- service: switch.turn_off
data: {}
target:
entity_id: switch.sprinkler1_relay_1
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
mode: single