I’m trying to teach my GoPiGo3 robot Carl to give me a “weather report”.
Yesterday Carl said it was “cloudy” when there were no clouds in sight.
This morning Carl said “extreme rain” when the radar doesn’t show a rain cloud within 400 miles.
(Learning how to parse openweathermap.org JSON reports)
But then again they say if you don’t like the weather wait 15 minutes.
I just checked again and Carl now says “clear sky” so I guess I shouldn’t trust a robot to tell me the weather.
2 Likes
KeithW
January 18, 2021, 6:35pm
2
I’m pretty sure Carl is 100% correct about the weather. It’s just that he’s not 100% about YOUR weather
In all seriousness - are you sure which wx reports he’s pulling down?
/K
1 Like
They offer two free APIs, a current wx, and a detailed minute, hour, 16 day thing that looks like a bad case of TMI!
The example I found only extracted temperature and humidity. I,m learning all the other things on my own.
1 Like
cleoqc
January 18, 2021, 10:15pm
4
This project was done with the GrovePi and Wunderground . Different API but maybe it will fill your needs?
3 Likes
Thanks for the pointer.
I already have a wunderground account but never registered my station.
Generated a key ok, but it seems the API may have changed.
I’ll have to investigate more.
2 Likes
KeithW
January 19, 2021, 12:30am
6
Ah - so you send your location as part of the API call. That’s really what I was wondering - whether you specified the location or it was being inferred some how (e.g. from your IP address).
/K
2 Likes
Yes - for the current weather, I send zipcode:
url="http://api.openweathermap.org/data/2.5/weather?zip=33472&units=imperial&wind.direction.name&appid={}"
and for the forecast api, I send a lat/lon:
url="http://api.openweathermap.org/data/2.5/onecall?lat={}&lon={}&units=imperial&wind.direction.name&appid={}"
2 Likes