I am soooo happy with my new sprinkler controller! What an improvement over my old timer-based system! I've wanted a system like this for years!
The one additional thing I felt was essential is to have a log--my wife is always asking "when was the ... watered last?", and it was very hard (in practice impossible) to figure that out in the timer-based system. Answering that question requires a log--the schedules say what might have happened, but given rain delays etc, only a log can tell what actually happened.
I was intending to modify the sprinkler firmware to add this log facility, but noticed that it is approaching memory limits, and then looked at its direct web interface, and realized I didn't need to change the sprinkler code at all to make a nice log facility.
The way it works is to have a cron (actually launchd) task running all the time on my Mac, which uses the sn0 command via html to get the current valve state, every 20 seconds. If the state has changed, it is recorded along with the date and time by appending it to the log file. The previous value is saved in another file, to remember it for 20 seconds for comparison purposes.
It did take me a long time to figure out the right configuration for the task so it would run whether or not anyone was logged in (had to get the file locations and permissions right, as well as the form of the plist that submits the task via launchctl).
I wrote the little logger that the cron task runs using PHP, just because I was familiar with it and it's included in all Macs.
The log display is a web page served by my Mac, written in HTML and (mainly) PHP.
(In the new Mountain Lion system, Personal Web Sharing is still available, but the interface for enabling it is missing, so a few Terminal commands are now needed to get Apache, PHP, etc running.)
The programs are quite small, and I'm happy to post or share them if anyone wants to do something similar. (I did search here for a similar project so I wouldn't have to do my own--if I missed it, I apologize!)
It should be even easier to make this stuff work in Linux or Windows, as the Mac Cron stuff has evolved to be rather sophisticated.
I also set up my router so port forwarding makes my personal web server accessible from anywhere. I also set up a port for accessing the sprinkler controller web features from anywhere.
The log display took several forms during development, but the one I converged on goes through the most recent N days of log, collecting information about time of occurrence, duration, and identity of the valve. It then presents the information sorted by valve and time. It also checks the current state, and marks the current watering flow (if any) as being in progress. This web page updates itself every 20 seconds also, which normally wouldn't be necessary but is useful for checking current activity while walking around the yard viewing it on my iPhone.
It's really lovely being able to control the sprinklers manually by phone while out in the yard!!
One feature I'd still like to add would show the upcoming scheduled events for the next day or so, and I'm wondering if there is any way to extract that via the controller's web interface?
The current log display looks like: (missing the table format, bold headings, etc. The valves I used for this debugging are unused ones, hence the boring names. I didn't want to run actual water while debugging! The real valves have descriptive names (no length limits in this software)
Valve Operations Date/Time (last 7 days)
V08=Unused, 2 run periods, ending at
0.2 min Sat, Oct 20, 2012, 4:11 PM
4.0 min Sun, Oct 21, 2012, 8:37 PM
V14=Unused, 2 run periods, ending at
0.2 min Sat, Oct 20, 2012, 1:11 PM
0.6 min Sun, Oct 21, 2012, 12:04 PM
V15=Unused, 6 run periods, ending at
0.2 min Sat, Oct 20, 2012, 4:05 PM
0.6 min Sun, Oct 21, 2012, 12:06 PM
0.3 min Sun, Oct 21, 2012, 4:48 PM
6.7 min Sun, Oct 21, 2012, 8:37 PM
1.0 min Sun, Oct 21, 2012, 8:42 PM
0.7 min Sun, Oct 21, 2012, 10:53 PM
0.2 min Mon, Oct 22, 2012, 12:23 PM Running Now
V16=Unused, 6 run periods, ending at
0.2 min Sat, Oct 20, 2012, 4:06 PM
0.4 min Sun, Oct 21, 2012, 12:06 PM
0.3 min Sun, Oct 21, 2012, 12:18 PM
21.3 min Sun, Oct 21, 2012, 8:37 PM
9.3 min Sun, Oct 21, 2012, 10:53 PM
0.3 min Sun, Oct 21, 2012, 11:01 PM