Rachio Plugin (Locked)

Posted on
Thu May 25, 2017 7:41 am
Professor Falken offline
User avatar
Posts: 289
Joined: Mar 29, 2015

Re: Rachio Plugin

Actually, one more thought (hope I'm not becoming too annoying with these ideas)...

On the newer versions of the the Rachio app, there is a "rain delay" feature. Basically, you can click it (and set a number of days) and it'll skip any waterings scheduled within that time frame. If Indigo could manipulate that function, it would be great.

Why, when Rachio has built in "weather intelligence"?

Because the Rachio system for automatically skipping waterings foolishly combines measured rainfall and predicted rain (which it is getting off of computer generated forecast percentages). I quit using the weather inteligence when it was skipping multiple waterings in a row based on rain that never actually fell.

If Indigo could trigger the rain delay feature, then I could have those tied to actual measured rainfall from a nearby WU station (or weathersnoop if I ever get my own station). Then I'd only be skipping based on actual rainfall.

In fact, in the absence of a delay feature, I may play around this by having Indigo put the system into and out of standby mode, which could accomplish the same thing.

Posted on
Thu May 25, 2017 9:41 am
jay (support) offline
Site Admin
User avatar
Posts: 18200
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Rachio Plugin

I'd recommend adding these (individually) as enhancement issues in the Github repo. The plugin is open source so anyone can make changes and issue pull requests (which I'll happily accept). Putting them there will allow any potential contributors to find enhancements (and bugs) in a single place rather than trying to dig through forum posts. Be sure to add the "Enhancement" label to the issue on the right side of the issue editor to show that they're enhancements.

I have no time to work on this plugin myself since it's doing all I need it to do at the moment, but perhaps someone else can.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu May 25, 2017 12:34 pm
Professor Falken offline
User avatar
Posts: 289
Joined: Mar 29, 2015

Re: Rachio Plugin

I'd recommend adding these (individually) as enhancement issues in the Github repo.


OK I will , thanks. I'm not that familiar with the Github system, other than downloading all of these awesome plugins. I'll have to check that part out.

Actually, as I thought about it more, I think I can accomplish all of that by reworking the way I use the Rachio in Indigo. I may just put the Rachio box into standby mode and rebuild my schedules in Indigo. Indigo is far, far smarter than the Rachio. So if I turn the Rachio box into a dumb controller, and use Indigo entirely as the brain, I could have it do things like what I described (alterations based on actual fallen rain, etc).

This would also open it up to much better scheduling than the Rachio alone allows ...

Posted on
Sat May 27, 2017 8:22 pm
mvignola29 offline
Posts: 56
Joined: Sep 26, 2015

Re: Rachio Plugin

Does the plugin work with Rachio Smart Sprinkler 2nd generation for 8 Zones? If so, does it also disable the Sprinkler system when it is raining?

Any info is appreciated

Michael

Posted on
Sun May 28, 2017 6:00 am
Professor Falken offline
User avatar
Posts: 289
Joined: Mar 29, 2015

Re: Rachio Plugin

Does the plugin work with Rachio Smart Sprinkler 2nd generation for 8 Zones? If so, does it also disable the Sprinkler system when it is raining?


I have a first generation box and it works great. However, I think Jay's original post said he wrote it right after he got one (a month or two ago), so I would imagine that was the second generation device.

The plugin allows Indigo to control it just like any other sprinkler device in Indigo. It can do this with the device in STANDBY mode, or with the device active. There is no "rain skip" built in to either the plugin or the standard sprinkler device in Indigo.

But what I have been doing is building a couple of scripts that keep track of a running 2-day total for rainfall. I pull data from a nearby WU station using the daily rainfall device state. I then test that 2-day measured rainfall against a threshold before a scheduled sprinkler run, and skip it if above threshold (that's just a simple conditional on the action).

To do this, I just disabled the schedule in the Rachio app, and recreated it within Indigo as a sprinkler action. Turns out I didn't even have to do the second part. The plugin has an action that lets you run one of the Rachio schedules.

The only reason to go to this trouble, though, is if you want Indigo altering schedules, skipping, etc. If you like the way the Rachio app handles rainfall (I don't), you can continue to run your Rachio schedules from right within the box/app logic, and still pass the info to Indigo for monitoring, CP viewing, etc. My problem was with the Rachio "weather intelligence", which includes predicted rain in its calculations. I was getting too many inconsistent skips based on rain that never fell when I used that feature.

Posted on
Sun May 28, 2017 7:06 pm
mvignola29 offline
Posts: 56
Joined: Sep 26, 2015

Re: Rachio Plugin

I did purchase 2nd generation Rachio and I should get it within a couple of days. I plan to use it with Indigo as a regular Indigo sprinkler. I also have a RainWise Weather station that monitor the actual rainfall so I hope to somehow use a plugin that will somehow use the actual rain data from my yard to control the sprinkler on days that it rain. My system is also on Weather Underground station ID KCYSEYM07. Hopefully all goes well in getting this system to work


Michael

Posted on
Sun May 28, 2017 10:46 pm
Professor Falken offline
User avatar
Posts: 289
Joined: Mar 29, 2015

Re: Rachio Plugin

I also have a RainWise Weather station that monitor the actual rainfall so I hope to somehow use a plugin that will somehow use the actual rain data from my yard to control the sprinkler on days that it rain. My system is also on Weather Underground station ID KCYSEYM07.


I am happy to share my script that seems to be doing this fairly well. It's really my first Python script, and I've only been running it for about 36 hours, so let me test it for a few more days. I've certainly uncovered a few bugs since I first wrote it.

But once you have your Rachio up and running, let me know and I'll post it here.

Posted on
Mon May 29, 2017 3:14 pm
mvignola29 offline
Posts: 56
Joined: Sep 26, 2015

Re: Rachio Plugin

Thanks I appreciate any help your script can provide in controlling the sprinkler schedule when it is raining. I let you know how the system setup goes once I get it.


Mike

Posted on
Tue May 30, 2017 7:38 pm
mvignola29 offline
Posts: 56
Joined: Sep 26, 2015

Re: Rachio Plugin

I was able to get the Rachio system setup. I did create a couple of rain schedules and was trying to use Indigo to control them. I did configure the plugin added the API Token.

I am not able to set a schedule where you configure each zone watering durations. It is my hope that a Rachio device would have setting for each zone as was the Insteon Sprinkler, One of the Zone is watered every day while others are watered a couple of days a week.
The Rachio Device configuration edit action setting only see one of the schedule that I setup in the Rachio water schedule. It would be good to create unique schedule that would run different zones for different days and duration.

I am not sure that I may overlook something that would resolve this issue,
Any info is appreciated.


Thanks for your time

Michael

Posted on
Tue May 30, 2017 8:34 pm
mvignola29 offline
Posts: 56
Joined: Sep 26, 2015

Re: Rachio Plugin

After playing around with some of the setting I realize the reason I was not able to see the various rain schedule is that if you setup a rain schedule as a Flexible Daily schedule Indigo does not see that setting. Once I change the rain schedules to a Fix day Schedule I was able to select the various watering schedule using Indigo 7. I think all is now setup, I just wonder if I need to shut off the scheduled by Rachio and just let Indigo control everything. I wonder If I can leave it as is and some how either schedule will work so that if it rains the Rachio schedule will not run and indigo would also be off in that it would run the schedule that Rachio has stop due to the rain


Time will tell

Mike

Posted on
Tue May 30, 2017 9:52 pm
Professor Falken offline
User avatar
Posts: 289
Joined: Mar 29, 2015

Re: Rachio Plugin

I just wonder if I need to shut off the scheduled by Rachio and just let Indigo control everything.


If you are happy with the Indigo scheduling systems, then that is what I would do. It will give you a lot more flexibility than the native Rachio app.

Set up some schedules in the Rachio app (zones, durations, etc), name them, but it doesn't matter what days you set them to. Then disable them in the app, so the Rachio box itself won't trigger them.

Now use Indigo, and the device action "run Rachio schedule" to run whichever schedule you want to use.


As I mentioned, here is the script I have been using to check against actual measured rainfall. I made a few tweaks to it tonight, so hopefully I haven't broken anything before posting it here. It tested fine after the changes.

The script compares rainfall from the last two days against a threshold variable in Indigo, and sets a skip variable to true or false. You can then make that skip variable a conditional on your Indigo sprinkler schedule.

Because I run my sprinklers in the early morning hours, if my "2 day" rain total only used yesterday and today, when calculated right before the irrigation run, it would really only be yesterday and a few early morning hours of today. For that reason, when the script is run between midnight and 5:01, it includes the day-before-yesterday in the two day total that is checked.

Code: Select all
import datetime

rntody=indigo.devices[100065036].states["precip_today"] # sets rntody to State "precip_today" of "Wunderground Weather"
indigo.variable.updateValue(98247578, value=str(rntody)) #updates indigo variable todayRain
rnyest=indigo.variables[60524158].value # pulls the yestRain variable from indigo
rndbyest=indigo.variables[95874222].value # pulls the dbyestRain variable from indigo

####################
## if run b/w midnight and 5:01 AM, use day before yesterday in 2 day totals (along with today and yesterday)
## otherwise, only use today and yesterday in totals
####################

now = datetime.datetime.now()
time_1 = now.replace(hour=0, minute=0, second=0, microsecond=0)
time_2 = now.replace(hour=5, minute=1, second=0, microsecond=0)

if time_1 <= now <= time_2:
    twdyrn=rntody+float(rnyest)+float(rndbyest)  #adds day before yesterday, yesterdays and todays (early AM) rain
else:
    twdyrn=rntody+float(rnyest)  #adds yesterdays and todays rain

indigo.variable.updateValue(153828207, value=str(twdyrn)) # updates twoDayRain indigo variable

###############
### check two day rain against skip threshold
### update auto skip variable
###############

skpThresh=indigo.variables[24355217].value # "SprinkSkipThreshold"
if twdyrn>float(skpThresh):
    indigo.variable.updateValue(65447061, value="true") # updates indigo skipSprinkleAuto variable to true
else:
    indigo.variable.updateValue(65427061, value="false") # otherwise updates indigo skipSprinkleAuto variable to false

#############
## Updates an icon variable tied to a control page image
#############

iconpercent=twdyrn/float(skpThresh)

if 0.0<iconpercent<=0.34:
    indigo.variable.updateValue(121644854, value="quarter") # updates indigo rainGaugeIcon variable to quarter


if 0.35<=iconpercent<=0.69:
    indigo.variable.updateValue(12654854, value="half") # updates indigo rainGaugeIcon variable to half


if 0.70<=iconpercent<=0.99:
    indigo.variable.updateValue(12164854, value="threequarter") # updates indigo rainGaugeIcon variable to threequarter


if 1.00<=iconpercent<=1.25:
    indigo.variable.updateValue(16544854, value="over") # updates indigo rainGaugeIcon variable to over


if iconpercent>=1.26:
    indigo.variable.updateValue(12144854, value="wayover") # updates indigo rainGaugeIcon variable to wayover

if twdyrn==0.0:
    indigo.variable.updateValue(12144854, value="empty") # updates indigo rainGaugeIcon variable to empty

##################
### Updates a variable that shows rain chance if no rain recorded for today yet
##################

if rntody==0.0:
    percentchance=int(indigo.devices[10035036].states["forePop1"]) # State "forePop1" of "Wunderground Weather"
    indigo.variable.updateValue(17987895, value="("+str(percentchance)+"% chance)") # updates indigo percentChanceif0 to chance of rain today
else:
    indigo.variable.updateValue(17995895, value=rntody+" in") # updates indigo percentChanceif0 to actual rain if measured rain today



There's likely more in there than you want, but I think it's documented well enough to strip out the unwanted parts. Most of the bottom part is to update some variables which are used in control page displays of the irrigation system.

To use it, you'll need to set up some variables in indigo for todayRain,YesterdayRain, and dayBeforeYesterdayRain, a skip threshold, and a boolean skip variable. You will need a WU device that reports daily rain. Of course if you use those control page display parts, you'll need those variables too (a rain gauge one, and a percentRainChance one).


In addition to running this script (either on a schedule or triggered on a change in daily rain), you need an action run just before midnight every day that replaces dayBeforeYesterday with Yesterday, and Yesterday with Today (use "set variable to variable" action).

I also have a button that allows the manual skipping of a scheduled watering, or can cancel a skip that otherwise would happen, but there is some fairly complex logic (about 8 conditional triggers) that govern that button, so unless you had a desire to implement that, I'll refrain from typing all of those out right now!

Here is the CP with it running, including the rain gauge icon...
Attachments
IMG_2798.PNG
IMG_2798.PNG (287.03 KiB) Viewed 6716 times

Posted on
Mon Jun 05, 2017 10:02 am
anyone offline
User avatar
Posts: 125
Joined: Apr 03, 2011
Location: Norfolk, VA

Re: Rachio Plugin

I received my 2nd Gen 8-Zone Rachio yesterday and was able get this plugin to control it. Thanks Jay!

Reviewing this thread...I decided to allow Indigo to totally control the Rachio, by putting the Rachio in Standby. I also decided to use the Rachio App to create a schedule, since it seems to figure out the duration to water each zone based on the criteria you entered. (i.e. Soil type, sun exposure, etc).

There seemed to be enough data from this plugin, to simulate a Rain skip.

So I added the following condition to my 5:00a every other day, Indigo schedule:

"All" "of the following rules are true"
"If variable" houseSeason "is equal to" "value" "summer"
"If device" "Rachio Sprinkler Controller" "Rain (true or false)" "is false"
"If device" "Rachio Sprinkler Controller" "Today (T0) Forecast - Calculated Precipitation" "is less than" "0.125"
"If device" "Rachio Sprinkler Controller" "T1 Forecast - Calculated Precipitation" "is less than" "0.125"
"If device" "Rachio Sprinkler Controller" "Current Calculated Precipitation" "is less than" "0.125"

FYI:
1/8 inch = 0.125
T0 = today
T1 = tomorrow
The HouseSeason variable was setup based on the Common Home Automation Tasks: Setting up a basic watering schedule http://wiki.indigodomo.com/doku.php?id=generic_sprinkler


In order for this condition to function as a Rain Skip of course is assuming the data Rachio is pulling can be relied upon. I plan to monitor this closely.

The only flaw/feature...in the above logic is I'd rather not have my lawn watered while it's raining regardless of the amount of rain expected.

Posted on
Mon Jun 05, 2017 1:08 pm
Korey offline
User avatar
Posts: 811
Joined: Jun 04, 2008
Location: Henderson, NV

Re: Rachio Plugin

Does the plugin talk directly to the Rachio controller or does it have to go out to the mothership and back?

I'm running out of zones on my Irrigation Caddy and might rather buy a 16 Zone Rachio instead of the Caddy's 8 zone expander module.

Thanks.

--
Korey

Posted on
Mon Jun 05, 2017 1:12 pm
Professor Falken offline
User avatar
Posts: 289
Joined: Mar 29, 2015

Re: Rachio Plugin

The only flaw/feature...in the above logic is I'd rather not have my lawn watered while it's raining regardless of the amount of rain expected.



So just put one more condition "if current condition is not equal to rain". (may have to do a few... thunderstorms, etc).

Posted on
Mon Jun 05, 2017 1:17 pm
Professor Falken offline
User avatar
Posts: 289
Joined: Mar 29, 2015

Re: Rachio Plugin

Does the plugin talk directly to the Rachio controller or does it have to go out to the mothership and back?


I think it's just talking to the box. It's pretty immediate. Strangely, the sprinklers will kick on/off immediately when triggered from a CP (or on regular schedule), but the device state takes a while to change (maybe 30+ seconds). This seems to be more of an issue when they come on than when they go off. The way I did a work around was to make any CP trigger on a sprinkler action to also have a "request status update" on the Rachio device about 2 seconds after the action. This way my control page matches fairly real time. You have to put that delay, otherwise the status won't have changed before the status update gets the data.

Who is online

Users browsing this forum: No registered users and 0 guests