robbydyer/sports

Weatherboard is not functional

Closed this issue · 6 comments

The weather board is erroring out but it does appear that the geolocation is still functional. Please see attached photo.

image

I think I know the problem- openweathermap.org at some point updated their one-call API (which this app uses) to 3.0. The new version requires signing up for a subscription. API keys made prior to this change seem to still work with the old (v2.5) API, but newly made keys do not. I'm looking into how to handle this...

At least it gives 1000 free calls a day, I'd imagine that'll cost money if this hits the API every time the board cycles though.

The API is only called once every 30 minutes, so should be safely under the 1,000/day limit

This API call seems to work on my recently created free account:
https://api.openweathermap.org/data/2.5/weather?lat={latfromGeocall}&lon={lonfromGeoCall}&units={standard, metric or imperial}&appid={key}

And it returns this object:
{"coord":{"lon":-84.1481,"lat":35.9335},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"base":"stations","main":{"temp":279.52,"feels_like":276.63,"temp_min":278.46,"temp_max":280.74,"pressure":1028,"humidity":50},"visibility":10000,"wind":{"speed":4.12,"deg":60},"clouds":{"all":0},"dt":1671479066,"sys":{"type":2,"id":2038575,"country":"US","sunrise":1671453733,"sunset":1671488715},"timezone":-18000,"id":4621846,"name":"Farragut","cod":200}

#463

So folks with newer accounts will have to setup a subscription for the "One Call by Call" API. The matrix will never call the weather API more than once every 30 minutes, so you'll never go above the free tier. I added disk caching in this PR to ensure that even matrix restarts will not cause extra weather API calls.

Calling the separate weather forecast API's is a lot bigger change, so I don't want to go that route.

Yes, signing up for the subscription and putting a CC on file worked.