Hi I am hoping someone can help.
I have setup a irrigation controller and am using a script with delays to open and close the valves with relays.
I want the controller to be independent of HA, so I have a service that is exposed in HA which in turn will run the script for the watering schedule.
I am looking for a way to display.report the delay timer as it counts down for each zone in HA. is this possible.
substitutions:
node_name: irrigation_1
friendly_node_name: Irrigation Controller 1
log_level: DEBUG
packages:
device_base: !include common/device_base.yaml
api:
services:
- service: all_zones_water
then:
- script.execute: all_zones
- service: all_zones_stop
then:
- script.stop: all_zones
- logger.log: "Watering Stopped"
- switch.turn_off: ${node_name}_zone_1
- switch.turn_off: ${node_name}_zone_2
- switch.turn_off: ${node_name}_zone_3
- switch.turn_off: ${node_name}_zone_4
script:
- id: all_zones
mode: single
then:
- switch.turn_on:
id: ${node_name}_zone_1
- delay: !lambda 'return id(zone_1_duration).state * 60000;'
- switch.turn_on:
id: ${node_name}_zone_2
- delay: !lambda 'return id(zone_2_duration).state * 60000;'
- switch.turn_on:
id: ${node_name}_zone_3
- delay: !lambda 'return id(zone_3_duration).state * 60000;'
- switch.turn_on:
id: ${node_name}_zone_4
- delay: !lambda 'return id(zone_4_duration).state * 60000;'
- switch.turn_off:
id: ${node_name}_zone_4
sensor:
- platform: homeassistant
name: Zone 1 Duration
id: zone_1_duration
entity_id: input_number.irrigation_1_zone_1
- platform: homeassistant
name: Zone 2 Duration
id: zone_2_duration
entity_id: input_number.irrigation_1_zone_2
- platform: homeassistant
name: Zone 3 Duration
id: zone_3_duration
entity_id: input_number.irrigation_1_zone_3
- platform: homeassistant
name: Zone 4 Duration
id: zone_4_duration
entity_id: input_number.irrigation_1_zone_4
- platform: homeassistant
name: Max Time
id: max_time
entity_id: input_number.irrigation_1_max_time
switch:
# Zone 1
- platform: gpio
pin:
number: 12
inverted: no
name: ${friendly_node_name} - Zone 1
id: ${node_name}_zone_1
interlock: ['${node_name}_zone_2', '${node_name}_zone_3', '${node_name}_zone_4']
restore_mode: ALWAYS_OFF
icon: mdi:water
# Zone 2
- platform: gpio
pin:
number: 5
inverted: yes
name: ${friendly_node_name} - Zone 2
id: ${node_name}_zone_2
interlock: ['${node_name}_zone_1', '${node_name}_zone_3', '${node_name}_zone_4']
restore_mode: ALWAYS_OFF
icon: mdi:water
# Zone 3
- platform: gpio
pin:
number: 4
inverted: yes
name: ${friendly_node_name} - Zone 3
id: ${node_name}_zone_3
interlock: ['${node_name}_zone_1', '${node_name}_zone_2', '${node_name}_zone_4']
restore_mode: ALWAYS_OFF
icon: mdi:water
# Zone 4
- platform: gpio
pin:
number: 15
inverted: yes
name: ${friendly_node_name} - Zone 4
id: ${node_name}_zone_4
interlock: ['${node_name}_zone_1', '${node_name}_zone_2', '${node_name}_zone_3']
restore_mode: ALWAYS_OFF
icon: mdi:water