Irrigation Custom Component with Custom Card

No Problem, have you considered adding it to hacs.

Trying now and will report back

1 Like

Thought about it but limited time, wrote it for my self and found time to document it then life caught up.

1 Like

I know the feeling.

Looks like it is working now.
By the way How doe the binary sensor for rain work?

Great news, thanks for your help.
I have a rain sensor that connects to a commercial irrigation controller hooked up to my ESP. I got a circuit board printed and build my own controller that runs off 24v ac. I need to build one more iteration of that.
But you can use a template sensor to use any combination of other inputs to determine to water or not. Played with using the weather to act as a sensor.

1 Like

Peter

Is the program suppose to trigger automatically if the day and time match? I can seem to get the program to trigger

Try resetting the last ran attribute using the developer tools on creation it sets it self to today

1 Like

Still not starting
I have tried with the ignore rain sensor toggle on and off

Hi Terrence, can you send me your config, for the irrigation component. Cheers Pete

here you go

switch:
  - platform: irrigationzone
    switches:
      pot_plants:
        friendly_name: Pot Plants
        water: input_number.irrigation_pot_plants_run
        wait: input_number.irrigation_pot_plants_wait
        repeat: input_number.irrigation_pot_plants_repeat
        switch_entity: switch.irrigation_controller_1_zone_1
        icon_off: 'mdi:flower'
        unique_id: i1
      front_lawn:
        friendly_name: front Lawn
        water: input_number.irrigation_lawn_run
        wait: input_number.irrigation_lawn_wait
        repeat: input_number.irrigation_lawn_repeat
        switch_entity: switch.irrigation_controller_1_zone_2
        icon_off: 'mdi:grass'
        unique_id: i2
      vege_patch:
        friendly_name: Vege Patch
        water: input_number.irrigation_vege_run
        wait: input_number.irrigation_vege_wait
        repeat: input_number.irrigation_vege_repeat
        icon_off: 'mdi:carrot'
        switch_entity: switch.irrigation_controller_1_zone_3
        unique_id: i3

  - platform: irrigationprogram
    switches: 
      morning:
        unique_id: i4
        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.ewelink_ds01_e3504322_ias_zone 
        ignore_rain_sensor: input_boolean.irrigation_ignore_rain_sensor
        icon: mdi:fountain
        zones:
          - zone: switch.pot_plants
          - zone: switch.vege_patch
          - zone: switch.front_lawn


input_number:
  irrigation_pot_plants_run:
    name: water
    min: 1
    max: 30
    step: 1
    icon: mdi:water
    unit_of_measurement: min
  irrigation_pot_plants_wait:
    name: wait
    min: 0
    max: 10
    step: 1
    icon: mdi:timer-sand
    unit_of_measurement: min
  irrigation_pot_plants_repeat:
    name: repeat
    min: 1
    max: 10
    step: 1
    icon: mdi:repeat
    unit_of_measurement: iterations

  irrigation_lawn_run:
    name: water
    min: 1
    max: 30
    step: 1
    icon: mdi:water
  irrigation_lawn_wait:
    name: wait
    min: 0
    max: 10
    step: 1
    icon: mdi:timer-sand
  irrigation_lawn_repeat:
    name: repeat
    min: 1
    max: 10
    step: 1
    icon: mdi:repeat

  irrigation_vege_run:
    name: water
    min: 1
    max: 30
    step: 1
    icon: mdi:water
  irrigation_vege_wait:
    name: wait
    min: 0
    max: 10
    step: 1
    icon: mdi:timer-sand
  irrigation_vege_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_afternoon_start_time:
    name: Afternoon Start Time
    has_date: false
    has_time: true
  irrigation_midday_start_time:
    name: Midday 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']"

  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

comment out run_days, rain_sensor and ignore_rain_sensor. It should then start at the start_time specified.

Still no joy.
FYI, the ewe link is a binary in my setup, and I had been testing with it in the open state, and the ignore rain sensor on. It I understand the logic, this should mean the program will run?

with ignore rain sensor ‘on’, the rain sensor will not impact the running even if the rain sensor is ‘on’. I will add some logging into the program over the next couple of days and let you know when I have a new version.

Does the program start manually if you turn the ‘program’ switch on?

Thanks, yes the program runs, but not by the time. I guess I could use an automation, but that seems counter intuitive

absolutely, let me add the logging so I can see what the template is internally and how it evaluates.

I’ve loaded a new irrigationprogram switch.py. if you copy it and restart HA you will get the template that is built internally. You can evaluate it in the developer tools template tab if you copy the ‘{{ text… }}’ that is in the logs

Sorry Terence I forgot to commit the change

one more small variation between your config and mine is I don’t have any unique_id values set in my yaml.

Hi Terrence, I have updated the irrigation program switch.py to perform additional validation. It will also output an error to the log with the template that is used to evaluate when to run the program. You can check this in the developer tools to see if anything is stopping it from evaluating to true with your configuration

Peter

still not running, I seem to get the template randomly in the logs

{{ states('sensor.time') + ':00' == 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') }}

That’s good, this is the template evaluated to start the program.
Can you:

  1. remove the optional settings run_days, rain_sensor, and ignore_rain_sensor from the yaml and restart HA
  2. copy the template that results into your developer tools/template and evaluate it there, changing the start time in the input_datetime
  3. if that works can you add in the irrigation_run_days and validate it again.