Rachio Smart Sprinkler Controller

I see that Rachio released it’s second generation sprinkler controller: http://rachio.com/blog/Introducing-Our-Generation-2-Smart-Sprinkler-Controller and has a public API: https://rachio.readme.io/docs/getting-started. Does anybody have the first generation Rachio?

I can get access. I do,have their gen 2

1 Like

I’m not sure how but I just started setting up open hab and want to provide an integration for the rachio. Which is how I found your post. Any tips out there would be nice

I would be interested as well!

Adding one more vote for this integration.
Have second gen device. Very happy

really would like to see a binding too

Any updates on the matter of Rachio Sprinkler Controller’s binding?

I decided to start build a Rachio binding after playing with the Rachio API a bit. It looks straight forward, will take a while since I could spend only limited time on the project, but I want to see an integration in my OH system.

Is there some doc available how to build a proper discovery service for the binding? My config has 2 devices, so I like to implement support for multiple devices from the beginning (incl. multiple zones).

Building the complete sprinkler control within openHAB won’t work, because you can’t control the different zones separately, but maybe I need to dig in a bit deeper. The api also offers to intercept the notifications, so that would also be interesting to get an rigger when schedule was changed due to seasonal conditions, rain skip etc.

Anything else you like to see? (which doesn’t mean that it will go into a first version).

After some research I decided for the following design:

  • each controller will be a bridge
  • each zone of a controller will become a thing
  • the various attributes and controls become channels
    General API access is already running.

This will ensure that we support multiple controllers with multiple zones. The binding will support

  • auto discovery based on the Rachio cloud service
  • monitoring that the controller keeps online
  • suspend/resume a watering schedule
  • manual start/stop zone watering - this might be combined with the expire binding, so you could make sure that the zone comes up within a certain time
  • not sure if full control could be supplied, which would allow you to build you own watering schedule (prio 3, because in the case you would loose the Smart watering feature)
  • reading several status values related to watering, those values not wrapped to a channel will go to the logfile
  • sum up the water consumption (you could do a reset on a monthly basis etc.)
  • provide the image url for a zone, so you could use those images to visualize zones with HABpanel
  • intercept notifications (start/stop watering etc.) - might be a little bit tricky

@ranielsen, @NCO, @leadsrating, @Agbush, @ashley_stovall: Would that fit your needs? Any ideas?

I just want to say thank you. Happy to help if I can when it comes to testing etc. Unfort the dev side is beyond me!

Re reading some status values - some thoughts on examples of things and outcome s you may want to consider

  • today’s predicted rainfall - ie if you are using the weather plug in does Rachio agree with today’s forecast from your openhab chosen weather provider
  • current saturation level for each zone - you can then use openhab charting / trending to capture this alongside any other metrics you are capturing via openhab ie temperature etc - also have openhab do something if the saturation level sits to low for to long ie 3 days @0%
  • most obvious is zone on/off status
  • zone scheduled for today / tomorrow - visualize from openhab display of your zone will water today /tomorrow (not sure right way of expressing time horizon here… )
  • all on signal - ie if you have openhab monitoring a fire situation the you may want to turn all zone on at once as precaution.

All together just gratefull someone is looking at this!

Thanks

Hi @Agbush,
thanks for the feedback. "All together just gratefull " :wink:

You can have a look to the Rachid API http://rachio.readme.io. This gives a good overview, which information is provided and what controls are possible. At the end it doesn’t make sense to implement tons of channels.

That’s just the information you get on the device on zone level:

   {
     "id": "3c59a593-04b8-42df-91db-758f4fe4a97f",
     "username": "franz",
     "fullName": "Franz Garsombke",
     "email": "franz@rach.io",
     "devices": [
       {
       "id": "2a5e7d3c-c140-4e2e-91a1-a212a518adc5",
       "status": "ONLINE",
       "zones": [
         {
         "id": "e02de192-5a2b-4669-95c6-34deea3d23cb",
         "zoneNumber": 3,
         "name": "Zone 3",
         "enabled": false,
         "customNozzle": {
         "name": "Fixed Spray Head",
         "imageUrl": "https://s3-us-west-2.amazonaws.com/rachio-api-icons/nozzle/fixed_spray.png",
         "category": "FIXED_SPRAY_HEAD",
         "inchesPerHour": 1.4
         },
         "availableWater": 0.17,
         "rootZoneDepth": 10,
         "managementAllowedDepletion": 0.5,
         "efficiency": 0.6,
         "yardAreaSquareFeet": 1000,
         "irrigationAmount": 0,
         "depthOfWater": 0.85,
         "runtime": 3643
         },
         ...
         ],
     "timeZone": "America/Denver",
     "latitude": 39.84634,
     "longitude": -105.3383,
     "zip": "80403",
     "name": "Prototype 7",
     "scheduleRules": [
       {
       "id": "cc9c6e6f-c285-4a7b-9911-ff6065e7ff5b",
       "name": "",
       "externalName": "unknown"
     }
     "serialNumber": "PROTOTYPE7SN",
     "rainDelayExpirationDate": 1420027691501,
     "rainDelayStartDate": 1420026367029,
     "macAddress": "PROTOTYPE7MA",
     "elevation": 2376.8642578125,
     "webhooks": [],
     "paused": false,
     "on": true,
     "flexScheduleRules": [],
     "utcOffset": -25200000
     }
   ],
   "enabled": true
   }

At least it provides a bunch of stuff. I’ll start with some simple things and then extend step-by-step. That’s my first binding and the ESH/OG Binding Dev tutorial is way to short. So you have to look to existing bindings to find out how to plug the logic into the framework - currently I’m snuggling with the discovery service to report discovered things.

I do not intend to implement schedule management. This can be done with the Rachid App and then OH allows to monitor watering and suspend/resume the schedule.

Which device generation do you have? I have 2 gen 3 devices at different locations. I know there is a gen 2 and gen 4, but I don’t know if all of them are supported by the mentioned API.

I have a 16 zone Gen 2 device. Thank you. Will try and look through docs.

Count me in as someone willing to help test. I look forward to seeing what you come up with.

Another thing that would nice to track is if a skip has been applied. It be great to look at my central control pad (OH) and know that a skip is on for the day.

Let me know what I can do to assist.

Squid

I start making progress, binding is able to connect to rachio cloud auto-discovver controller and zon


several exceptions and I need to refactor, but a first step is made.

making progress

The following properties are supplied for a device:

 * {
 * "id": "3c59a593-04b8-42df-91db-758f4fe4a97f",
 * "username": "franz",
 * "fullName": "Franz Garsombke",
 * "email": "franz@rach.io",
 * "devices": [
 * {
 * "id": "2a5e7d3c-c140-4e2e-91a1-a212a518adc5",
 * "status": "ONLINE",
 * "zones": [...]
 * ...
 * ],
 * "timeZone": "America/Denver",
 * "latitude": 39.84634,
 * "longitude": -105.3383,
 * "zip": "80403",
 * "name": "Prototype 7",
 * "scheduleRules": [
 * {
 * "id": "cc9c6e6f-c285-4a7b-9911-ff6065e7ff5b",
 * "name": "",
 * "externalName": "unknown"
 * }
 * "serialNumber": "PROTOTYPE7SN",
 * "rainDelayExpirationDate": 1420027691501,
 * "rainDelayStartDate": 1420026367029,
 * "macAddress": "PROTOTYPE7MA",
 * "elevation": 2376.8642578125,
 * "webhooks": [],
 * "paused": false,
 * "on": true,
 * "flexScheduleRules": [],
 * "utcOffset": -25200000
 * }
 * ],
 * "enabled": true
 * }

The API supplies a ton of properties for each zone:

/**
 * {
 * "id":"dd269f3e-abde-4303-8a29-fa49508818a2",
 * "zoneNumber":7,"name":"Zone 7","enabled":false,
 * "customNozzle":
 *      {"name":"Fixed Spray Head",
 *       "imageUrl":"https://s3-us-west-2.amazonaws.com/rachio-api-icons/nozzle/fixed_spray.png",
 *       "category":"FIXED_SPRAY_HEAD",
 *       "inchesPerHour":1.5},
 *       "customSoil":
 *       {"createDate":1494473341401,
 *        "lastUpdateDate":1494473341401,
 *        "id":"441a1938-68cc-44b2-9669-99975edd773f",
 *        "name":"Loam",
 *        "imageUrl":"https://s3-us-west-2.amazonaws.com/rachio-api-icons/soil/loam.png",
 *        "category":"LOAM",
 *        "infiltrationRate":0.35,
 *        "editable":false,
 *        "percentAvailableWater":0.7
 *       },
 *       "customSlope":
 *       {"name":"Flat",
 *        "imageUrl":"https://s3-us-west-2.amazonaws.com/rachio-api-icons/slope/flat.png",
 *        "variance":"ZERO_THREE","sortOrder":0
 *       },
 *       "customCrop":
 *       {"name":"Cool Season Grass",
 *        "imageUrl":"https://s3-us-west-2.amazonaws.com/rachio-api-icons/crop/cool_season_grass.png",
 *        "coefficient":0.8
 *       },
 *       "customShade":
 *       {"name":"Lots of sun",
 *        "description":"6-8 hours of sun",
 *        "imageUrl":"https://s3-us-west-2.amazonaws.com/rachio-api-icons/shade/lots_of_sun.png",
 *        "exposure":1.0
 *        },
 *        "availableWater":0.17,
 *        "rootZoneDepth":6.0,
 *        "managementAllowedDepletion":0.5,
 *        "efficiency":0.8,
 *        "yardAreaSquareFeet":500,
 *        "imageUrl":"http://media.rach.io/images/zone/default/default_zone.jpg",
 *        "scheduleDataModified":false,
 *        "fixedRuntime":0,
 *        "saturatedDepthOfWater":0.56,
 *        "depthOfWater":0.51,
 *        "maxRuntime":10800,
 *        "runtimeNoMultiplier":1391,
 *        "wateringAdjustmentRuntimes":
 *        {"1":2086,
 *         "2":1739,
 *         "3":1391,
 *         "4":1043,
 *         "5":695
 *        },
 *        "runtime":1391
 *    }
 */

in addition forecast data

{
"current": {
"time": 1417447072,
"precipIntensity": 0,
"precipProbability": 0,
"windSpeed": 0,
"humidity": 0.8,
"cloudCover": 1,
"dewPoint": -9,
"weatherType": "cloudy",
"unitType": "METRIC",
"currentTemperature": -6,
"weatherSummary": "Cloudy",
"dailyWeatherType": "OBSERVATION",
"prettyTime": "2014-12-01T15:17:52Z"
},
" forecast": [
{
  "time": 1417447072,
  "precipIntensity": 0.21,
  "precipProbability": 0.38,
  "temperatureMin": -1,
  "temperatureMax": 5,
  "windSpeed": 18,
  "humidity": 0.52,
  "cloudCover": 0.53,
  "dewPoint": -10,
  "weatherType": "partly-cloudy-day",
  "unitType": "METRIC",
  "weatherSummary": "Windy with Isolated Snow Showers",
  "dailyWeatherType": "FORECAST",
  "prettyTime": "2014-12-01T15:17:52Z"
},
...
]
}

which could result in a ton of channels. I already selected a bunch (see screenshot).

What do you think makes sense to have for
a) Just visualizing the status and progress + some basic control
b) getting enhanced information to implement your own schedules etc.
??

@ashley_stovall, @ranielsen, @NCO, @Agbush, @KidSquid

ok, I’m ready to provide a first beta. Who’s interested in testing?
The current status includes

  • device discovery
  • varios channels providing online information (refresh missing)
  • some basic control functions, however the cloud call is currently disabled (for safety)
  • already supports multiple controllers with 8+ zones, final version will also support multiple cloud instances (identified by apikey)

The intention is this beta is testing operation on various OH2 installations (I’m ussing 2.2 stable and 2.3-SNAPSHOT). So would be good to find some testers here, also with different models.

Installation is pretty simple:

  • create an api key on the rachio homepage (login, click on the user icon->API access token)
  • create a thing for the cloud connection, update apikey
 Bridge rachio:cloud:1 [ apikey="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", pollingInterval=60]
 {
 }

copy the binding into the addons folder. The bundle should be automatically started. Login to the OH2 console and do a bundle:list, it show show the rachio binding at end of list with state active.

You should see the cloud thing, because is a static config form the .things file (the final version will create a bridge thing dynamically if no other exist). Switch to the inbox and execute the scan. This should create 1 thing per controller and one for each zone, in my setup 19 things (the static for the bridge, 2 controller, 2x8 zones). You could enable Simple mode for item linking to auto-create all items, but that will be a lot :wink:

I could provide the jar here with a hack (name it .pdf and you rename it to .jar) or somewhere else.

Be aware: It’s the first beta, so could cause problems even I didn’t had one putting from the development system to my Pi.

I’m game…

I’m currently on 2.3 snapshot and have an 8 Zone Rachio Controller.

Let me know what I can do.

Sid

ok, lets go

here is the bundle, rename it to .jar, prepare as described above (create the .things file and insert your apikey) and copy the jar to your addons folder.
org.openhab.binding.rachio-2.3.0-SNAPSHOT.jar.pdf (251.1 KB)

mybe make a backup of your jsondb folder - it will create a lot of stuff…

Will try it out this evening when I get home…is there a list of channels available somewhere so I know how to code my sitemap?

Squid