This is a heads-up for the upcoming ‘weather’ feature in the OpenSprinkler software. It makes use of the Google Weather API to obtain current weather data in your local area. The Google Weather API returns data in XML format. Unfortunately the OpenSprinkler, which uses a small microcontroller, cannot directly handle the returned data. So what I had to do is to write a Python script that translates the XML data into something that’s much shorter and simpler, so that it can be processed by OpenSprinkler. I’ve put up the script on this website. You can try it by using the following url:
http://rayshobby.net/scripts/getweather.py?location=nyc
It returns a simple html page that’s well within a single Ethernet packet. One nice feature about using the Google API is that you can specify the location in a variety of different formats, such as zip code, city name, or sometimes abbreviated names like ‘nyc’. Feel free to give it a try. This script will be published later, so you can install it on any server you want.
Another feature is the weather forecasts. Right now I have no plan to use this information, but it may be useful for the future. You can get forecast data using:
http://rayshobby.net/scripts/getweather.py?location=nyc&forecast=1
It can return up to four days of forecasts.
I’ve modified the Arduino code to periodically retrieve weather data from the server. The new OpenSprinkler webpage has the following changes:
What I am currently working on is to update the software code to allow the control by weather data. The simplest way is to use the ‘rain index’ to control rain delay hours. More complicated strategy can be implemented by yourself. That’s the value of open-source and programmable gadgets!