Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Generic Irrigation Scheduler
#1
I recently replaced my simple hardware irrigation controller with a Rain8Net Pro controller. There didn't seem to be a good CQC irrigation solution and the best other one I saw, mcsSprinklers didn't really integrate well if at all with CQC. So, I started working on a irrigation controller driver that I could build in all of the features that I wanted.

The first cut was a replacement for the hardware controller with some added ability. The second version added support for pump/valves, and 'cycle and soak'. 'Cycle and Soak' is a feature that calculates the maximum amount of water that can be applied to a zone before runoff begins. Once the amount of water that would cause runoff has been reached, the zone will turn off and allow the water to soak in before the zone is continued. The runoff time and soak time are based on the soil type, slope, and flow rate of the zone. The third version, .31, added restrictions to be set based on past and future rainfall and sun relative start times.

The driver will calculate evapotranspiration and allow programs to schedule zone runtimes based on water balance.

The driver currently talks other drivers to handle the actual control of the sprinklers. The driver works directly with the Rain8Net driver, but other drivers are supported. There are two ways to be compatible with the irrigation scheduler. For drivers that have nameable fields, the Irrigation Scheduler will automatically discover any zones that are named in the format: x_Zone_y where x is the unit number and y is the valve number. The other way the Irrigation Scheduler can use another driver is if their valves are controlled by read/write boolean fields. The list of fields for other drivers is specified in an optional config file. The driver looks for a file called IrrigationSchedulerFields-<Moniker>.txt in the MacroFileRoot directory and expects one field name per line.

The driver can handle up to 254 zones. There is the concept of a 'Program' that is a sequence of Zones to be run at assigned durations. Each one of up to 254 Programs can have up to 500 zones in its sequence and zones may repeat. This allows for creating round robin schedules for zone soaking etc. There is also support for pumps/valves. Pumps/valves are associated with any number of zones and will be started before any of the zones associated are turned on. The pump/valve will stay on as long as any of the associated zones are running.

Watering schedules can be set by day of week, even/odd, or interval (number of days between waterings). Zones and Programs may be paused and Zones can be skipped. Individual Zones can be started/paused/stopped by themselves (outside of a program) and a manual runtime can be set separate from the program runtime. Program runtimes may be absolute or relative to sunrise / sunset.

There is a master system enable, master program enable, and the ability to skip the current or next days programs.

A history log is maintained so that you can see what happened while away or overnight.

You may set up weather restrictions to keep a program from starting or to keep a new zone from starting within a running program. There are 4 rules: rain now, rain today, previous rain, and forecast rain. For previous rain and forecast rain, you can specify the day range to consider. There are 9 driver fields that specify the source data for the weather rules. These fields are:
WeatherRainNowSource, WeatherRainTodaySource, and WeatherRainForecastSource1 through WeatherRainForecastSource7.

These fields specify a source via a string formatted as <Moniker>,<Field>,<Type>[,<Multiplier>]. Moniker and Fields are the driver moniker and field names to read to get the data. Type is a field type: B - boolean, C - card, F - float, S - string. Multiplier is an optional value to scale the driver data by. An example of the day 1 weather forecast specification for the weather channel driver might be: Weather,Day1PerPercipD,C,0.01 . If using the weather channel driver for forecasts, you would fill in WeatherRainForecastSource1 through WeatherRainForecastSource5. These values are saved between driver installs so they only have to be entered once. The best way to populate these fields is to use the Admin field browser to select and enter the values for each one. If you have a rain sensor, you can use the rain now rule and specify the driver/field of the rain sensor in the WeatherRainNowSource field.

The Evapotranspiration (ET) is calculated incrementally during the day - once per hour. You can choose the minute of the hour in which the ET will be updated to best sync up with the weather data you are using. Rainfall is updated every 5 minutes and the water balance increased based on the rainfall during the last 5 minute period. The soil type and slope are used to determine how much water can actually be absorbed and how much ends up as runoff. The RainfallToday weather source is used for the water balance rainfall update.

ET requires 4 driver fields to be specified: WeatherTemperatureSource, WeatherHumiditySource, WeatherUVSource, and WeatherWindSpeedSource.
To use the WeatherChannel driver for the source data for ET set these fields to the following:

WeatherTemperatureSource: <WeatherChannel driver moniker>,CurTemp,I,1
WeatherHumiditySource: <WeatherChannel driver moniker>,CurHumidity,I,1
WeatherUVSource: <WeatherChannel driver moniker>,CurUVIndex,C,1
WeatherWindSpeedSource: <WeatherChannel driver moniker>,CurWindSpeed,C,1

You will probably want to set the update minute to somewhere in the 15 to 25 range to make sure the latest data is available from the Weather Channel driver when ET is calculated.

The driver maintains a 30 day rainfall history that it updates from the Rain Today source just before midnight. This history is used as data for the Recent Rain rule.

Water balance is the percentage of water that is available to the vegetation. The amount of water available is based on vegetation type (root depth) and the water holding ability of the soil type. When the water balance falls below the water balance limit, then the zone needs to be irrigated. Water balance is reduced by evapotranspiration which is the water lost to evaporation and plant transpiration (sweating). Water balance is increased by rainfall and irrigation. Weather restrictions will still inhibit irrigation in water balance mode unless the water balance falls below the Water Balance minimum setting. When below the minimum water balance, the system will ignore weather restrictions except rain now and temperature to force irrigation. In theory, this system should allow autonomous operation of the irrigation system.

On driver install, you are prompted for a driver moniker, enter IrrigationScheduler if you are using my templates.

Next, enter the moniker of your Rain8Net or other irrigation driver. See the above info on fields names in your irrigation driver.

Next, enter the number of zones in your system. The zones template can scroll to view any number of zones.

Next, enter the max number of programs you want to be able to create up to 254. My templates expect 5 programs max.

Finally, enter the max number of valves/pumps you want to be able to create up to 254. My templates expect 5 valves currently and the valves template does not scroll.

The driver will initially create the number of zones you specified in the setup with default names that match the subordinate driver field names and will create a program called Default containing all zones with run times of 15 minutes each.

Once the driver has been installed, the current number of zones, programs, and valves are saved in the driver state file and are used again when the driver is reinstalled.

There is a field in the driver called FakeSprinklersEnabled that when turned on, simulates the sprinkler driver response without actually talking to the driver. This allows you test drive the templates without actually watering. It is off by default.

There is a field in the driver called CycleAndSoakEnabled that allows you to turn off the cycle and soak feature if you desire. It defaults to True.

You may disable WaterBalance updates to zones by setting the driver field WaterBalanceEnabled to False.

Example templates from my system can be found here: http://www.charmedquark.com/vb_forum/sho...8#pid98608


Attached Files
.cqcdrvpack   IrrigationScheduler-0.61.CQCDrvPack (Size: 51.07 KB / Downloads: 21)
Reply
#2
Very nice! I'm working on getting my Rain8net Pro running with CQC as well and this will be a great addition! Thanks for working on this!!
Keith
Reply
#3
Very nice.

Did you take pictures of each zone running and not running? It looks like your last photo shows the zone with sprinklers running which matches the current status. Obviously it would be easy to do this using a enumerated image.
Brian

"Really dear, it was too good of a deal to pass up. Besides, look at what it does now...."
I think my wife is getting a little tired of hearing this :-)
Reply
#4
sic0048 Wrote:Very nice.

Did you take pictures of each zone running and not running? It looks like your last photo shows the zone with sprinklers running which matches the current status. Obviously it would be easy to do this using a enumerated image.

No, I didn't go that far, but that's a clever idea.

It might be hard to get the shot to look exactly the same with just the sprinklers on and off though.
Reply
#5
wow...from squeezebox to sprinklers. you are really raising the bar on functionality.
Reply
#6
How is this driver different from the one that is out there now? I have a Rain8net Pro, unfortunately not working now. I am thinking it may have been hit by a lightning strike, as my Jandy RS controller bit the dust too.

Blake
Reply
#7
kblagron Wrote:How is this driver different from the one that is out there now? I have a Rain8net Pro, unfortunately not working now. I am thinking it may have been hit by a lightning strike, as my Jandy RS controller bit the dust too.

Blake

The only Rain8Net driver that I am aware of just allows you to turn on/off the valves. You still have to supply the timing logic yourself.

This new driver handles all of the logic for scheduling the sprinklers. You create a 'Program' that is a sequence of 'Zones' that each run for a specified duration. You can specify the scheduling of the programs by day of week, even/odd, or interval. There are a few other nice things like history, future activity lists, and skip today/tomorrow. If anything is missing, it should be pretty easy to add now that the basic framework exists.

For me, this is only the first phase of what I'm trying to do. Once Dean gives me the UV data from the Weather Channel feed (hint, hint), I'll be able to calculate Evapotranspiration rates which reflect the rate of water loss from the soil. With that, precipitation data, and weather forecasts, the irrigation system should be able to run by itself and deliver the right amount of water at the right time within the restrictions that I set up. A least I'm hoping that is what will happen...
Reply
#8
You have done an excellent job with this.

I have been trying to get the same thing operational with CQC and a Rain8UPB. I wonder if your driver for the Rain8net could be ported to the Rain8UPB?

Right now I have been trying to get a solution together using a database driver and a SQL database to hold the variables, but it has been a real struggle. Where do you store your variables?

Robert
Reply
#9
robolo Wrote:You have done an excellent job with this.

I have been trying to get the same thing operational with CQC and a Rain8UPB. I wonder if your driver for the Rain8net could be ported to the Rain8UPB?

Right now I have been trying to get a solution together using a database driver and a SQL database to hold the variables, but it has been a real struggle. Where do you store your variables?

Robert

My scheduler driver stores data in flat text files, one file for persistence of zone and program settings and one file for history.
Reply
#10
robolo Wrote:You have done an excellent job with this.

I have been trying to get the same thing operational with CQC and a Rain8UPB. I wonder if your driver for the Rain8net could be ported to the Rain8UPB?

Right now I have been trying to get a solution together using a database driver and a SQL database to hold the variables, but it has been a real struggle. Where do you store your variables?

Robert

After looking into the UPB driver a bit, I believe it may be possible for my scheduler to work without changes with the Rain8UPB if you are using the CQC UPB driver.

On driver install, the scheduler prompts for the moniker of the Rain8Net driver, but it really doesn't care if it really is a Rain8Net driver. All that matters is if the field names that it is looking for are available.

It also appears that the UPB driver lets you name your fields however you want. With that, as long as you name your fields with the same naming convention as the Rain8Net driver and you are using the toggle fields that become boolean fields in CQC, everything will (should) work without changes.
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Generic Modbus Driver - Serial & IP znelbok 24 10,906 07-20-2018, 01:21 PM
Last Post: znelbok
  Irrigation Caddy - WIFI Version (IC-W1) kblagron 0 1,307 05-31-2016, 01:02 PM
Last Post: kblagron
  Generic Database Driver - Beta Mikla 109 29,422 01-06-2016, 09:51 AM
Last Post: Mikla

Forum Jump:


Users browsing this thread: 1 Guest(s)