Best method of triggering changes to seasonal programs in my irrigation controller?

I have an OpenSprinkler controller. I have set up multiple programs for different times of the year. Before we get into what I’m trying to do, I do want to acknowledge that I realize the OpenSprinkler firmware does provide scheduling mechanisms. However, I do not feel these are sophisticated enough for what I want to do.

I am trying to decide which trigger would be best to use to switch between programs. Right now, I use sensor.season but I’m worried this isn’t granular or accurate enough. My automation is below.

- alias: "Irrigation: Switch to Seasonal Program"
  id: 52bd58dc-1d85-472a-8ec4-eead62432a40
  trigger:
    - platform: time
      at: "00:00"
    - platform: homeassistant
      event: start
    - platform: state
      entity_id: sensor.season
  action:
    - choose:
        - conditions:
            - condition: state
              entity_id: sensor.season
              state: [spring, autumn]
          sequence:
            - service: homeassistant.turn_off
              entity_id:
                - switch.summer_program_enabled
            - service: homeassistant.turn_on
              entity_id:
                - switch.fall_spring_program_enabled
                - switch.flower_beds_program_enabled
        - conditions:
            - condition: state
              entity_id: sensor.season
              state: [summer]
          sequence:
            - service: homeassistant.turn_off
              entity_id:
                - switch.fall_spring_program_enabled
            - service: homeassistant.turn_on
              entity_id:
                - switch.summer_program_enabled
                - switch.flower_beds_program_enabled
      default:
        - service: homeassistant.turn_off
          entity_id:
            - switch.fall_spring_program_enabled
            - switch.summer_program_enabled
            - switch.flower_beds_program_enabled

There’s a lot of redundancy here as well. It’s difficult to duplicate all the program names multiple times in each squence section. It would be nice if I could build a mapping in the automation (a map of program name to seasons or months in which it should be active) and use a template expression to loop over those and call the appropriate service on them. I’m not sure how to do that, though.

I’d also like to be able to map these programs to MM/DD dates. For some programs, I would assign multiple date ranges (such as time frames in both fall and spring). Weather in Texas always seems to be a bit misaligned with your typical seasons (simply based on temperature) so this is why I’m hoping for some more granularity.

Can someone offer guidance on reducing the redundancy here as well as how I can set this up to work with date ranges?

What I see is an automation that turns on/off three switches depending on the season.

What do these three switches control? They seem to serve as flags, to indicate what should/shouldn’t be enabled. Are they Template Switches?

What in the automation you posted represents the “programs” you are referring to?

The switches control irrigation programming in Open Sprinkler. The details of the program itself are managed outside of HASS. The switch is just a way to turn those programs on and off so they run according to the weekly schedule it is set up for. When the switch is ON, you allow that program to run on whatever days of the week it is set to automatically turn on. When it is OFF, the program never runs regardless of its schedule. Does that clarify a bit better?

Yes, thank you. What’s the integration you’re using to integrate OpenSprinkler with Home Assistant? I assume this integration is responsible for generating the three switch entities.

I use an open sprinkler integration delivered through HACS. The automation itself I typed by hand.

I would suggest a different approach altogether. Trying to trigger based on season or even months is never going to be reliable and always wasteful at times and under water at others. My recommendation would be to step back and look at soil moisture sensors if you have a budget for them and hyper-local weather forecasts if not.

If you are interested in the soil moisture sensor route I can elaborate on my set up.

2 Likes

I’m open to soil moisture sensors.

  • Are they z-wave or wifi?
  • Battery powered (and if so how long do those last)?
  • Maybe you answered this with weather forecasts but would temperature sensors be useful too (probably can just use the weather for that I imagine)?
  • What are “hyper-local” weather forecasts?
  • I use the Ecowitt soil moisture sensors which use 900Mhz to a gateway which connects via wifi
  • Sensors are battery powered by a single AA. I have 21 sensors and have replaced 1 battery in about 18mos.
  • I have temperature sensors but do not use them for watering decisions. I use them for alerting of low temperatures or just out of curiosity.
  • Some forecast sites are generalized for an area like a zip code, city, or metro area. In many geographies this is not good enough as different areas in close proximity can have drastically different forecasts, particularly rainfall. Hyper-local attempts to forecast for very small areas and use your coordinates to pick the cell you are in. I use NWS because there is already a decent integration built but there are others that would work as well.

Here is a link to a post I made on reddit with more details on my setup if interested. Happy to answer any questions or accept feedback if you anyone has ideas on potential improvements.

3 Likes