Feed on
Posts
Comments

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:

Note the new ‘Weather’ link in the menu bar, and the weather information on the bottom, showing the current rain index, temperature, and humidity. The rain index indicates the heaviness of the rain, and translates to the rain delay duration. The program currently calculates the rain index from the weather description returned by the script. For example, ‘Rain’ or ‘Thunderstorm’ translates to a high rain index, while ‘Light Rain’ translates to a low rain index. In any case, this can be adjusted in software.
The configuration page has two added fields: the location, and the ‘Use Weather’ checkbox. Again, there is a variety of ways you can specify the ‘location’.

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!

5 Responses to “OpenSprinkler ‘Weather’ Feature coming soon”

  1. Giannis says:

    Hello there,

    I received the opensprinkler and it is working fine for the last few weeks.

    Is there any plan to utilise the weather forecast and stop the sprinkler from running the program.

    FW version is 1.7 and I cannot seem to find this option anywhere.

    Thanks

    • ray says:

      Not yet, because Google has silently stopped their weather API and I haven’t had time to work on alternative APIs.

  2. joe says:

    Is this feature still in the works? If this is added, it would definitely help getting me off the fence about buying this. Very cool product you’ve got here.