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:

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: 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:

Software

Before you begin:

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

  1. 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.
  2. 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.
  3. Move getazmetfile.txt into the scripts directory.
  4. 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.
  5. For each zone in your watering system:
  6. 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