Multiple Rachio Controller Schedule Coordination

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…

Well seem to be up and running for over a week now. Been tweaking on automation settings to maximize the run time efficiencies of my well so as to not short cycle it. The only issue still pending (which I believe is a Rachio issue) is that my primary flex daily stops short every morning at about 7:09AM. This has consistently happened over the past several days where the schedule ran. I do have it set to “start at sunset” and not “finish by sunrise”, but I may just try switching that to a hard start time and see if that makes a difference. Either way I have a ticket in with Rachio support. The other small issue is reported water time in the history. The way their app works it only reports the last run time after the last pause and not total water time for the zone. Kind of annoying but they assured me when setting the next flex daily schedule it takes the total watering time from the previous schedule into account. We shall see…

The way their app works it only reports the last run time after the last pause and not total water time for the zone.

That’s strange…When you look back at a previous day does it show the correct amount or is it always just the time after the pause?

Glad to hear the rest seems to be working.

When I look at the history of “watered” it only show the time from the last pause, not total watering time. Hoping to hear back from Rachio on this, but they did state this was expected/intended behavior which doesn’t really make sense to me. Will report back when I hear from them.

Hey @brg468,

My saga with Rachio continues. I’ve been discussing with them the manual shut off that seems to happen every 12 hours after my flex daily schedule has started. Do you think I could be over-polling their API?

thanks for your thoughts.

Chandler


Emma N. (Rachio)

Nov 6, 2020, 5:50 AM MST

Rachio’s public API has rate limiting in order to improve server performance for all users. We only allow 1,700 calls per day, which is over 1 call per minute. In general, this limit is only reached by integrations that are polling.

If you’d like to explore a non-polling method, we do support webhooks. We are absolutely willing to work with users to discuss exceptions on rate limiting for specific use cases.

Rate limiting is reset at midnight UTC and the response header can be viewed for the following data:

X-RateLimit-Limit – The limit that you cannot surpass in a given amount of time

X-RateLimit-Remaining – The number of calls you have available until a given reset timestamp or calculated given some sort of sliding time window.

X-RateLimit-Reset – The timestamp in UTC formatted to HTTP spec per RFC 1123 for when the limits will be reset.

Example of response header data:
x-ratelimit-limit →1700
x-ratelimit-remaining →4
x-ratelimit-reset →2018-03-13T00:00:00Z

To learn more about our API token, check out our Rachio API Documentation

One other thing to notice is that, if your system goes offline, it will follow the normal schedule, without the automation control, which could possibly damage your system.

Another great resource I highly recommend is the Rachio community, where you can find users with similar issues: community.rachio.com

I hope this helps and let me know in case of further questions or concerns!
Best,

Emma N.
Rachio Support

The only time we poll is on startup of HA. Everything else is webhook-based, the exception being any commands we send to the controller would count towards the rate limit.

Did Rachio say they think you’re hitting the rate limit?

How often is the pause/resume automation running? Unless its triggering almost constantly I can’t see that being an issue…

They were stating the rate limit might be the cause, but I’m comfortable stating I know we are not hitting their rate limit. Over the 12 hour schedule, the “integration event” on the history of the Rachio was activated 43 times and at almost exactly 3 hours (10:30AM) it says Schedule Stopped - Primary was manually stopped after 723 minutes. However, I know I didn’t manually stop anything.

Thoughts?

Is the schedule being started through the app, i.e. a flex schedule, or are you starting it from HA somehow?

I don’t know that it matters but just trying to rule things out

Also what kinds of integration events is it showing in the history?