-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timezone from OpenWeatherMap has changed, Watchy hasn't. #232
Comments
Geolocation would be nice for sunset and tidal calculation also But yes, https://openweathermap.org/current#geo looks like they haven't bumped api numbers |
In case it's helpfull to anyone: (1) OpenWeatherMap has always returned gmtOffset in seconds, and this is what Watchy requires/expects, so the original line: (2) The way I fixed the “City ID has been discontinued, Geo-Location (longitude and latitude) is required” issue is: (a) Edit “settings.h” to:
(b) Edit “Watchy.cpp” to:
(this works as at 11Sept2023) |
Instead of using static Longitude and Latitude, you can use the same payload method of reading the JSON from this URL: http://ip-api.com/json/?fields=lat,lon And merging the results into the OPENWEATHERMAP_URL by making lon=#1&lat=#2 and replacing #1 & #2 with the results from the above URL after parsing it's JSON. This is how Watchy GSR does it. |
This can be closed as of 99cacd2, can't it? |
Watchy.cpp:
Line 662:
gmtOffset = int(responseObject["timezone"]);
should be
gmtOffset = int(responseObject["timezone"]) / 3600; // OpenWeatherMap returns seconds from UTC.
Also, City ID has been discontinued, Geo-Location is preferred.
The text was updated successfully, but these errors were encountered: