Rachio Smart Sprinkler Controller

I am using the rachio binding for openhavb 2.3.0. Does anyone know if there is a rachio binding that works with Openhab3?

No it is not working. It needs to be updated.

@markus7017 Can you update the Rachio binding sometime for OH3?

2 Likes

After a while I got back to this binding :slight_smile:

I updated the code and provide builds for 2.5.x and 3.x, see below.

I also added a feature, which automatically reformats your openhab.org credentials in the callback url. To receive events from Rachio Cloud you need to

You’ll see incoming events when setting the log level to DEBUG or TRACE.
Next step will be a PR to get it into the official distro, but that will take a while.

Have fun :slight_smile:


Latest DEV builds: 2.5.x - 3.x - README -
Note: The DEV build is always newer than the version in the official Distro or the Milestone builds (SNAPSHOTs); OH Distro 2.5 will not receive updates anymore, so you have to switch to DEV build.

4 Likes

Quick question. I have gmail address as username. My callback url had already set up with %40gmail.com:password. So I used %40 instead of @. Is that still ok?

should still work

I think it does not work for me. How can I test it? Can you give me the hint what messages I should see? I have already changed logging to debug but I will change to trace, just I need some info what to watch for.

you should see “Registered webhooks for device
”
watch out for “Register WebHook, callback url = xxx”
if TRACE is enabled you’ll see “Reqeust from 
”

  • Make sure openhabcloud addon is installed
  • login to myopenhab.org and check that your OH instance is online
  • Set “Clear Callbacks” to ON for testing, this deletes are previously registered webhooks
  • restart binding/OH when you change the URL, this version doesn’t do a new registration if the URL was changed

DEV build has been updated

  • new channel rainSensorTripped
  • README updated

PR has been created: [rachio] Initial contribution by markus7017 · Pull Request #10434 · openhab/openhab-addons · GitHub


Latest DEV builds: 2.5.x - 3.x - README -
Note: The DEV build is always newer than the version in the official Distro or the Milestone builds (SNAPSHOTs); OH Distro 2.5 will not receive updates anymore, so you have to switch to DEV build.

Something is wrong with my Rachio binding setup, but I don’t understand what exactly.

I am running OH 2.5.12 on a Windows 10 platform. I have added org.openhab.binding.rachio-2.5.6-SNAPSHOT.jar to my addons directory.

I have also created a rachio.things file which is as follows (with real password edited):

Bridge rachio:cloud:1 [apikey="db5a5c0d-1e2a-4592-96f0-99c3a614b915", pollingInterval=180, defaultRuntime=3600,  callbackUrl="https://user:pwd@home.myopenhab.org/rachio/webhook", clearAllCallbacks=true]
{
}

Only three of the 8 zones of my Rachio controller are currently being used. These three zones are correctly found (with their names and everything) by the binding and created as OH things.

I created items using some of the channels associated with my zones such as:

 Switch   RachioZone1_Run "Run Zone 1"      
   {channel="rachio:zone:1:009D6BBDE9CA-1:run"}

And I placed some relevant controls on my sitemaps, such as:

Switch item=RachioZone1_Run label="DĂ©marrer Zone Gazon" icon="faucet"  valuecolor=[=="OFF"="green", =="ON"="red"]

I also have a way to set the value of zone runtimes such as RachioZone1_RunTime.

Now, when I trigger the switches such as RachioZone1_Run in the sitemap GUI, the watering does start, and it does stop as expected after expiration of RachioZone1_RunTime. However, the state of my RachioZone1_Run is NOT reset to OFF: it remains stuck to ON.

I don’t suppose that a cloud callback is required to set the switch to OFF in case it was triggered locally through the OH binding. But in any event, I decided to try setting the callback anyway, as shown in my rachio.things file. The trace shows that the webhook is correctly registered:

Register webhook, url=https://user:pwd@home.myopenhab.org/rachio/webhook, externalId=e5137b4901b26314b1873fcf5515a7ca, clearAllCallbacks=true

But the callback does not appear to be working either: when I start a zone using the rachio app, I cannot see any echo of that in OH.

I am attaching my logfile in the hope someone can pinpoint the problem for me.

Rachio issue – OH log

I Also had to encode the . before .com in my email address as %2E, as well as my password included a - that needed to be encoded as %2D Before I was able to get messages to successfully pass through myopenhab.org.

specify you regular e-mail address, the biding handles URL encoding

I cannot get the callbacks to work. I’m on 3.1 M5 and everything else works flawlessly, but no matter how I try to configure the callbackURL I get the same 10 log warnings in a row when an event occurs:

2021-06-22 19:45:41.928 [WARN ] [rachio.internal.RachioHandlerFactory] - Unauthorized webhook event (wrong externalId: 'a6de10f3366b65e4596a63a9f6f5bf7f')
2021-06-22 19:45:41.944 [WARN ] [rachio.internal.RachioHandlerFactory] - Unauthorized webhook event (wrong externalId: 'a6de10f3366b65e4596a63a9f6f5bf7f')
2021-06-22 19:45:42.418 [WARN ] [rachio.internal.RachioHandlerFactory] - Unauthorized webhook event (wrong externalId: 'f2db96d997503574fa8ee03d8856f900')
2021-06-22 19:45:42.518 [WARN ] [rachio.internal.RachioHandlerFactory] - Unauthorized webhook event (wrong externalId: 'f2db96d997503574fa8ee03d8856f900')
2021-06-22 19:45:42.917 [WARN ] [rachio.internal.RachioHandlerFactory] - Unauthorized webhook event (wrong externalId: '53b2191d8948a2960d7bc1644dbfb2e8')
2021-06-22 19:45:43.001 [WARN ] [rachio.internal.RachioHandlerFactory] - Unauthorized webhook event (wrong externalId: '53b2191d8948a2960d7bc1644dbfb2e8')
2021-06-22 19:45:43.419 [WARN ] [rachio.internal.RachioHandlerFactory] - Unauthorized webhook event (wrong externalId: '616df71baade8a78c9b024dd24362fad')
2021-06-22 19:45:43.518 [WARN ] [rachio.internal.RachioHandlerFactory] - Unauthorized webhook event (wrong externalId: '616df71baade8a78c9b024dd24362fad')
2021-06-22 19:45:43.926 [WARN ] [rachio.internal.RachioHandlerFactory] - Unauthorized webhook event (wrong externalId: '1ce0bb76806b21484f80d11c057c02e5')
2021-06-22 19:45:44.018 [WARN ] [rachio.internal.RachioHandlerFactory] - Unauthorized webhook event (wrong externalId: '1ce0bb76806b21484f80d11c057c02e5')

I’ve followed the most recent readme and my callbackURL is

https://****%40****.net:****@home.myopenhab.org/rachio/webhook

Am I missing something obvious?

Edit 1:
It seems I had a slightly older version of the binding. Updating to the Apr 5th version I am now getting the device status reports:

2021-06-22 19:59:47.484 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Sprinkler_TimerBox_Runningschedule' changed from  to Quick Run

but the event channels are not populating and I am still seeing all the same warnings (only with a slightly different format):

2021-06-22 19:59:48.187 [WARN ] [rachio.internal.RachioHandlerFactory] - RachioCloud: Unauthorized webhook event (wrong externalId: 0dfea9651eb0e48d7ac0e3117c11ac5b, source ip: 127.0.0.1)

You said you used a format similar to:

https://****%40****.net:****@home.myopenhab.org/rachio/webhook

If that is true I also had to change the . to a %2E in the .net part of the email address.

Also my password contained special characters as well and I converted those to the proper code as well I converter both at the same time so I’m not sure that is required but it still works after manually changing the special characters in my password too.

Try using this site or something similar to encode the url.

there is no need for, the binding hndles the encoding of the e-mail address

Thanks, but that did not appear to fix my problem. My password has no special characters, and the change of . to %2E had no impact, as @markus7017 expected.

Then that makes me wonder what else I changed that fixed it for me.

I was pretty sure that was the change that made the difference for me. I typically test after each change that is made. And I only put my 2cents in when I feel VERY Confident the answer is correct.

Back to your problem, (I have not looked over the code so I can’t say for sure but using experience and logic I will attempt to deduce a most likely scenario to point you in the right direction. I Hope)

Typically a log entry with the term “Unauthorized” in it is almost always a problem with a permission someplace or name/password error. Most likely your name/password is correct as it looks correct syntacticly to me, and its been verified that the binding now handles the special characters. So that leaves a permission issue as the more likely culprit.

Looking at my settings, I see a few permission type settings. first I would check the setting in OpenHab3 for the openHab Cloud. Make sure the Option for “Notifications & Remote Access” is enabled, Maybe the log entry is referring to not having Remote Access on and thus rejecting all attempts to control your Hab items from remote (Commands Sent from Internet to you House/Hab).

But more likely:
All the Rachio items you want updated need to be included in the list of “Items to Expose”. I included everything, not just the controller but every item, zone names, switches, controller items etc.

Since I see each “Unauthorized webhook event” message appears to have a different target, indicating multiple violations not to the same target have occurred. That would tell me the access is open but the items are not exposed.

If the Items are not exposed and thus fail to be found, I would expect the binding to produce a Log message that looks very similar.

This seems like a good idea if your Notifications and Exposed List are properly setup already:

Remove the Cached Callbacks. Personally I would restart OpenHab after Clearing Callbacks though I have no idea if its actually needed, Over the years not restarting after reseting something has cost me many hours of unneeded time spent trying to fix something that a simple reboot would have done.

I am about to install the 3.x Rachio Addon for my openHAB 3.2.0 Build #2469 Openhabian running on a Pi4. Have not done this process before 
 my understanding is that I place the jar file (org.openhab.binding.rachio-3.1.0-SNAPSHOT.jar) into my addons folder and reboot. Is that correct? I see some general warnings about possible issues with dependancies in the docs for addons 
 Do I need to worry about that for this case?

no I use it with that version just a little different snapshot: 2471

1 Like