OpenSprinkler › Forums › Hardware Questions › OpenSprinkler Pi (OSPi) › sprinklers_pi – An alternative sprinkler control program › Re: Re: sprinklers_pi – An alternative sprinkler control program
rszimm
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…