Configure Sprinklers

Hello everybody,

i have a little problem, and maybe you can help me.
I have a Rainbird irrigation with 9 zones.
The sprinklers are already integrated in the home assistant.

I would like to have all zones started manually one after the other with the push of a button.

for example:

Zone 1 starts for 10 min, when the zone is finished,
should start the next one.
With a little break in between. 1 to 3 seconds.
I’d like to include a slider for setting the time for each zone.

Thank you

Seems like a pretty simple script.

Make your 9 input numbers that contain the run times.

Then create a script to turn the first sprinkler on, wait a delay time set to your input number.

After the delay, turn off the previous sprinkler, wait a small delay then repeat the sequence for the next sprinkler.

Call the script from a Lovelace button.

Hi Tom,

Thanks for the help, maybe you can give me an example, I still don’t know where to start.
As far as automation and scripts are concerned, I’m still a beginner.

Start by reading the documentation, there are examples:

Have a go at writing a simple script that turns one zone on, waits a short fixed delay then turns it off again. Post it here and I’ll show you how to extend it to do what you want.

sprinkler:
alias: Sprinkler
mode: single
sequence:

  • data: {}
    entity_id: switch.05200020ecfabc93579f
    service: switch.turn_on
  • delay: 00:00:03
  • data: {}
    entity_id: switch.05200020ecfabc93579f
    service: switch.turn_off

Excellent start. Now if you could please format it correctly (see point 11 here then edit your post), we’ll move on to smartening it up.

sprinkler:
  alias: Sprinkler
  mode: single
  sequence:
  - data: 
    entity_id: switch.05200020ecfabc93579f
    service: switch.turn_on
  - delay: 00:00:03
  - data: 
    entity_id: switch.05200020ecfabc93579f
    service: switch.turn_off

Now you need to create nine input_numbers.

Here’s a couple of examples:

input_number:
  zone_1_time:
    name: Zone 1 On Time
    min: 0
    max: 30
    step: 1
    icon: mdi:update

  zone_2_time:
    name: Zone 2 On Time
    min: 0
    max: 30
    step: 1
    icon: mdi:update

# repeat for remaining 7 zone timers (copy / paste / edit is easy).

We can then use these input numbers in your automation:

sprinkler:
  alias: Sprinkler
  mode: single
  sequence:
  - service: switch.turn_on
    entity_id: switch.05200020ecfabc93579f
  - delay: 
      minutes: "{{ states('input_number.zone_1_time') }}"
  - service: switch.turn_off
    entity_id: switch.05200020ecfabc93579f
  - delay: 
      seconds: 3
  - service: switch.turn_on
    entity_id: switch.second_switch_here
  - delay: 
      minutes: "{{ states('input_number.zone_2_time') }}"
  - service: switch.turn_off
    entity_id: switch.second_switch_here
  - delay: 
      seconds: 3
#... and repeat for the remaining 7 other zones.

I recommend you rename your switches to a human readable form. e.g.

switch.05200020ecfabc93579f --> switch.zone_1_sprinkler_valve

You should be able to do this by clicking on the entity in Configuration / Entities

EDIT: one final thing. There is likely to be a change coming in home assistant v0.155 that will allow you to use the input number in a delay like this:

  - delay: 
      minutes: input_number.zone_1_time

But for now you have to use the full template I have shown in the script above.

Hi Tom,

that’s how far I’ve come, everything works. Great thank you.

I still have a few things and I hope you can continue to help me.

When I press the script button to stop all sprinklers should go out again.
It’s not happening right now.

I would like to show the remaining time for each sprinkler.
The remaining time for the entire sprinkler.
Sum of the time for the entire sprinkler.

How can I show the days of the week to select the irrigation?
For example, irrigation should run on Monday and Wednesday.

I thank you.

sprinkler:
  alias: Sprinkler
  mode: single
  sequence:
  - service: switch.turn_on
    entity_id: switch.05200020ecfabc93579f
  - delay: 
      minutes: "{{ states('input_number.zone_1_time') }}"
  - service: switch.turn_off
    entity_id: switch.05200020ecfabc93579f
  - delay: 
      seconds: 3
  - service: switch.turn_on
    entity_id: switch.042001026001947ed037
  - delay: 
      minutes: "{{ states('input_number.zone_2_time') }}"
  - service: switch.turn_off
    entity_id: switch.042001026001947ed037
  - delay: 
      seconds: 3

Have a read of this topic:

Which control surface?
Home assistant?
That’s just what I’ve posted above, that’s all I have.
Or what do you mean?

I looked at MQTT based sprinkler control.
Looks very good.
I’ll see what I can use from there.

Ignore the topic title. My entire irrigation control automation is posted in that topic. You can adapt the remaining time sensors for what you need.

hi tom,

I looked at the topic today, and copied things out and pasted them into my place.
That doesn’t work for me at all.

Can you help me with the things I mentioned in the post above.
I think I have to do it myself to get it.

I can give you pointers but I don’t have the time to write it for you. Have another go at it and post what you cant get working here.