Irrigation Custom Component with Custom Card

Hi, I have built my own switch using ESP8266 and 24VAC irrigation solenoids, I will document my project one of these days. Still a work in progress really, I have to get a new circuit board printed to implement a few new features.

but I have seen many variations, BHyve is used by bsp9493 in the recent posts, and I have seen people use sonoff controllers. Garden Irrigation is a good place to start for other projects. A lot of posts on this thread though.

No reason this won’t work in your greenhouse as long as you have a switch exposed and available in HA this will work.

I’m interested in how you go with your project please post some feedback here when you get it underway. Good luck with the build. We are heading into autumn down here in Australia.

1 Like

Was working great Peter, but after a reboot, noticed a problem I can’t track down.

Zones will turn on and off as expected with the changes recent changes you made.

I set up multiple irrigation programs and configured my Lovelace to my system, and now all of a sudden, when irrigation program triggers, my 1st zone, will flash on/off and them move to zone 2, 3, 4 normally for the rest of the program cycle.

I have checked everything I can think of, is it possible I did something when I created the additional programs?

Lovelace and irrigation yaml included for review

irrigation_component:
    switch:
      - platform: irrigationzone
        switches:
          front_street:
            friendly_name: Front Street
            water: input_number.irrigation_front_street_run
            wait: input_number.irrigation_front_street_wait
            repeat: input_number.irrigation_front_street_repeat
            switch_entity: switch.dummy_3
            icon_off: 'mdi:grass'
          front_lawn:
            friendly_name: Front Lawn
            water: input_number.irrigation_front_lawn_run
            wait: input_number.irrigation_front_lawn_wait
            repeat: input_number.irrigation_front_lawn_repeat
            switch_entity: switch.dummy_1
            icon_off: 'mdi:grass'
          back_dripline:
            friendly_name: Back Dripline
            water: input_number.irrigation_back_dripline_run
            wait: input_number.irrigation_back_dripline_wait
            repeat: input_number.irrigation_back_dripline_repeat
            switch_entity: switch.dummy_5
            icon_off: 'mdi:pine-tree'
          front_door_shrubs:
            friendly_name: Front Door Shrubs
            water: input_number.irrigation_front_door_shrubs_run
            wait: input_number.irrigation_front_door_shrubs_wait
            repeat: input_number.irrigation_front_door_shrubs_repeat
            switch_entity: switch.dummy_2
            icon_off: 'mdi:tree'



      - platform: irrigationprogram
        switches: 
          program_1:
            friendly_name: program 1
            irrigation_on: input_boolean.irrigation_on
            start_time: input_datetime.irrigation_program_1_start_time
            #run_freq: input_select.irrigation_freq
            run_days: input_select.irrigation_run_days
            rain_sensor: binary_sensor.meteobridge_is_raining
            ignore_rain_sensor: input_boolean.irrigation_ignore_rain_sensor
            icon: mdi:fountain
            zones:
              - zone: switch.front_lawn
              - zone: switch.front_street
              - zone: switch.front_door_shrubs
              - zone: switch.back_dripline

          program_2:
            friendly_name: program 2
            irrigation_on: input_boolean.irrigation_on
            start_time: input_datetime.irrigation_program_2_start_time
            #run_freq: input_select.irrigation_freq
            run_days: input_select.irrigation_run_days
            rain_sensor: binary_sensor.meteobridge_is_raining
            ignore_rain_sensor: input_boolean.irrigation_ignore_rain_sensor
            icon: mdi:fountain
            zones:
              - zone: switch.front_lawn
              - zone: switch.front_street
              - zone: switch.front_door_shrubs
              - zone: switch.back_dripline

          program_3:
            friendly_name: program 3
            irrigation_on: input_boolean.irrigation_on
            start_time: input_datetime.irrigation_program_3_start_time
            #run_freq: input_select.irrigation_freq
            run_days: input_select.irrigation_run_days
            rain_sensor: binary_sensor.meteobridge_is_raining
            ignore_rain_sensor: input_boolean.irrigation_ignore_rain_sensor
            icon: mdi:fountain
            zones:
              - zone: switch.front_lawn
              - zone: switch.front_street
              - zone: switch.front_door_shrubs
              - zone: switch.back_dripline

    input_number:
      irrigation_front_street_run:
        name: water
        min: 1
        max: 30
        step: 1
        icon: mdi:water
        unit_of_measurement: min
      irrigation_front_street_wait:
        name: wait
        min: 0
        max: 10
        step: 1
        icon: mdi:timer-sand
        unit_of_measurement: min
      irrigation_front_street_repeat:
        name: repeat
        min: 0
        max: 10
        step: 1
        icon: mdi:repeat
        unit_of_measurement: iterations

      irrigation_front_lawn_run:
        name: water
        min: 1
        max: 30
        step: 1
        icon: mdi:water
      irrigation_front_lawn_wait:
        name: wait
        min: 0
        max: 10
        step: 1
        icon: mdi:timer-sand
      irrigation_front_lawn_repeat:
        name: repeat
        min: 0
        max: 10
        step: 1
        icon: mdi:repeat

      irrigation_back_dripline_run:
        name: water
        min: 1
        max: 30
        step: 1
        icon: mdi:water
      irrigation_back_dripline_wait:
        name: wait
        min: 0
        max: 10
        step: 1
        icon: mdi:timer-sand
      irrigation_back_dripline_repeat:
        name: repeat
        min: 0
        max: 10
        step: 1
        icon: mdi:repeat

      irrigation_front_door_shrubs_run:
        name: water
        min: 1
        max: 30
        step: 1
        icon: mdi:water
      irrigation_front_door_shrubs_wait:
        name: wait
        min: 0
        max: 10
        step: 1
        icon: mdi:timer-sand
      irrigation_front_door_shrubs_repeat:
        name: repeat
        min: 0
        max: 10
        step: 1
        icon: mdi:repeat

    input_datetime:
      irrigation_program_1_start_time:
        name: Start Time 1
        has_date: false
        has_time: true
      irrigation_program_2_start_time:
        name: Start Time 2
        has_date: false
        has_time: true
      irrigation_program_3_start_time:
        name: Start Time 3
        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']"
          - "['Wed','Fri','Sun']"
          - "['Sun','Mon','Tue','Wed','Thu','Fri','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

Hi, I’ve recreated the problem and will work on finding a solution to this issue.

Cheers
Pete

Peter

I am getting this error in my logs
This sensor defiantly exists. as a result the rain sensor is just ignored

Logger: custom_components.irrigationprogram.switch
Source: custom_components/irrigationprogram/switch.py:168 
Integration: Irrigation controller component (documentation) 
First occurred: 11:27:09 (1 occurrences) 
Last logged: 11:27:09

binary_sensor.outside_box_door not found

Hi, this should be working for you now.

I have moved this validation to later in the program where it is fired once HA is fully started. I have also modified the process to be only a warning so it does not prevent any execution.

Peter

that error is gone though, but the rain sensor still is not being respected, the program starts no matter what the state of that binary sensor is.

I also cannot see anything recorded in the logs. What do you suggest

Hi Terence, Good news I have fixed the issue, there is a new version of the irrigationprogram/switch.py in the github repository now. Let me know how you go. Cheers Pete

seems good on my end… switches working, no errors on restart

thank again for the work on this Peter… now just need the weather to warm up (in BC Canada)

Dave

Peter

Unfortunately I am not so lucky, here is what I find:

  • When I have the rain sensor open and a program is supposed to start, the program boolean activates but no relays are activated, I guess this is half right? should the program toggle also not activate.

  • The 'Ignore rain sensor" seems not to make any difference

  • If I manually run the program and the rain sensor is open, then the program still begins, surely this should not be the case?

  • I am not seeing any event or logs indicating what has happened, should we not log an event if the program does not run because the rain sensor was open?

Peter

It seems as if there may be a delay when activating the ignore rain sensor boolean.
I had it off and then when I activated the program manually the program boolean activated but not relays. I then activated the ingore rain sensor boolean and the activated the program toggle and the program started as expected

Now I have deactivates the ignore rain sensor toggle and when I start the program the realys are activated anyway

Hi, if you activate the program manually it will just run as I figured there is an intent to run it regardless of the weather or if the sensor was wet by accident when washing the car :slight_smile:
There is a 1 second delay on starting the first relay to get around an issue, not elegant but it works until I find a better solution.

if you want some debug data add the following to you configuration.yaml. Best to use a log viewer or just samba into your HA instance to see the log file, or ‘load full home assistant log’ from the log page. That will give you some more data about each of the attributes and the evaluation taking place to run program and zones.

logger:
    default: warning
    logs:
        custom_components.irrigationprogram: debug
        custom_components.irrigationzone: debug

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!

Hi Robbert,

In the zones: section of the irrigationprogram you need to reference the switch created by the irrigationzone.

So instead of

zones:
  - zone: switch.irrigation_zone_1

you need to put

zones:
  - zone: switch.front_yard_driveway

Hi Peter,

Duh! I can’t believe I missed that. Thanks! It seems to be working now, but I still see this warning in the HA log when the program starts. Should I just ignore it? Or is something else going on?

2021-03-17 07:20:10 WARNING (MainThread) [homeassistant.helpers.entity] Update of switch.morning is taking over 10 seconds

I have the same problem, It does not seem to affect anything, one of the todo’s I have on this integration. It pops up as soon as the switch starts no 10 second wait, just a warning so I am ignoring it for the moment.

I’m trying to figure out how to validate that the switch is part of the custom component domain so you get an error if you don’t define the correct entity type but it is proving difficult, I will have to sleep on it.

No problem! I’ll ignore it for the time being …
I do have a few suggestions for future improvements, if you’re willing… If not, I’ll be more than happy to hack these in myself at some point …

  1. Selective rain sensor behavior - i.e. some zones don’t water when the rain sensor is active, others do. In my case, I have a few hanging plants under a porch roof that still need water, regardless of the rain sensor status.
  2. Different configuration of watering lengths per program (I’m not sure if this is possible now by duplicating zone definitions – but perhaps show the configuration for one program at a time with a similar method you use now to show/hide configuration globally).
  3. (this is probably way too involved, but I’m going to try taking it on as a project) – calculate whether or not watering needs to happen based on the rain forecast for that day, as well as total accumulated rain in my weather station for that day. Or maybe reduce the length of watering based on the rain accumulation and forecast … I have seen some other projects doing this, or something similar, but I’m not sure if they can be easily integrated or not. Fun spring/summer project for the weekends though! :slight_smile:

Thanks for putting this together though!
I just started playing around with Home Assistant a couple of months ago, and I have accomplished more already, automation-wise, than the last decade writing my own C++ and C# code. :slight_smile:

Hi Robbert,

There is already an optional configuration item to ignore the rain sensor at the irrigationzone level as well as the program level. You can use two different inputs to manage at zone and program level simultaneously.

  - 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_solenoid_01
        icon_off: 'mdi:flower'
        ignore_rain_sensor: input_boolean.irrigation_ignore_rain_sensor

You can create a template binary sensor for the rain sensor, https://www.home-assistant.io/integrations/binary_sensor.template/, that could incorporates many inputs to determine if the program needs to run. This gives control back to you to implement as complex a model as you like.

For varying the watering time based on the weather; I would use an automation to modify the input number based on your algorithm. https://www.home-assistant.io/integrations/input_number/ has services that allow you to increment, decrement, set_value. The value template could be as simple or complex as you choose to make it. There maybe some unintended consequences of this that should be tested e.g. the run duration changing while a zone is running. Here is an example of how it could work.

automation:
- id: '1553507967550'
  alias: rain adjuster
  mode: restart
  trigger:
  - platform: time_pattern
    minutes: "/1"
  action:
    - service: input_number.set_value
      entity_id: input_number.irrigation_pot_plants_run
      data:
        value: "{{ (states('input_number.irrigation_pot_plants_run')|float * states('input_number.rain_adjuster')|float)|int }}"

A different watering pattern depending on the program, this is possible, I will add this to the ‘to do’ list.

How the UI shows or hides the configuration this is config that can be done in the lovelace UI so you can make it behave anyway you like its just a matter of changing how the conditions are set.

Thanks Peter!

I’ll give your suggestions a try in the next few days! We’re still a few weeks away here from having to start watering, so this is the perfect time to perfect the algorithm and control aspects.