Comments (4)
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
from watchy.
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: gmtOffset = int(responseObject["timezone"]);
is correct.
(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:
#define OPENWEATHERMAP_URL "http://api.openweathermap.org/data/2.5/weather?lon=-0.12&lat=51.5"
(or whatever longitude and latitude you want is)
(b) Edit “Watchy.cpp” to:
String weatherQueryURL = url + String("&units=") + units +
String("&lang=") + lang + String("&appid=") +
apiKey; // edited
http.begin(weatherQueryURL.c_str());
int httpResponseCode = http.GET();
if (httpResponseCode == 200) {
String payload = http.getString();
payload=payload.substring(payload.indexOf('{')); // edited/added
JSONVar responseObject = JSON.parse(payload);
currentWeather.temperature = int(responseObject["main"]["temp"]);
...
(this works as at 11Sept2023)
from watchy.
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.
from watchy.
Related Issues (20)
- Face with two pages HOT 1
- Main menu navigation
- 'WIDTH_VISIBLE' is not a member of 'WatchyDisplay' HOT 11
- Compilation of 7Seg using PlatformIO fails HOT 6
- Hidden warning indicates incomplete patch HOT 1
- New fix release HOT 2
- WATCHY_LIB_VER needs to be bumped HOT 1
- Add Mac and IP address to "About Watchy" HOT 3
- Binary artifacts in examples/WatchFaces directories obsolete
- Add OTA compatible Assets
- Can we get documentation on how to use the Binary Assets
- Upload "Error 2" HOT 6
- [7_SEG] when no wifi connection available wrong icon HOT 3
- The OTA is not working. HOT 2
- Timezone incorrect HOT 2
- Getting the Unix Timestamp / Epoch? HOT 1
- Time Set HOT 1
- Outdated version of the BMA423 accelerometer driver posted on the Hardware page
- Time stuck to 45:85 2165/25/45 HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from watchy.