OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) sprinklers_pi – An alternative sprinkler control program Re: Re: sprinklers_pi – An alternative sprinkler control program

#24971

trash007
Participant

First off. Great work. Suggestion for wunderground section update is to be able to enter a pws instead of a zipcode query. So the query would look like:

/api/%s/yesterday/conditions/q/pws:%ws.json where %ws is the name/call sign for the personal weather station. This would allow the weather indicator to be even as accurate as the neighborhood.

I would be even tempted to get my own wunderground station($100-200) at some point. 🙂

~H

@rszimm wrote:

The source code is part of the distribution. If you have this running then you already have the source code on your raspberrypi.

The weather adjustment stuff happens in the Weather.cpp file. That’s where the actual URL request to wunderground is formed and where the results are compiled into a duration adjustment. (look especially at Weather::GetScale() ). Right now it pulls from a zip code using the get string:

/api/%s/yesterday/conditions/q/%ld.json where the %s is replaced by your API key, and the %ld is the zipcode.

Using the wunderground API documentation here: http://api.wunderground.com/weather/api/d/docs?d=data/index you can see there are a lot of additional ways to query wunderground beyond just zipcode (e.g. lat/long, personal weather station id, city name, IP geolocation, etc).

Good luck!. If you do something new and interesting, post it back here and I’ll incorporate it into the main line. At some point I’ll get this stuff up on github to make contributions easier…