Hi Peter,
I just installed your components and am trying to get it to work on the bench with my ESP32 (ESPHome) relays. I have a fairly large irrigation system (10 zones), and added all of them to the configuration.yaml per your instructions. Same with the lovelace content.
I am trying to run and test it now, but am running into some strange issues – when I set my morning program to execute at a certain time, it starts running (the switch on the lovelace also shows it’s started), and the first relay clicks on. But then it never turns it back off, nor does it continue with the program. Here is my log output:
2021-03-16 08:15:01 DEBUG (MainThread) [custom_components.irrigationprogram.switch] -------------------- on execution: Morning ----------------------------
2021-03-16 08:15:01 DEBUG (MainThread) [custom_components.irrigationprogram.switch] Template: Template("{{ states.switch.morning.attributes.time == states('input_datetime.irrigation_morning_start_time') and is_state('input_boolean.irrigation_on', 'on') and now().strftime('%a') in states('input_select.irrigation_run_days') }}")
2021-03-16 08:15:01 DEBUG (MainThread) [custom_components.irrigationprogram.switch] Start Time input_datetime.irrigation_morning_start_time: <state input_datetime.irrigation_morning_start_time=08:15:00; editable=False, has_date=False, has_time=True, hour=8, minute=15, second=0, timestamp=29700, friendly_name=Morning Start Time @ 2021-03-16T08:11:23.516734-04:00>
2021-03-16 08:15:01 DEBUG (MainThread) [custom_components.irrigationprogram.switch] Irrigation on input_boolean.irrigation_on: <state input_boolean.irrigation_on=on; editable=False, friendly_name=Enable Irrigation @ 2021-03-16T08:11:23.442983-04:00>
2021-03-16 08:15:01 DEBUG (MainThread) [custom_components.irrigationprogram.switch] Run Days input_select.irrigation_run_days: <state input_select.irrigation_run_days=['Mon','Tue','Wed','Thu','Fri','Sat','Sun']; options=["['Wed','Sat']", "['Sun','Thu']", "['Mon','Fri']", "['Tue','Sat']", "['Sun','Wed']", "['Mon','Thu']", "['Tue','Fri']", "['Mon','Wed','Fri']", "['Tue','Thu','Sat']", "['Mon','Tue','Wed','Thu','Fri','Sat','Sun']"], editable=False, friendly_name=Run Days @ 2021-03-16T08:12:20.914917-04:00>
2021-03-16 08:15:01 DEBUG (MainThread) [custom_components.irrigationprogram.switch] ------------ on execution zone: switch.irrigation_zone_1--------
2021-03-16 08:15:01 DEBUG (MainThread) [custom_components.irrigationprogram.switch] Rain Sensor binary_sensor.irrigation_rain_sensor: <state binary_sensor.irrigation_rain_sensor=off; friendly_name=irrigation_rain_sensor, device_class= @ 2021-03-16T08:11:24.961589-04:00>
2021-03-16 08:15:01 DEBUG (MainThread) [custom_components.irrigationprogram.switch] Ignore Rain Sensor input_boolean.irrigation_ignore_rain_sensor: <state input_boolean.irrigation_ignore_rain_sensor=on; editable=False, friendly_name=Ignore Rain Sensor @ 2021-03-16T08:11:23.443134-04:00>
2021-03-16 08:15:01 DEBUG (MainThread) [custom_components.irrigationprogram.switch] Rain Sensor Template: {{ ( is_state('binary_sensor.irrigation_rain_sensor', 'off') or is_state('input_boolean.irrigation_ignore_rain_sensor', 'on') ) }}
2021-03-16 08:15:10 WARNING (MainThread) [homeassistant.helpers.entity] Update of switch.morning is taking over 10 seconds
I’m sure I did something silly in my configuration.yaml or something … So here’s a dump of the relevant sections:
- platform: time_date
display_options:
- 'time'
- 'date'
switch:
- platform: irrigationzone
switches:
frontyard_driveway:
friendly_name: Front Yard Driveway
water: input_number.irrigation_frontyard_driveway_run
wait: input_number.irrigation_frontyard_driveway_wait
repeat: input_number.irrigation_frontyard_driveway_repeat
switch_entity: switch.irrigation_zone_1
icon_off: 'mdi:grass'
frontyard_middle:
friendly_name: Front Yard Middle
water: input_number.irrigation_frontyard_middle_run
wait: input_number.irrigation_frontyard_middle_wait
repeat: input_number.irrigation_frontyard_middle_repeat
switch_entity: switch.irrigation_zone_2
icon_off: 'mdi:grass'
frontyard_treeline:
friendly_name: Front Yard Treeline
water: input_number.irrigation_frontyard_treeline_run
wait: input_number.irrigation_frontyard_treeline_wait
repeat: input_number.irrigation_frontyard_treeline_repeat
icon_off: 'mdi:grass'
switch_entity: switch.irrigation_zone_3
sideyard:
friendly_name: Side Yard
water: input_number.irrigation_sideyard_run
wait: input_number.irrigation_sideyard_wait
repeat: input_number.irrigation_sideyard_repeat
icon_off: 'mdi:grass'
switch_entity: switch.irrigation_zone_4
backyard_shed:
friendly_name: Backyard Shed
water: input_number.irrigation_backyard_shed_run
wait: input_number.irrigation_backyard_shed_wait
repeat: input_number.irrigation_backyard_shed_repeat
icon_off: 'mdi:grass'
switch_entity: switch.irrigation_zone_5
backyard:
friendly_name: Backyard Fenced In Area
water: input_number.irrigation_backyard_run
wait: input_number.irrigation_backyard_wait
repeat: input_number.irrigation_backyard_repeat
icon_off: 'mdi:grass'
switch_entity: switch.irrigation_zone_6
backyard_garage:
friendly_name: Backyard Garage Area
water: input_number.irrigation_backyard_garage_run
wait: input_number.irrigation_backyard_garage_wait
repeat: input_number.irrigation_backyard_garage_repeat
icon_off: 'mdi:grass'
switch_entity: switch.irrigation_zone_7
planting_bed_front:
friendly_name: Front Planting Bed
water: input_number.irrigation_planting_bed_front_run
wait: input_number.irrigation_planting_bed_front_wait
repeat: input_number.irrigation_planting_bed_front_repeat
icon_off: 'mdi:flower'
switch_entity: switch.irrigation_zone_8
hanging_plants_front:
friendly_name: Front Hanging Plants
water: input_number.irrigation_hanging_plants_front_run
wait: input_number.irrigation_hanging_plants_front_wait
repeat: input_number.irrigation_hanging_plants_front_repeat
icon_off: 'mdi:flower'
switch_entity: switch.irrigation_zone_9
deck_plants_veg:
friendly_name: Deck Plants
water: input_number.irrigation_deck_plants_veg_run
wait: input_number.irrigation_deck_plants_veg_wait
repeat: input_number.irrigation_deck_plants_veg_repeat
icon_off: 'mdi:carrot'
switch_entity: switch.irrigation_zone_10
- platform: irrigationprogram
switches:
morning:
friendly_name: Morning
irrigation_on: input_boolean.irrigation_on
start_time: input_datetime.irrigation_morning_start_time
# run_freq: input_select.irrigation_freq
run_days: input_select.irrigation_run_days
rain_sensor: binary_sensor.irrigation_rain_sensor
ignore_rain_sensor: input_boolean.irrigation_ignore_rain_sensor
icon: mdi:fountain
zones:
- zone: switch.irrigation_zone_1
- zone: switch.irrigation_zone_2
- zone: switch.irrigation_zone_3
- zone: switch.irrigation_zone_4
- zone: switch.irrigation_zone_5
- zone: switch.irrigation_zone_6
- zone: switch.irrigation_zone_7
- zone: switch.irrigation_zone_8
- zone: switch.irrigation_zone_9
- zone: switch.irrigation_zone_10
evening:
friendly_name: Evening
irrigation_on: input_boolean.irrigation_on
start_time: input_datetime.irrigation_evening_start_time
# run_freq: input_select.irrigation_freq
run_days: input_select.irrigation_run_days
rain_sensor: binary_sensor.irrigation_rain_sensor
ignore_rain_sensor: input_boolean.irrigation_ignore_rain_sensor
icon: mdi:fountain
zones:
- zone: switch.irrigation_zone_1
- zone: switch.irrigation_zone_2
- zone: switch.irrigation_zone_3
- zone: switch.irrigation_zone_4
- zone: switch.irrigation_zone_5
- zone: switch.irrigation_zone_6
- zone: switch.irrigation_zone_7
- zone: switch.irrigation_zone_8
- zone: switch.irrigation_zone_9
- zone: switch.irrigation_zone_10
input_number:
irrigation_frontyard_driveway_run:
name: water
min: 1
max: 60
step: 1
icon: mdi:water
unit_of_measurement: min
irrigation_frontyard_driveway_wait:
name: wait
min: 0
max: 60
step: 1
icon: mdi:timer-sand
unit_of_measurement: min
irrigation_frontyard_driveway_repeat:
name: repeat
min: 1
max: 10
step: 1
icon: mdi:repeat
unit_of_measurement: iterations
irrigation_frontyard_middle_run:
name: water
min: 1
max: 60
step: 1
icon: mdi:water
irrigation_frontyard_middle_wait:
name: wait
min: 0
max: 60
step: 1
icon: mdi:timer-sand
irrigation_frontyard_middle_repeat:
name: repeat
min: 1
max: 10
step: 1
icon: mdi:repeat
irrigation_frontyard_treeline_run:
name: water
min: 1
max: 60
step: 1
icon: mdi:water
irrigation_frontyard_treeline_wait:
name: wait
min: 0
max: 60
step: 1
icon: mdi:timer-sand
irrigation_frontyard_treeline_repeat:
name: repeat
min: 1
max: 10
step: 1
icon: mdi:repeat
irrigation_sideyard_run:
name: water
min: 1
max: 60
step: 1
icon: mdi:water
irrigation_sideyard_wait:
name: wait
min: 0
max: 60
step: 1
icon: mdi:timer-sand
irrigation_sideyard_repeat:
name: repeat
min: 1
max: 10
step: 1
icon: mdi:repeat
irrigation_backyard_shed_run:
name: water
min: 1
max: 60
step: 1
icon: mdi:water
irrigation_backyard_shed_wait:
name: wait
min: 0
max: 60
step: 1
icon: mdi:timer-sand
irrigation_backyard_shed_repeat:
name: repeat
min: 1
max: 10
step: 1
icon: mdi:repeat
irrigation_backyard_run:
name: water
min: 1
max: 60
step: 1
icon: mdi:water
irrigation_backyard_wait:
name: wait
min: 0
max: 60
step: 1
icon: mdi:timer-sand
irrigation_backyard_repeat:
name: repeat
min: 1
max: 10
step: 1
icon: mdi:repeat
irrigation_backyard_garage_run:
name: water
min: 1
max: 60
step: 1
icon: mdi:water
irrigation_backyard_garage_wait:
name: wait
min: 0
max: 60
step: 1
icon: mdi:timer-sand
irrigation_backyard_garage_repeat:
name: repeat
min: 1
max: 10
step: 1
icon: mdi:repeat
irrigation_planting_bed_front_run:
name: water
min: 1
max: 60
step: 1
icon: mdi:water
irrigation_planting_bed_front_wait:
name: wait
min: 0
max: 60
step: 1
icon: mdi:timer-sand
irrigation_planting_bed_front_repeat:
name: repeat
min: 1
max: 10
step: 1
icon: mdi:repeat
irrigation_hanging_plants_front_run:
name: water
min: 1
max: 60
step: 1
icon: mdi:water
irrigation_hanging_plants_front_wait:
name: wait
min: 0
max: 60
step: 1
icon: mdi:timer-sand
irrigation_hanging_plants_front_repeat:
name: repeat
min: 1
max: 10
step: 1
icon: mdi:repeat
irrigation_deck_plants_veg_run:
name: water
min: 1
max: 60
step: 1
icon: mdi:water
irrigation_deck_plants_veg_wait:
name: wait
min: 0
max: 60
step: 1
icon: mdi:timer-sand
irrigation_deck_plants_veg_repeat:
name: repeat
min: 1
max: 10
step: 1
icon: mdi:repeat
input_datetime:
irrigation_morning_start_time:
name: Morning Start Time
has_date: false
has_time: true
irrigation_evening_start_time:
name: Evening Start Time
has_date: false
has_time: true
input_select:
# Use either run days of Frequency they are mutually exclusive
irrigation_run_days:
name: Run Days
options:
- "['Wed','Sat']"
- "['Sun','Thu']"
- "['Mon','Fri']"
- "['Tue','Sat']"
- "['Sun','Wed']"
- "['Mon','Thu']"
- "['Tue','Fri']"
- "['Mon','Wed','Fri']"
- "['Tue','Thu','Sat']"
- "['Mon','Tue','Wed','Thu','Fri','Sat','Sun']"
irrigation_freq:
name: Frequency
options:
- "1"
- "2"
- "3"
- "4"
- "5"
- "6"
- "7"
input_boolean:
irrigation_on:
name: Enable Irrigation
irrigation_config:
name: Show Configuration
irrigation_ignore_rain_sensor:
name: Ignore Rain Sensor
logger:
default: warning
logs:
custom_components.irrigationprogram: debug
custom_components.irrigationzone: debug
Any thoughts? I doubt the problem is on the lovelace side – but let me know if you need a dump of that to see that as well.
I’m really looking forward to being able to use your component … Hopefully it’s something small. Incidentally, I pulled from Git after your latest updates a couple of days ago.
Thanks!