09-09-2009, 06:14 PM
(This post was last modified: 02-24-2018, 09:22 PM by Dean Roddey.)
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
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