Quick Links: Part 1, Part 2, Part 3, Part 4, Part 5
Software Components
As discussed in Part 3, there are two main software components that support the irrigation system: software that runs within the ISY and a web application that runs on an internet-hosted web server.
The ISY drives all of the scheduling and controls the physical triggering of the irrigation zone valves. The web application performs the evapotranspiration (ET) calculations, tracks irrigation events (including rainfall) and tracks the water balance.
Note: (8/6/2009) When I posted the first three parts of this series on the UDI Forums, Universal Devices expressed an interest in integrating evapotranspiration and water balance calculations into the ISY. This is excellent news as this would allow the complete irrigation system to run independently without requiring a hosted web application component. I am going to continue this series of posts based on my current system but I will update this later if move to a complete ISY-based system. My current system is running very reliably so I will decide whether to switch later when this is released as part of the ISY firmware.
Web Application
The web application provides three main components: a water balance database, an HTTP interface that is used by programs in the ISY, and an online dashboard that displays the current status of the irrigation system.
Water Balance Database
The water balance is tracked in a single database table where each entry recorded in the table is a water balance event (i.e. any event that affects the water balance).
The water balance table tracks the following fields:
ID – A unique id for the event
TIMESTAMP – The timestamp of the event
EVENT – The event that occurred
AMOUNT – The amount of the event in inches
The current event types that are supported include:
ET – Evapotranspiration in inches
RF – Rainfall in inches
RO – Run-off in inches (used when the rainfall rate exceeds the infiltration rate of the soil)
IR – Irrigation amount in inches
ADJ – Adjustment in inches (used to adjust the water balance, for example to reset the water balance, while retaining the historical irrigation data)
HTTP Interface
The HTTP interface provides a mechanism for the ISY to communicate with the hosted web application. The interfaces uses HTTP GET requests that pass parameters in the querystring (URL). The interface supports the following request types:
processtodaysweather
Processes the weather for the current day. This request is called once per day by the ISY (just before midnight). This request triggers the web application to update the water balance with the current day’s evapotranspiration and rainfall.
The weather information that is required for these calculations is retrieved from WeatherBug (using the same station ID that is used in the climate module in the ISY). Evapotranspiration (ET) is calculated using the FAO Penman-Monteith equation using the daily metrics provided by the WeatherBug station (min and max temperature, min and max humidity, and average windspeed).
The cumulative daily rainfall is provided directly by the WeatherBug station.
Example:
Request:
http://www.hostname.com/irrigation/control.php?action=processtodaysweather
Response (For diagnostic purposes):
SUCCESS: Recorded 0.25 inches of evapotranspiration.
SUCCESS: Recorded 0.05 inches of rainfall.
isirrigationreqd
This request type is different from the other request types in that it returns a boolean value to the ISY to determine if an irrigation cycle is required to be run. The ISY currently does not have a way to read values from external systems so I am using the Flex Alert system to accomplish this. This request type checks the water balance database and determines if the water balance deficit is greater than the amount specified. If the amount is greater than the deficit an active Flex Alert response is provided, otherwise an inactive Flex Alert response is returned. The Flex Alert status is then used in a program in the ISY to trigger an irrigation event.
Example:
Request:
http://www.hostname.com/irrigation/control.php?action=isirrigationreqd&amount=0.5
Response (Used by the Flex Alert system available in ISY 99 v2.7.3):
<?xml version=”1.0″ ?>
<flexalert>
<active>true</active>
</flexalert>
irrigated
Records an irrigation event. This request is called by the ISY whenever an irrigation cycle is completed. The amount of water that has been applied (in inches) is passed as a parameter. The web application records this irrigation event in the water balance database.
Example:
Request:
http://www.hostname.com/irrigation/control.php?action=irrigation&amount=0.9
Response (For diagnostic purposes):
SUCCESS: Recorded 0.9 inches of irrigation.
Dashboard
I currently have a basic dashboard in place that shows the status of the irrigation system. I plan to add more capabilities in the future (like the ability to change settings etc.) but the interface provides what I need for now.
The dashboard provides a summary of the recent activity and provides an interactive chart that displays the current months water balance events (daily evapotranspiration, cumulative water balance, irrigation and rainfall).
The screenshot below should be pretty self-explanatory. Irrigation events are fairly evenly spaced in this example (about every 5 days) due to relatively consistent evapotranspiration and rainfall this month.

ISY Programs
The ISY drives the system by communicating with the web application and by running the actual irrigation cycles. The system requires only three ISY programs and I will go over those in more detail here.

Processing the Days Weather
As noted above, the web application provides a request type that allows the ISY to send a request to process the weather information for the current day.
The request is configured as a network resource in the networking module (named Irrigation.Resource.Action.ProcessTodaysWeather).
The following program calls this resource every night shortly before midnight.
Program Name: Irrigation.ProcessTodaysWeather
If
Time is 11:45:00PM
Then
Resource 'Irrigation.Resource.Action.ProcessTodaysWeather'
Else
- No Actions - (To add one, press 'Action')
Checking if Irrigation is Required
As noted above, the Flex Alert system is used to inform the ISY when irrigation is required. This is configured by setting the server URL in the Flex Alert Settings (Electricity > Main tab) to the “isirrigationreqd” request type.

Please note that the left-most portion of the URL is truncated in the screenshot due to the size of the text box. The amount that is passed (0.6) is the allowable water deficit in inches. If the water deficit is greater than the amount specified the Flex Alert response will return ‘true’ and an irrigation event will be run at the next scheduled time.
Running an Irrigation Cycle
The following program is responsible for checking the Flex Alert status and running the irrigation cycle:
Program Name: Irrigation.Run
If
Time is Sunrise - 2 hours and 30 minutes
And Module 'Flex Alert' Status is Active
And Module 'Climate' Wind Speed &lt;= 10 mph
And Module 'Climate' Rain Today &lt;= 0.1 &quot;
Then
Run Program 'Irrigation.Cycle' (Then Path)
Resource 'Irrigation.Action.Irrigated'
Else
- No Actions - (To add one, press 'Action')
The Flex Alert status is checked every morning at 2.5 hours before sunrise. If the Flex Alert status is Active (irrigation is required) and there is no recent rainfall (that morning) and it is not windy then an irrigation cycle is run.
A separate program is used to run the actual irrigation cycle. This program is designed to provide 0.9 inches of water to the lawn using 3 cycles of each of the zones (with a 50 minute soak time between cycles to reduce runoff due to the high clay content in our soil).
Program Name: Irrigation.Cycle
If
- No Conditions - (To add one, press 'Schedule' or 'Condition')
Then
Set 'Sprinkler Zone 1' On
Wait 10 minutes
Set 'Sprinkler Zone 3' On
Wait 10 minutes
Set 'Sprinkler Zone 2' On
Wait 10 minutes
Set 'Sprinkler Zone 4' On
Wait 10 minutes
Set 'Sprinkler Zone 4' Off
Wait 50 minutes
Set 'Sprinkler Zone 1' On
Wait 10 minutes
Set 'Sprinkler Zone 3' On
Wait 10 minutes
Set 'Sprinkler Zone 2' On
Wait 10 minutes
Set 'Sprinkler Zone 4' On
Wait 10 minutes
Set 'Sprinkler Zone 4' Off
Wait 50 minutes
Set 'Sprinkler Zone 1' On
Wait 10 minutes
Set 'Sprinkler Zone 3' On
Wait 10 minutes
Set 'Sprinkler Zone 2' On
Wait 10 minutes
Set 'Sprinkler Zone 4' On
Wait 10 minutes
Set 'Sprinkler Zone 4' Off
Send Notification to All
Else
Set 'Sprinkler Zone 1' Off
This program would be configured differently for different soil types with the objective of delivering a fixed amount of water while causing minimal runoff and minimal drainage below the root zone.
Clay has a high water capacity and releases water slowly so I provide a large amount of water during each irrigation cycle. If our soil was sandy a lesser amount of water would be applied. This would automatically result in a higher irrigation frequency with lesser amounts of water applied per irrigation cycle.
These amounts (allowable water deficit and irrigation amount) are set within the ISY so no changes are required in the online application to adjust the watering program.
Calibration of the irrigation amount can be done by using tuna cans or something similar to measure the watering rate of the system (inches per hour). This can then be used to set the appropriate zone timings to acheive a specific irrigation amount (approximately 30 minutes per zone for my system).
Updating the Water Balance
When an irrigation cycle is run the Irrigation.Run program calls another network resource in the networking module (Irrigation.Resource.Action.Irrigation) to update the water balance with the irrigation amount. This amount specified in the network resource is the amount water supplied by the irrigation cycle (0.9 inches in my case).
Continued (Read Part 5)