Rainbird integration - can't automate more than one zone

howdy,
I’m using the Rainbird integration to try and automate my sprinklers. What I’m noticing is that I can only control one (of my two) zones through automations. My goal is to have the 2nd zone (west) run 20 minutes after the first zone (east). The conditions are met because I get the. notification, but the sprinklers never start.

If I adjust them to both run at the same time, then the West zone will run but the east will not.

I’ve tried with both a delay in the actions (below) and a template for the triggers.

trigger example:

{{ (strptime(states('input_datetime.sprinkler_am'), '%H:%M:%S') + timedelta(minutes=20)).strftime('%H:%M') }}

If I test that in the template section of developer tools, it shows the correct time (8:00am + 20 = 8:20am)

But it never works as a trigger for an automation.

time based with delay in action:

alias: Sprinkler West Automation
description: actions include starting 20 mins after East
trigger:
  - platform: time
    at: input_datetime.sprinkler_am
  - platform: time
    at: input_datetime.sprinkler_afternoon
  - platform: time
    at: input_datetime.sprinkler_evening
condition:
  - condition: template
    value_template: |
      {{ states.sensor.nsnetweather_event_rain_2.state | float <= 1 and
         as_timestamp(now()) - as_timestamp(states.sensor.nsnetweather_event_rain_2.last_changed) <= 86400 }}
action:
  - delay:
      hours: 0
      minutes: 20
      seconds: 0
      milliseconds: 0
  - service: rainbird.start_irrigation
    data:
      duration: 20
    target:
      entity_id: switch.sprinkler_west
  - service: notify.mobile_app_nickphone13
    data:
      message: Sprinkler West started at {{ now().strftime('%H:%M') }}
      data:
        entity_id: camera.back_door_high
        actions:
          - action: turn_off_sprinkler
            title: Turn Off Sprinkler
  - delay:
      hours: 0
      minutes: 20
      seconds: 0
      milliseconds: 0
  - service: >-
      service: notify.mobile_app_nickphone13 data:   message: "\"West Sprinklers
      stopped at {{ now().strftime('%H:%M') }}\""
mode: restart

joining this thread.

Got the same issue with the rainbird integration.

Cant get the one of the zones started using a script.
I use this - service: rainbird.start_zone to start the specific zone but it wont start.

I think I got it sorted…
after I posted, it occurred to me I could do it all with one automation and add some more control with some helpers.

The start times are set in three helpers.
I created two toggle helpers, one for each zone. The actions use IF statements to check if those toggles are on. Then duration is set from a helper.

After running the first zone, I use a wait action that adds the duration + an offset (I’ve discovered waiting 3-5 minutes between one zone running and calling the rainbird service helps a lot).

alias: Sprinkler  Automation
description: >-
  automates sprinklers based on: hasn't rained more than 1in in last 24 hours,
  time is one of the three helpers, sprinklers are toggled on. Uses helpers to
  set duration and offset between East and West
trigger:
  - platform: time
    at: input_datetime.sprinkler_am
  - platform: time
    at: input_datetime.sprinkler_afternoon
  - platform: time
    at: input_datetime.sprinkler_evening
condition:
  - condition: template
    value_template: |
      {{ states.sensor.nsnetweather_event_rain_2.state | float <= 1 and
         as_timestamp(now()) - as_timestamp(states.sensor.nsnetweather_event_rain_2.last_changed) <= 86400 }}
action:
  - if:
      - condition: state
        entity_id: input_boolean.sprinkler_east_on
        state: "on"
    then:
      - service: rainbird.start_irrigation
        data:
          duration: "{{ states('input_number.sprinkler_run_minutes' )}}"
        target:
          entity_id: switch.sprinkler_east
      - service: notify.mobile_app_nickphone13
        data:
          message: East Sprinklers started at {{ now().strftime('%H:%M') }}
          data:
            entity_id: camera.back_door_high
            actions:
              - action: turn_off_sprinkler
                title: Turn Off Sprinkler
  - delay: >-
      {{ ((states('input_number.sprinkler_run_minutes') | float +
      states('input_number.sprinkler_run_minutes') | float) * 60) | int }}
  - if:
      - condition: state
        entity_id: input_boolean.sprinkler_east_on
        state: "on"
    then:
      - service: rainbird.start_irrigation
        data:
          duration: "{{ states('input_number.sprinkler_run_minutes' )}}"
        target:
          entity_id: switch.sprinkler_west
      - service: notify.mobile_app_nickphone13
        data:
          message: West Sprinklers started at {{ now().strftime('%H:%M') }}
          data:
            entity_id: camera.back_door_high
            actions:
              - action: turn_off_sprinkler
                title: Turn Off Sprinkler
mode: restart

@spacebass which LNK module do you use for communicating with the controller?

LNK2Wifi?
this one https://a.co/d/fpmCUJI

I got the same one, kinda odd that I cannot select the service start_irrigation.

In my automation I can only select start_zone and select one of my zones in the garden.

Did you do something special for that?

Never mind, I think I got it working now also.