I’ve been slowly building an automation to run my sprinklers that are connected to an indexing valve. I only turn the pump on an off, and it automatically advances to the next zone when going from on to off.
Recently I created some helpers to let me set the start time and how long each zone is on.
The next piece I’d like to add is the ability to “disable” zones. I use disable in quotes beacuse to disable the zone I’d just have it on for a short time, like 15 seconds, then turn it off, to basically skip watering that zone and move on to the next one.
I plan to add binary helpers for enabling each zone, but the part I need help on is how to use that binary helper value to determine the delay duration. So if the binary help is enabled use the helper duration I set via UI, and if it’s disabled use 15 seconds for the delay between turning it on and off.
Any help would be appreciated. Here’s what I have looks like so far.
alias: Run Sprinkler
description: ""
trigger:
- platform: time
at: input_datetime.sprinkler_start_time
condition:
- condition: time
weekday:
- mon
- wed
- fri
action:
- type: turn_on
device_id: ec8a16b109434163a8e1ddec73f84491
entity_id: 4c77fdd52d150176461c75f65011b666
domain: switch
- delay:
hours: 0
minutes: "{{ states('input_number.zone_1_duration') | int }} "
seconds: 0
milliseconds: 0
- type: turn_off
device_id: ec8a16b109434163a8e1ddec73f84491
entity_id: 4c77fdd52d150176461c75f65011b666
domain: switch
- delay:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
- type: turn_on
device_id: ec8a16b109434163a8e1ddec73f84491
entity_id: 4c77fdd52d150176461c75f65011b666
domain: switch
- delay:
hours: 0
minutes: "{{ states('input_number.zone_2_duration') | int }} "
seconds: 0
milliseconds: 0
- type: turn_off
device_id: ec8a16b109434163a8e1ddec73f84491
entity_id: 4c77fdd52d150176461c75f65011b666
domain: switch
- delay:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
- type: turn_on
device_id: ec8a16b109434163a8e1ddec73f84491
entity_id: 4c77fdd52d150176461c75f65011b666
domain: switch
- delay:
hours: 0
minutes: "{{ states('input_number.zone_3_duration') | int }} "
seconds: 0
milliseconds: 0
- type: turn_off
device_id: ec8a16b109434163a8e1ddec73f84491
entity_id: 4c77fdd52d150176461c75f65011b666
domain: switch
mode: single