OpenSprinkler Logger

Logging is a useful feature which allows you to find out how OpenSprinkler has worked say, in the past week. While you can check the scheduled water programs using the ‘Program Preview’ feature, it does not account for dynamic changes like rain delay, power loss etc. This is where logging comes in handy: you can find out what OpenSprinkler has actually done in the past. Unfortunately I have not been able to include logging in the firmware because of the memory space that it would require to store the log data.

Recently, David Gustavson, an OpenSprinkler user, successfully implemented logging by using a PHP script that he wrote. The way it works is to have a computer that periodically polls the OpenSprinkler status say, every 20 seconds, and the script checks the differences between every two consecutive polls to record status changes. This is quite clever, as it does not require any modification on the OpenSprinkler side. All that it needs is for OpenSprinkler to return the status of each station, which it already does. Of course this does require a computer running on the side (or even remotely), but it’s pretty easy to set up, and you can use a plug computer or a Raspberry Pi which has very low power consumption.

David is kind enough to share his scripts and I’ve checked them in to the OpenSprinkler GitHub repository under the script/PHP/ directory. He also wrote a blog post about OpenSprinkler, which you can read about here. Thanks David!