Download a schedule?

Hi,

I’ve basically taken to use Excel to recalculate and verify rachio math. I have measured each zone square footage using a laser meter and I have installed a device that piggybacks on my utility meter and measures the water consumption on an minute granularity into a database.

I’ve verified that my water consumption sensor is correct by timing an water outlet to be exactly 2 gallons/minute of flow and the sensor from my utility and the reader I’ve attached to it agrees with that reading. I’m using the flume meter btw, a wonderful piece of technology.

Using this data I’ve run each zone on a drip line and taken the gallon consumed for that zone together with the square footage to calculate exactly the precipitation rate per hour (what rachio calls nozzle inches per hour).

I’ve done the same for my mp rotators in my lawn and this appears to have worked pretty well. I adjusted the root depths, the shade parameter and the vegetable type. The schedule rachio spits out seems agreeable to me.

However, I would love to double check the rachio math. Even though I use flexible daily and I know things can change with heat and rain, I would like to get the upcoming two week schedule of watering times per zone and day. Ideally as a spreadsheet but I’ll take a csv if I can. I have two rachios and about 28 zones.

Currently I have to go into the GUI and click on the calendar which is tedious and error prone to correlate rachio data with any external data source.

Any tips? Even a hackerish way via an API call is okay.

1 Like

I’m in awe of your thoroughness and complexity. Gotta love a guy with a flume meter AND a laser distance meter!

If you look at your (or Rachio’s) calculated values, you should find the inches of water that will be applied to each zone at one time. And, ignoring any forecast or actual rain values, you can add up the 7 values for Crop Evapotranspiration, which should give you the inches of water that will be applied, on average, during a week. Divide inches at one time by average CE per day, and that will tell you every how many days, on average, it will water. Like if 0.6" of rain is applied at once, and average daily CE is 0.15, then it will water about every 0.6 / 0.15 = 4 days. You can make a spreadsheet if you like, but that’s what it will be, separately for each zone, except for delays in watering due to actual rain received.

Or if you’d like to post your spreadsheet, I or many other I’m sure would be happy to look for any problems. I have my own similar spreadsheet, but it’s oriented to my yard and requirements, not yours.

That is a good idea.
I assume you mean the values under zone-advanced? How do I add those values together to get the inches of water that rachio will seek to provide each week? I’m not certain of the formula.

The work was not very hard. I used a pretty poor laser distance meter from Amazon, but if I would do this again I’d buy a better laser meter.
I am planning to do a proper write-up of my approach to make it easier for others that have no interest in doing the research but want a step by step guide.

My spreadsheet is a Google sheet so easy to share. But I want to to get the rachio data in so I can correlate and predict better.

Okay. I thought, from your post, that you’d already done all the calculations and just wanted to confirm the results. What is in your spreadsheet, then?

I got a very good laser distance meter, but it is useless outside in the sun, or even on a cloudy day, for distances over 30-50’.

As to the math, you might want to take a look at my thread here: A Beginners Guide on Understanding and Using ALL THOSE ***** NUMBERS!

To include /all/ variables, you’ll also need to add slope/sun factors, efficiency factor, etc. but it’s a good start.

All I’ve calculated so far is how much water my actual watering system outputs exactly in both gallons and inch/hr per zone.

I’ve used that to input the square footage per zone and the correct nozzle inches per zone as well as e correct nozzle/drip type and their efficiencies into the rachio app. I’ve also adjusted the crop type, sun amount and I’ve used a soil probe to check for root depths, particularly on the grass. I also looked up the crop coefficients and verified that with what rachio provided as defaults.

I’ve obtained from my local USDA/UC extension watering tables by month and crop type for my area (they give those in inches of water per month).

Now I wanted to look at the next two weeks watering schedule from the rachio app to determine if rachio roughly converge with what my tables propose or if something is off.

If I can’t get the an easy way to get to the schedules (and I prefer next two weeks schedules rather than the past because I want to see exactly how much impact changing a setting has in that zone, and that type of validation can’t be done using historical data, it required forward data or access to the exact formula rachio is using. Since i know average temp, UV index and humidities using historical data I can always add those to the formula if this is what rachio is using for weather sense.

But honestly, rather than calculating all of that id rather get access to a water schedule from rachio and use that to see how much it differs from my USDA/UC water table for my month and my crop. My land is absolutely flat.

In the end, All I want to do right now is to sanity check the rachio via simulation rather than “water and see if it gets stressed”.

And yes, most laser based areal measuring devices suck in the sun. Next time I’ll get a much better one…

It will be tough to compare a schedule of weeks ahead, because Flex Daily goes day-by-day to determine whether to water the next day or not. But for the sake of your spreadsheet (which I had to make too, manually entering each day and how much water the schedule said would be applied each day - until I realized the basic premise of operation), here are some formulas for you:

Inches of Water Applied Each Cycle = Root Depth x Available Water x Allowed Depletion

If Root Depth = 6", Available Water = 0.17" (Determined by soil type) and Allowed Depletion = 50%

Inches of Water Applied Each Cycle = 6 x 0.17 x 0.50 = 0.51"

Watering time to apply that water is:

Watering Time, min = 60 x Inches of Water / Nozzle Inches per Hour x Scheduling Factor

Scheduling Factor is based on Efficiency and is:

Scheduling Factor = 1 / (0.4 + 0.6 x Efficiency). For 80% Efficiency, it would be:

Scheduling Factor = 1 / (0.4 + 0.6 x 0.80) = 1 / (0.4 + 0.48) = 1 / 0.88 = 1.1364

Assuming Nozzle Inches per Hour = 0.7 in/hr, continuing with the example:

Watering time for 0.51" = 60 x 0.51 / 0.7 x 1.1364 = 132 minutes or 2:12

The only other calculation that Rachio does it for the Crop Evapotranspiration value for each day, which is a calculation of the amount of water your lawn needs each day. It varies, each day, with the Temperature, Humidity, Wind Speed, Solar Radiation, Hours of Sunlight, and Crop Coefficient (probably more). The only ones you have control over in Rachio are the Hours of Sunlight, and Crop Coefficient.

Right now, where I live in South Carolina, the calculated CEs for each day this week are:

0.12 0.14 0.11 0.13 0.1 0.11 0.1

These total 0.83" for the week, meaning on average, Rachio will apply 0.83" of water this week (less whatever rain we get). This is a cooler, wetter, more humid week than normal; we can have daily CDs close to 0.30, which would apply twice the water. Compared to historic data, this would be a good bit lower than normal, but then so is the current requirement, so that saves water.

The 0.83" for the week (or about 0.12" per day) could also be extrapolated to 0.83" x 30 / 7 = 3.56" for the month, to compare with your information. But again, it’s low right now, so that must be taken into account.

Anyhow, for your Schedule: with Flex Daily, Rachio (or you) can initially “fill” your yard by watering extra to be sure the moisture level in the lawn is at its maximum. Then it will wait, each day, subtracting the value for the CE, and adding any rain received, until the total nears zero (which is your Allowed Depletion). If the next day will be at zero or less, it will water that next day, in this case the 0.51". This is shown VERY well in the Soil Moisture Graph & Chart, and is in itself a reason to use Flex Daily, as this graph only is shown or applies to it.

Another way of looking at the numbers is that it will water 0.51" every 0.51 / 0.12 days or every 4.25 days. So days of schedule (W = watering day, x = no water) might look like: WxxxWxxxWxxxxWxxxWxxx etc. This could be extended over any time, but it’s going to be changed by 1) the rain received, and 2) the change in the daily CE value.

If the total water per week or month is lower than you really think is required, increasing the Crop Coefficient is the best way to adjust this. Total water applied over time is directly proportional to the Crop Coefficient. Or, if you have used a different controller on your zones, compare the TOTAL time that Rachio will water over, say, a week or a month with what your previous system would use.

Hope this helps you to complete your spreadsheet and confirm what Rachio should do during that period of time.

This is excellent and exactly what I was looking for. I read your intro which was good, but being a mathematics major I like numbers and formulas. I can run some simulations with different evapo-transfer values to see exactly how the rachio plays out.

Last night I was playing with the inputs, particularly available depletion and efficiencies to see how that affects the schedule.

One of the things that struck me is that the crop with deep roots aren’t as affected by daily changes as shallow root crops. You can see this in the schedule for a tree, it is very similar between flex monthly and flex daily. But grasses are vastly different. To me this seems to suggest that the flex monthly looks like it will work really well for deep root crops since they aren’t quite as affected by daily changes in weather and more affected by systematic water shortages.

I’m going to go out later in the evening and re-measure a few zones. Got reflective material for the laser to bounce off for more precise readings.

The smoke from the fires are unbearable here in northern California. Terrible times.

Did you read my other posts in that thread? There’s a lot of numbers in there.

I did read all the posts in that thread. its a a great thread. thanks for doing the community this service, its really helpful

Great formulas. i got them into a spreadsheet and played around with the rachio to sanity test my spredsheet.

One of things i found interesting is that when i go to the rachio app to check the values for crop evortranspiration, they appear to follow linearly the crop co-efficient factor. If i set the crop coefficient factor to 95, and go to the soil moisture tab to see the crop evotranspiration i get the following for one of my zones: 0.13 0.18 0.16 0.15 0.19 0.21 0.21
The number seems reasonable (1.23 at 95% crop coefficency).

When i set my crop co-efficiency to 45 and check the crop evotranspiration i get the following 0.13 0.18 0.16 0.08 0.1 0.11 0.11

Its not exactly half, but it seems to be exactly proportional vs the input. I assume that the historical days doesn’t change, and the calculation is only forward looking

    |0.13|0.18|0.16|0.15|0.19|0.21|0.21| 95%
    |--- |--- |--- |--- |*** |--- |--- | 
    |0.13|0.18|0.16|0.08|0.10|0.11|0.11| 45%

I put asterisks on todays date to make that point.
This is just a guess on my part, i don’t know how to make rachio calculate farther out to see the long term effect.

Anyway, i am getting a decent handle on the rachio and what it actually does.

As I said above:

So, yes, Crop Evapotranspiration is directly proportional to the Crop Coefficient: if you increase the Crop Coefficient 20%, Rachio will calculate that each day needs 20% more water.

When using Flex Daily, Rachio will only calculate out about 3 weeks into the schedule. It is using the FORECAST weather for that time, not historic data (although I’m sure forecasts that far in advance consider historic data as well). In any event, it’s the best guess it has at this time of the weather for the future, even including estimated rainfall. As the dates get closer, the forecast gets more accurate, and eventually Rachio uses the actual rainfall for the previous day, estimated rainfalls for following days, and the most accurate temperatures. Pretty neat system, actually. :wink:

1 Like

When i click on a schedule and see “water duration”
That correlates strongly (ie the numbers are identical) with the current model that i have in my spreadsheet of how much water the rachio will provide each watering session per zone.

I assume this is what it is?
Since minutes of watering per zone can be changed in this dialogue , is this an override that lets the user obsolete the calculations?

Also, many crops have different coefficient factors depending on dormancy, growth phase, flowering, fruiting etc. Does rachio adjust any of that or is the coefficient fixed for the year and i just need to pick an average?

Grass isn’t as much impacted by this as flowers and fruit trees according the the articles i read from uc davis. It would be pretty dang neat if the coefficiencts also adjusts with the season, but to do that we need a way to track each specific crop -not just crop type.

My spreadsheet is glorious by the way. it perfectly calculates what rachio would do.
It sucks a bit to hand copy over the crop evapo-transpiration to make the numbers make sense, but besides that i got the model well understood. Lots of manual labor to cross reference my spreadsheet model with what rachio actually is planning to do in order to validate the model with the rachio. Maybe i can build a screen scraper to fetch it to my spreadsheet.

what i have done with this is setup triggers. i read my watering companies flow sensor continously and i have taken my mathematical model and use that to drive alerts at specific tresholds from readings of the water meter so that if i start consuming water outside the model + household use, i get a real alert.
But more importantly, i have a good way to start systematically reduce my water bill by targeting crops to be replanted for more efficient crops.

par

The only two variables at the output are valve duration and period, modified by the weather. Why do you need so many input values (crop efficiency, root depth, allowed depletion, nozzle inches) to calculate such a simple two-parameter output? They must be contradictory.

How do you calculate the time the valve is turned on for?
That is a function of A) root depth, b) depletion setting, c) soil type, D) efficiencies in your watering system, E) how much output your nozzle provides and F) what type of crop you have eg the coefficients and finally Yes the weather.

Of these weather should be the only externally variable factor. But i wanted to learn the math and science behind the rachio. Not the complicated although the language used is very specific to those skilled in the art.

In case it interests anyone. i wrote a little script for google app script engine that lets you populate a spreadsheet with all rachios in your account , each zone and their settings. I just typed it up after dinner tonight so its a bit rough. But basically put your API key in cell A:2 (i used A1 to put a label that this was my API key) and go to google script engine and put this into file and run the function GetRachioZoneSettings() and it will populate that same sheet as your API key is in with each zone and their settings.

I find it easier to do this for a quick overview of all my zone settings than to head in to the GUI to validate.
I’ll build it out and make it look prettier (and pull in all zone settings) over the next couple of days, but i hope some of you will find use in this. To get the API key login to the web and click on your account “get api key”. Just paste that text in Cell A2 on the active sheet and you’ll be golden.

I haven’t decided if i want to swap rows/columns yet but just getting real time data into google sheet is great. Trying to decode the json to see what all the data represents. Much is obvious but some things are not.

ps. the forum may reformat the text below and make it impossible to paste. if so just pm me and i can mail it to you. This does not do any modifications to any settings, it is only doing a GET operation on your device(s). I spelled out things a bit more than needed to make this more accessible for people not familiar with more complex data structures and functions.

code:

function fetchAPIKey(){
  var f = SpreadsheetApp.getActiveSheet().getRange(1, 2).getValue();
  Logger.log(f);
  return(f);
}

function GetPersonID(Key) {
  var url = "https://api.rach.io/1/public/person/info";
  var headers = {
    "contentType": "application/json",
    "headers":{"Authorization": "Bearer " + Key}
  };
  var response = UrlFetchApp.fetch(url, headers);
  var PersonID = JSON.parse(response.getContentText());
  return (PersonID.id)
}

function length(obj) {
    return Object.keys(obj).length;
}



function GetRachioZoneSettings(){
  var APIKey = fetchAPIKey();
  var PersonID = GetPersonID(APIKey);
  var url = "https://api.rach.io/1/public/person/" + PersonID;
  var headers = {
    "contentType": "application/json",
    "headers":{"Authorization": "Bearer " + APIKey}
  };
  

  var response = UrlFetchApp.fetch(url, headers);
  var DeviceID = JSON.parse(response.getContentText());
  
  // Setup the sheet
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheets = ss.getSheets();
  var sheet = ss.getActiveSheet();

  var dataSet = DeviceID;
  var rows = [],
      data;
  
  var DeviceCount;
  DeviceCount = length(dataSet.devices);
  Logger.log("devices = %s", DeviceCount);
  
  var Zones;
  var rows = [];
  var sheet = SpreadsheetApp.getActiveSheet();
  var arr = [];
  var c = [];
 
 var RowNum = 0;
 
 var c = [] ;
 // Do the headers first so we know the data
 c[RowNum] = new Array(9);
 c[RowNum] = ["Controller Name", "Zone Number", "Zone Name", "Inches per Hour", "Crop", "Crop Coefficient", "Root Depth", "Depletion", "Efficiency" ];
// c[RowNum] = ["Controller Name", "Zone Number", "Zone Name", "Inches per Hour", "Crop"];
RowNum++;
 
 //Iterate on each rachio device
 for ( i = 0; i < DeviceCount; i++){
    Zones = length(dataSet.devices[i].zones);
    //iterate on the zones in each rachio device for this account
    for ( k = 0; k < Zones; k++){    
       // only output to the spreadsheet zones that are enabled
       if(dataSet.devices[i].zones[k].enabled == true){
         c[RowNum] = new Array(4);
         var n = 0;
         c[RowNum][n++] = dataSet.devices[i].name, 
         c[RowNum][n++] = dataSet.devices[i].zones[k].zoneNumber
         c[RowNum][n++] = dataSet.devices[i].zones[k].name;         
         c[RowNum][n++] = dataSet.devices[i].zones[k].customNozzle.inchesPerHour;
         c[RowNum][n++] = dataSet.devices[i].zones[k].customCrop.name;
         c[RowNum][n++] = dataSet.devices[i].zones[k].customCrop.coefficient;
         c[RowNum][n++] = dataSet.devices[i].zones[k].rootZoneDepth;
         c[RowNum][n++] = dataSet.devices[i].zones[k].managementAllowedDepletion;
         c[RowNum][n++] = dataSet.devices[i].zones[k].efficiency;
         RowNum++;
       }
    }
  }
  
  destinationRange = sheet.getRange(2, 1, RowNum, n);
  destinationRange.setValues(c);   
}

@rraisley I have a question that maybe you can help me with.
Here is a google spreadsheet i’ve created.

I’ve just taken a few of the zones in my yard, but they are representative.
The data from this spreadsheet is something i directly feed into it from the Rachio API via google Apps script engine. I’ve double checked the values that are relevant vs. the GUI on my phone and the gui agrees with the output from Rachios API’s.

What i am trying to figure out is why i am getting a minor difference (under 2%) in runtime (eg. minutes a valve is running based on zone configuration that i am calculating in this spreadsheet) vs what rachio is reporting as its calculated value)?

I tried to theorize that it was a rounding error, but i just can’t see it. The cells in the sheet contains raw rachio api data and you can expand it to 9 decimals if you want.

Do i have a math error in my calculation somewhere? I double checked the Scale Factor math but i don’t see it there. The others doesn’t seem that wrong either.

Would you mind taking a peak and tell me what i got wrong?

Its not that i’m worried about the error given how small it is, but i also don’t like the idea of my math not being right. A bigger error could really mess up things downstream.

i’m working on building a webhook for this, but i want to make sure i am getting the basics right.

thanks!

1 Like

Very nice! I was thinking of doing the same thing, compiling it from various posts, etc. Now, I do not have to. I did not take a close look as I believe others would be better suited.

Thomas, give me a day or two and I’ll get you a script that you run in a Google spreadsheet that pull home all your zone configuration data. I just want to make sure my math is 100% before I post it.

1 Like

Perfect, I already downloaded what you have as an XLS and can do things with the API, but you will save me more time. I would like to be able to play around with numbers to see how it changes, etc. Thank you!

Okay, I played a bit. Where do the following come from in the UI?

  1. Saturated depth of water
  2. Depth of water
  3. Run Time from rachio API (json field zone.runtime)

It appears the following do not come down or used in the calculation?

  1. Soil type
  2. Slope

I will have to get the values through the API to check it out. The last time I ran it for that low of time (the first part of last year), it stressed my grass out for not getting enough water. Maybe I do not have some thing set correctly in the spreadsheet or my app.