Multiple Rachio Controller Schedule Coordination

Ok, so I have two Rachio v3 Controllers integrated with HASS. I’ve been on a mission to get my well and irrigation controller talking so my irrigation system does not drain my well (especially when we are trying to do laundry or take showers in the house). Through two other posts and some very helpful individuals( @SpikeyGG and @brg468 thank you both so much for your help!!) I have one final piece I am trying to figure out…

My goal is to simply setup an automation where the Rachio’s will not run simultaneously as this will cause my well to drain. My previous posts have allowed me to successfully pause and resume my irrigation system via HASS automations, this part works great. Now I’m simply looking to setup one final automation to allow them to run their independent schedules without running simultaneously. I was hopeful there was a “state” in the Rachio device for “watering” or “idle”, but nothing I currently see has this.

Any other thoughts on how I could make one controller “wait” to start its weather variable schedule until the other controller has completed its schedule and/or vice versa?

As always, thanks in advance for anyone and everyone’s help. Rachio support basically told me to either run one in the morning and one in the afternoon and/or run two different controllers on two different days, but that somewhat defeats the purpose of using the weather intelligent schedule.

thanks again to all for your suggestions!

I’ve got an idea you can try, but I’m not entirely sure how the pause command works if you call it repeatedly. It would look something like this, using one of the schedules as the watering/idle determining factor. You’d have to try calling pause on a controller thats already paused to see if it restarts the time, if not this wouldn’t be the solution.

trigger:
  - platform: state
    entity_id: switch.<controller_2_schedule>
    from: 'off'
    to: 'on'
condition:
  - condition: state
    entity_id: switch.<controller_1_schedule>
    state: 'on'
action:
  - service: rachio.pause_watering
    data:
      devices: <controller_2>
  - repeat:
      while:
        - condition: state
          entity_id: switch.<controller_1_schedule>
          state: 'on'
      sequence:
        - wait_template: "{{is_state('switch.<controller_1_schedule>','off')}}"
        # Wait just under the 1 hour and if the other controller is still running, re-start the pause.
          timeout: '58:00:00'
        - choose:
            - conditions:
                - condition: template
                  value_template: "{{not wait.completed}}"
              sequence:
                - service: rachio.pause_watering
                  data:
                    devices: <controller_2>
          default:
            - service: rachio.resume_watering
              data:
                devices: <controller_2>

thank you sir! Will give it a try tonight when I get home!

ok, so quick question. I’be been trying to create this automation by following the code. I’m fine until I get to the action piece. First of all, should I be doing this somewhere else or trying to create the automation as I have been. I saw the template section in the developer tools, but it was getting hung up on the “wait” comment. Any guidance is appreciated, thanks again @brg468

The easiest way would probably be try to copy the whole thing into your automations.yaml file in the config folder and create the automation that way. The commented line is just for your info so it can be removed.

I guess I would test the ability to re-start the pause while the controller is already paused, cause if that doesn’t work as expected this whole thing would have to be figured out another way. Let me know if you need more help on the automation.

And just to clarify, pause the controller for a duration of say 5 minutes, wait a minute or so then send another pause command and see if the controller resumes at the original time or changes to the new one.

So I was able to test, and it doesn’t quite work the way I had hoped…

Rachio will only let you pause up to 60 minutes at a time, so if I’m paused for say 10 minutes, then send a 60 minute pause command, it essentially adds only another 50 minutes, keeping the total at 60.

The easy solution would be let it resume for a couple seconds then send another 60 minute pause command, that seems to work. It would probably happen fast enough that the zone wouldn’t actually even turn on. If that’s something you can live with, let me know and I’ll adjust the automation.

The other option would be to rain delay or stop the 2nd schedule via an automation and then start it again once the first controller finishes. Since I think you said your using flex monthly not flex daily that would be another way to go.

thank you so much for testing! I am actually using flex daily now that I have the pressure sensor setup so would definitely be ok with option 1 as presented, thank you so much for your assistance! The automation I’m currently using (which I assume would work in conjunction with this one) is below. Do you see any issue with this?

  • id: ‘1601089528932’
    alias: Rachio Delay
    description: Delay Rachio when water pressure low
    trigger:
    • below: ‘30’
      entity_id: sensor.water_pressure
      platform: numeric_state
      condition: []
      action:
    • data: {}
      service: rachio.pause_watering
      mode: single
  • id: ‘1601090036962’
    alias: Rachio Resume
    description: Resume Watering
    trigger:
    • above: ‘55’
      entity_id: sensor.water_pressure
      platform: numeric_state
      condition: []
      action:
    • data: {}
      service: rachio.resume_watering
      mode: single

I hope I posted this right, just cut and past from the automations.yaml

Alright, lets try this. :crossed_fingers:

For future reference if you’re copying from a .yaml, select the text and use the preformatted text button (</>), that keeps the indentation.

Your pause automation should be fine, the resume one will have to be adjusted so it doesn’t inadvertently resume both controllers if the second one is waiting for the first to finish. Something like that should work. My other thought I had after doing all this was that using the schedules as an indicator of which controller is running works fine if you only have 1 separate schedule on each controller that you plan to use regularly. Maybe at some point down the road I’ll look into creating a binary sensor that shows if each controller is running or not to make it more straight forward.

Sorry this got kinda long winded. Let me know if you have questions.

alias: Rachio Pause
trigger:
- platform: state
  entity_id: switch.<controller_2_schedule>
  from: 'off'
  to: 'on'
condition:
- condition: state
  entity_id: switch.<controller_1_schedule>
  state: 'on'
action:
- service: rachio.pause_watering
  data:
    devices: "<controller_2>"
- repeat:
    while:
      - condition: state
        entity_id: switch.<controller_1_schedule>
        state: 'on'
    sequence:
      - wait_template: "{{is_state('switch.<controller_1_schedule>','off')}}"
      # Wait just under the 1 hour and if the other controller is still running, re-start the pause.
        timeout: '59:00:00'
      - choose:
          - conditions:
              - condition: template
                value_template: "{{not wait.completed}}"
            sequence:
              - service: rachio.resume_watering
                data:
                  devices: "<controller_2>"
              - delay:
                  seconds: 2
              - service: rachio.pause_watering
                data:
                  devices: "<controller_2>"
        default:
          - service: rachio.resume_watering
            data:
              devices: "<controller_2>"
id: ‘1601090036962’
alias: Rachio Resume
description: Resume Watering
trigger:
- above: ‘55’
  entity_id: sensor.water_pressure
  platform: numeric_state
condition: []
action:
- data_template:
  devices: "{% if is_state('switch.<controller_1_schedule>','on') %} '<controller_1>' {%else%} '<controller_2>'{%endif%}"
  service: rachio.resume_watering
mode: single

oops, ok sorry about that, can definitely make sure I keep proper formatting (first time posting code). I actually was looking for a “state” provided by Rachio which would show whether the unit was watering or idle (like it says on the home page of the Rachio mobile app), but didn’t see that state available as I thought that would make it much easier, sounds like great minds think alike there! Only follow up would be is do I just post this code straight into the .yaml file or should I be somehow adding within home assistant?

thanks again…

Generally I would say you could base the controller status off the zone switches on that controller being on or off, but during a pause I think all the zones would indicate off, so that would cause issues. So for now the schedules will have to do.

As far as the above code, I would copy it directly to your automations.yaml, fill in the relevant pieces and then figure out what I screwed up using the check config button under server controls. As long as there aren’t any errors you can then reload automations and it should be good to go. Let me know how it goes.

Just noticed I missed some quotes after devices:. It’s fixed up there now.

ok, I must be translating something wrong, below is the code I’m adding and below that is the error I’m getting for the Rachio Resume, I’m sure it is something simple, but I can’t seem to figure it out. Trying the Rachio Pause automation now…


- id: '1601090036962'
  alias: Rachio Resume
  description: Resume Watering
  trigger:
  - above: '55'
    entity_id: sensor.water_pressure
    platform: numeric_state
  condition: []
  action:
  - data_template:
    devices: "{% if is_state('switch.primary_schedule_schedule','on') %} 'Primary Controller' {%else%} 'Pool House'{%endif%}"
    service: rachio.resume_watering
  mode: single
  Invalid config for [automation]: expected a dictionary for dictionary value @ data['action'][0]['data_template']. Got None
extra keys not allowed @ data['action'][0]['devices']. Got None. (See /config/configuration.yaml, line 49).

Indentation on devices was off. My bad. Try that

looks like that took with no errors! Will test here shortly, will also load the other automation into .yaml now and then start testing…

ok, have both loaded with no errors. Will let the testing begin and report back!

ok, testing going well. Only one issue that I believe I am seeing. When my primary controller is in pause due to low water pressure and the secondary controller has elapsed its 59 minute time frame, it starts its watering schedule. This caused an overload on the well and caused both schedules to be severely delayed and I ended up stopping both of them and trying again another night (tonight). So my ask would be, is it possible to update the Rachio Resume automation so it also pauses if the primary controller and/or schedule is in pause??? Thanks!

Did the 2nd controller not go back into pause after the 59 minutes was up?

So a thought just occurred to me… :man_facepalming:

I think the wait.completed variable was just introduced in 0.115. So if your running anything older than that, it’s skipping the whole part that has it pause again because it throws an error. So if your able, I would try upgrading. If your already on 0.115 then let me know cause there’s something else going on.

agh got it, ok I’m currenly on .114, will update and report back.

thanks,

Chandler

ok, on .115 and up and running. I have had to update my Rachio schedules as I had a few custom which were interfering with the automations. I have not edited those and am cautiously optimistic. Will review over the next few days, but so far everything seems to be behaving as expected! Thanks again for all your help…