How to Make Watering Your Lawn Really, Really Complicated
HomeSeer Scripts for Irrigation Control, by Steve Corman, networks1@home.com
It's Not as Easy as You Think
I continue to be flabbergasted at the extraordinary complexity involved
in getting computers to do simple things--like turn a valve on or off.
I thought, "I've got this networked computer and home automation system.
I'll just use it to control my sprinklers and adjust for the weather."
Ha!
I have been intermittently writing, running, and refining these HomeSeer(HS)
scripts for about a year now. Results have been mixed. When things are
working, it is very cool and the plants seem to love it. But the system
has repeatedly gotten hosed by complex interactions of weather data access
problems, X-10 control failures, power unreliability, etc. I've had several
cases where my yard flooded because valve relays didn't respond to the
"close" command for relay/X10 reasons. Last summer when I went on vacation
(naturally) some sort of network, Windows, HS, or power problem caused
the computer to crash, meaning it wasn't opening the valves, leading to
severe water stress on my landscape. I am solving these problems gradually,
but the system as a whole is not yet as reliable as a $50 sprinkler
timer from Home Depot. It goes without saying that it has cost much
more than that :-)
So why do I mess around with this? Of course, there is the recreational
value and my belief that with enough effort, money and time, I can beat
the system into submission. Besides, irrigation control is important in
hot, dry areas like Arizona, where I live. Theoretically, making the irrigation
system track the weather should reduce stress on plants and conserve water.
I've got no conclusive evidence on either count, but my plants seem to
like it so far. Your mileage may vary.
How it Works
Evapotranspiration
Evapotranspiration is the theoretical amount of water lost to the
air through a combination of evaporation and transpiration by plants in
a period of time. It takes into account a range of factors like humidity,
wind speed, solar radiation, air and ground temperature, and transpiration
rate of some reference crop. ETo is usually expressed in inches of water.
For a good discussion of ETo and how it's used, see: http://Ag.Arizona.Edu/azmet/et1.htm
An irrigation strategy based on ETo values attempts to replace the water
evapotranspired in the period since the irrigation system last ran. So
one part of this control system is a script (getazmetfile.txt) that runs
daily, accessing the previous day's ETo and precipitation data, and writing
it to a file.
The system stores the last 30 days of data in a file (etodata.txt) and
the watering scripts access this file to determine their watering times.
In Arizona there is a meteorological monitoring network called AZMET, which
publishes daily ETo and precipitation figures for a number of stations
around the state.
The data script is designed to work with the AZMET web site, with data
from Phoenix Encanto station. People elsewhere in Arizona can use another
station as follows:
-
Go to AZMET Current Data Files at http://ag.arizona.edu/azmet/current.htm
-
Find the station you want, and write down the URL for the Daily
link for that station
-
After installing the scripts (see below), edit line 31 of getazmetfile.txt
to reflect the link you recorded. You should really only have to change
"15eh" to whatever other file name you recorded; the rest of the link should
be the same.
People who want to use this system in other states will have to modify
the script that gets the data updates, because different sites will use
different formats for reporting their data. You will need some scripting
skills to make the adaptation. If you write a reliable script, let me know.
Good places to look for ETo data in other southwestern states are:
Crop Coefficients and Application Rates
To use ETo data, you also have to provide a "crop coefficient" (Kc) that
accounts for the difference in transpiration between the crop you're watering
and the reference crop used to calculate ETo. This coefficient is set as
a parameter in each valve control script. Determining the Kc value is straightforward
for turf. For AZMET ETo figures, the crop coefficients are:
-
Warm season, acceptable quality(park) = 0.65
-
Warm season, high quality (golf course) = 0.76
-
Cool season, acceptable quality (park) = 0.65
-
Cool season, high quality (golf course) = 0.72
People in other states should use crop coefficients provided by their meteorological
networks, as they might use different reference crops.
For turf, you also need to know the average inches of water your sprinklers
deliver per hour. You determine this by getting several empty tuna or cat
food cans (really any broad, straight sided container), distributing them
randomly around your yard, and running the sprinkler system for 1/2 hour.
Measure the inches of water depth in each can, average, and multiply by
2.
For landscape plants on drip irrigation systems, crop coefficients (Kc)
are not known, and calculating the watering times involves a certain amount
of guesswork. For crop coefficients, Paul Brown of AZMET suggests
"using 0.6 for adapted species or areas where limited foliage makes
the shade rather diffuse. I would increase the Kc to 0.8 for less adapted
plants with more dense foliage and use a Kc of 1.0 for humid region plants
that generate dense plant cover."
To determine gallons of water to be applied, the script requires you to
provide an average area covered by the average plant on the drip system,
in square feet (example: a 2 foot diameter plant covers a little over 3
sq ft.; use 3.14 times radius-squared for other sizes). The script then
determines the gallons of water needed to cover that area with the inches
of water expressed by the ETo figures.
To determine run time, the script also needs to know the average gallons
of water per hour delivered by the average emitter. Drip emitters are normally
rated in gallons per hour, and standard sizes are 1/2 GPH, 1 GPH, and 2
GPH. I have predominantly one size emitter on a given zone, so I use that
size in the script.
As mentioned above, the figures for drip systems involve guesswork,
so be sure to monitor your plants and adjust the crop coefficient up or
down until they seem to be getting the right amount of water. After that,
seasonal changes should be taken care of automatically.
Hardware
For this system you need X-10 for your valves. There are a number of ways
to do this. I have a 6-relay controller that I got from smarthome.com
Here is my setup:
In an effort to correct some problems (described above) with relays
not responding I have done two things:
-
On advice from someone in the rec.home.automation group, I have set up
a separate event on my system to switch the "common" side of the connections
to the sprinkler valves using one of the relays. This relay is closed before
any watering events are scheduled, and then opened after all of them have
been completed. This provides double-insurance against a relay sticking.
-
I have added a flow detector switch upstream of my sprinkler manifold.
I am using and FS-500 switch from Gems
Sensors It is relatively inexpensive and looks to be well-designed.
This switch is connected to an X-10 powerflash unit. I have a HomeSeer
event configured to set off an alarm whenever the valves are (supposedly)
close, but the switch is detecting flow. This identifies not only cases
where the X-10 controllers fail, but lets me know if there is a mechanical
failure or leak in the valves.
Software
Before you begin:
-
You use these scripts at your own (or your landscape's own) risk. There
is risk, as noted above. You have been warned.
-
These scripts are set up to work in the Phoenix, Arizona area. If you live
somewhere else, you will have to edit the scripts. If you don't know anything
about scripting in HS, you will probably not be able to get this to work
because…
-
The scripts are UNSUPPORTED.
-
The weather data update script reads a web site, so your HomeSeer host
machine needs an Internet connection.
Files Included
Irrigation.zip contains the following files:
| readme.htm |
This document |
| getazmetfile.txt |
HS script to update weather data |
| azmet.pl |
Alternate PERL script to update weather data |
| etodata.txt |
Data file template |
| irrigation_control_turf.txt |
HS script template for sprinkler systems |
| irrigation_control_drip.txt |
HS script template for drip systems |
Installation and Setup
-
Move etodata.txt into the HomeSeer root directory. It comes filled with
default data values (ETo = .3, precip = 0). These will be gradually overwritten
with new weather data as it comes in.
-
Make enough copies of the appropriate irrigation control script templates
for all your zones. Name the copies so they are distinct, like turf_zone1.txt,
drip_roses3.txt, etc. Put these in the HomeSeer scripts directory.
-
Move getazmetfile.txt into the scripts directory.
-
Create an absolute time/date event set to trigger every day at some time
in the morning before any watering will take place. Use the scripts/speech
tab on the event properties to assign the script getazmetfile.txt to this
event.
-
For each zone in your watering system:
-
Create an absolute time/date event. On the trigger tab for event properties,
give the event a unique and informative name. Uncheck the "any date" box
and enter tomorrow's date. Then set the time for the time you would like
watering on this zone to normally take place. Note: The scripts
take no precautions to see if other zones are running and would quite happily
open all your valves at once. If that is an issue in your system, space
start times accordingly.
-
Select the Device Functions tab and establish an "on" event for the X10
device that's controlling the valve for this zone. You can add a delay
to the "on" event, and the script will announce this and take it into account
in the timing. This is useful for being sure you're not sitting in the
lawn when the sprinklers go off.
-
Select the scripts/speech tab, and assign it the appropriate script, which
you created in step 2 above. Click the edit button, and enter the appropriate
configuration parameters for this zone (explained above). Save. Exit event
properties.
HomeSeer GetURL Problems
I have had a great deal of trouble with the GetURL function in HS, which
getazmetfile.txt uses. It works fine for a while, but then it locks up,
or gets locked up by something else. This may be a peculiarity of my system
and I don't know that it is a HS problem per se, but it's a problem.
I have found that a PERL script run by Windows scheduler does a much
more reliable job of updating the weather info. The script uses HTTPGet
by Gunther Birznieks. To use it, install (free) ActivePerl from http://www.activestate.com
. Edit azmet.pl to give the proper path for the data and log files. Set
an event in windows scheduler to run this script daily before any watering
operations. As with getazmetfile.txt, to modify this script for another
location you will need to know PERL.
About Rain
This system does not turn off when it's raining. It would be a waste of
time to design such a feature in Arizona. And besides, for rain shutoff
I would need some kind of expensive rain detector. In any case, given the
watering strategy used here, you would not want to turn off your
sprinklers in the rain, unless it was raining so hard as to cause runoff.
The script will compensate for today's rain in subsequent watering cycles,
so don't interfere with it. If you must skip watering during rain, you
can temporarily disable the zone control event, then reset the date of
the event after it stops raining to get things started again.
Last update: 2-10-2001