n0bel / PiClock

A Fancy Clock built around a monitor and a Raspberry Pi
MIT License
566 stars 182 forks source link

Darksky API Replacement #185

Closed n0bel closed 1 year ago

n0bel commented 4 years ago

After a bunch of research carried out by the great people helping with this project, a new provider has been selected, as pointed out in this issue comment:

https://github.com/n0bel/PiClock/issues/179#issuecomment-622951747

We'll have a new version soon.

xxxDrewedxxx commented 1 year ago

I updated my PiClock to work with the Tomorrow.io v4 API (formerly Climacell). I'll update it on GitHub today or tomorrow.

@SerBrynden Cool! I just got your version working this weekend, now to update it!
Any chance you could add in weather watches and warnings from NWS?

Vindictor commented 1 year ago

@SerBrynden Hi there, I'm not sure if you can help? First, following a fresh Bullseye install I tried @n0bel's PiClockv3. I was aware that it probably wasn't finished, and sure enough I saw no maps or weather, other than METAR, but it did run (though I have no keyboard / mouse on that Pi and control it via SSH, and I was unable to launch via SSH, but that's another story)

So then I tried https://github.com/SerBrynden/PiClock/blob/master/Documentation/Install.md

I skipped the parts regarding IR remote, radio and sensors, and GPIO. I don't use those. I configured the ApiKeys.py with my original PiClock keys, for Google and more recently openweathermap (which didn't work for me on the original PiClock, which is why I'm trying a reinstall)

Once I'd finished, I set the weather units to metric in Config.py, and inserted my co-ordinates (copied and pasted from my old PiClock Config.py file) When I run it, it appears to start, I see the familiar Starting PiClock window, for a split second I see the clock on the screen, and then it goes back to the desktop, and in my SSH window I see....

Traceback (most recent call last): File "/home/xxx/PiClock/Clock/PyQtPiClock.py", line 404, in wxfinished_owm f = wxdata['current'] KeyError: 'current' Aborted

(where xxx is my name which I've edited for this post)

I'm not sure what I did wrong. I don't have a key for mbapi as I never had one for my original PiClock. Is this the issue? I'm using a owmapi key for weather.

Hoping I can get a PiClock running again! :). I do appreciate that I can run yours from an SSH login, which is invaluable during setup and troubleshooting. Thanks for any help. I guess I'll go back to my original PiClock sd card for now.

EDIT: Interestingly, I booted back into my old PiClock SD Card, and this time also ran it from an SSH window. While the clock does load and function (missing only forecast data on the right of the screen) I did notice it apparently connect to openweathermap, and after that, I noticed a similar error that I got with the PiClock fork. I'll replace my identifying info with xx

setting current and forecast:Mon Mar 27 19:44:02 2023 https://api.openweathermap.org/data/2.5/onecall?appid=1xx&lat=xx&lon=-xx&units=imperial&lang=en&r=xx wxstart for radar1 wxstart for radar2 Traceback (most recent call last): File "PyQtPiClock.py", line 406, in wxfinished_owm f = wxdata['current'] KeyError: 'current'

but the clock does load here, it's just the forecast data missing, ever since DarkSky data went offline over the weekend, and I got an openweathermap key instead. Maybe I could try a git reset --hard, and revert to the example ApiKeys and Config files, and see if that helps. Still, I'd like to get the newer version on Bullseye working now, if possible :)

SerBrynden commented 1 year ago

@Vindictor That error occurs when nothing is received by the API JSON query for weather data. Either there is something wrong with how you entered your OpenWeatherMap API key in ApiKeys.py or your are subscribed to the wrong OpenWeatherMap plan. Not your fault if its the wrong plan. We need to update the PiClock documentation. OpenWeatherMap now has a "One Call by Call" subscription plan, which uses their One Call API 3.0 and that's the plan which they present front and center on their webpage. But PiClock uses the One Call API 2.5, which you can use by subscribing to the "Professional collections: Current weather and forecasts" free plan. The only differences between the free 2.5 and 3.0 plans are the call limits and the URL used for API JSON queries. Start here: https://openweathermap.org/appid or if you already have an OWM account, look for the "Professional collections: Current weather and forecasts" free plan under https://home.openweathermap.org/subscriptions.

SerBrynden commented 1 year ago

@xxxDrewedxxx I think there is another fork that includes weather watches and warnings from NWS. Can't remember which though.

xxxDrewedxxx commented 1 year ago

@SerBrynden Merky's does, but his is based on Chromium and I don't know how to edit that to show what I want, how I want.

I know... I'm going to learn at some point.......sigh... lol

SerBrynden commented 1 year ago

@Vindictor also make sure your API keys are enclosed by quotes is ApiKeys.py.

billskeen68 commented 1 year ago

@SerBrynden @Vindictor

I get the same error as @Vindictor. KeyError: 'current'

I thought I had requested the free 2.5 api key as you outlined above.

If I use the URL that is shown in the PyQtPiClock.1.log: z = my API key, x = lat, y= lon

https://api.openweathermap.org/data/2.5/onecall?appid=zzzzzzzzz&lat=xx.xxxxxxxx&lon=-yy.yyyyyyy&units=imperial&lang=en&r=0.5570196804414401

I get this error: {"cod":401, "message": "Invalid API key. Please see https://openweathermap.org/faq#error401 for more info."}

But if I change the ".../2.5/onecall..." to ".../2.5/weather..." it works:

{"coord":{"lon":yy.yyyy,"lat":xx.xxxx},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"base":"stations","main":{"temp":52.95,"feels_like":50.63,"temp_min":50.74,"temp_max":54.86,"pressure":1023,"humidity":57},"visibility":10000,"wind":{"speed":14.97,"deg":350,"gust":23.02},"clouds":{"all":0},"dt":1680015823,"sys":{"type":2,"id":2002618,"country":"US","sunrise":1680005982,"sunset":1680050580},"timezone":-18000,"id":4724194,"name":"Rowlett","cod":200}

Does that mean I still don't have the correct 2.5 API Key?

Vindictor commented 1 year ago

@Vindictor That error occurs when nothing is received by the API JSON query for weather data. Either there is something wrong with how you entered your OpenWeatherMap API key in ApiKeys.py or your are subscribed to the wrong OpenWeatherMap plan. Not your fault if its the wrong plan. We need to update the PiClock documentation. OpenWeatherMap now has a "One Call by Call" subscription plan, which uses their One Call API 3.0 and that's the plan which they present front and center on their webpage. But PiClock uses the One Call API 2.5, which you can use by subscribing to the "Professional collections: Current weather and forecasts" free plan. The only differences between the free 2.5 and 3.0 plans are the call limits and the URL used for API JSON queries. Start here: https://openweathermap.org/appid or if you already have an OWM account, look for the "Professional collections: Current weather and forecasts" free plan under https://home.openweathermap.org/subscriptions.

@SerBrynden Ah, thanks for that. I had a feeling there was something wrong with my API key, which is why I generated a second one to try, and was even thinking of posting the secondary key for another PiClock user to test.
I've been here trying to get a "Professional Collections" key, but actually, maybe that IS what I already have. if I visit the https://home.openweathermap.org/subscriptions page, instead of seeing a subscribe button beside the free plan, I see "default". Well, I'll keep looking. If all else fails I'll set up a second account and ensure I select the right one from the beginning. Thanks for your continued help.

Screenshot 2023-03-28 at 16 31 02

EDIT: my key in ApiKeys.py is laid out as owmapi = 'xxxx'

billskeen68 commented 1 year ago

@Vindictor

I see the same thing. It says it does not apply to the One Call API 3.0.

So confused. lol

Vindictor commented 1 year ago

@Vindictor

I see the same thing. It says it does not apply to the One Call API 3.0.

So confused. lol

Yes, I'm getting confused now also.
If I visit https://openweathermap.org/full-price#current I see this

Screenshot 2023-03-28 at 16 47 30

If I then press Get API Key, it just takes me here https://openweathermap.org/appid with no new API key

If I visit https://home.openweathermap.org/myservices

I see the following

Screenshot 2023-03-28 at 16 50 20

and if I click on "view" then it just takes me back to http://openweathermap.org/price#weather and if I then click on "get api key" under the Professional Collections, free, then it just takes me to https://home.openweathermap.org/

Going around in circles. I do notice it says "Alert - you are already signed in" when I try to do something like "get api key" so.... maybe setting up another new account won't hurt. :) I WILL get it working!!

Vindictor commented 1 year ago

OK, I did create a new Openweathermap account using another email address.
I made sure I selected the correct thing, but all is as I posted above. I went to my API Keys, copied and paste the key into my PiClock (still currently running my original PiClock, not the fork, as the original at least lets the clock load without crashing to desktop, but as before there is no weather forecast data displayed. Tomorrow I'll swap SD cards, boot the @SerBrynden fork, enter my new API key into that and see if it will start. At least with my original PiClock I can view the time and date, sun rise and sunset (although the time has not adjusted for summer time) I can see rain clouds over my Google Maps, and I have current weather data using the METAR = command. Just the forecast is missing. Maybe Openweathermaps are having issues with new keys? Maybe someone else would be good enough to generate a new account and see if their new key works? Thanks.

SerBrynden commented 1 year ago

It seems that the OpenWeather 2.5 API was deprecated for new accounts when they released 3.0. Old accounts still work. However, OpenWeather fails to announce this kind of information unless you contact their tech support. :-/ @Vindictor if you try what @billskeen68 tried and change the ".../2.5/onecall..." to ".../2.5/weather..." in the API call, and paste it in your browser, does it work? See: https://github.com/n0bel/PiClock/issues/185#issuecomment-1487135680

n0bel commented 1 year ago

@SerBrynden @Vindictor Thank you for doing the troubleshooting on this. It helps out everyone with this issue.

I didn't realize either that you couldn't get a new api key that would actually work with PiClock.

So.. Today or Tomorrow I'll be patching up PiClock to work with new api keys. Hopefully they'll work with old api keys too.

Vindictor commented 1 year ago

It seems that the OpenWeather 2.5 API was deprecated for new accounts when they released 3.0. Old accounts still work. However, OpenWeather fails to announce this kind of information unless you contact their tech support. :-/ @Vindictor if you try what @billskeen68 tried and change the ".../2.5/onecall..." to ".../2.5/weather..." in the API call, and paste it in your browser, does it work? See: #185 (comment)

I'll have a try in a bit. I was just creating a tertiary account to share the API key on this thread, so anyone else could try it. what I hadn't noticed is, after having made and confirmed the account, a second email is sent with some examples. I clicked on the example for the tertiary account and I got a 401 Invalid API key error.... possibly as the account was JUST created. so I went back to the second account and found the email with instructions, clicked on the test link, and the URL works.

I don't want to share the API key of this secondary account, even though it's not working in PiClock right now, however I will share the demo URL for the tertiary account I set up, and presumably with time, this will also give a response.

So, the demo/test URL I got in the instruction email is this

(and again, is is a URL copied directly from the email I received from openweathermap)

http://api.openweathermap.org/data/2.5/weather?q=London,uk&APPID=e5dad586a4d67ea5457c00c8dbade1e0

Oh, and in the time it's taken me to type this, that URL now appears to work, instead of giving the 401 error.

So if anyone wants to try the key in that URL and see if it works for them, please post back the result? Thanks.

SerBrynden commented 1 year ago

@Vindictor Yeah, you have to wait a couple hours or so after creating a new account before the API key is active.

Vindictor commented 1 year ago

@Vindictor Yeah, you have to wait a couple hours or so after creating a new account before the API key is active.

I just rebooted my PiClock which currently still has that ApiKey from my previous post (which is working in that URL) but still nothing displayed on my original PiClock. I noticed that part of the test URL is data/2.5/weather.... Does this not mean I have a 2.5 key? Also weird, I just SSH'd into my Pi to check the log files. they were last updated on March 24, which was (I think) the day DarkSky stopped working, and the day I did a gitpull and update.py.

Anyway, I'll leave it for today. If there's an update to the original Pi soon, I'll grab that and try it with my owmapi key(s) and I'll also try the PiClock fork by @SerBrynden tomorrow and see if I can get it to launch (and stay launched)

Thanks for everybody's effort. I do love my PiClock, so it's worth some effort to get it going, again.

By the way, have any of you people much more knowledgeable than I tried the API key I provided above as part of the "test URL" to see if it works with your own setups?

SerBrynden commented 1 year ago

@n0bel I created a new OWM account, waited for the API key to be active, and here's what I found:

The ".../2.5/onecall?..." API call (currently used in PiClock) is deprecated for new OWM accounts. To continue supporting older newer accounts, current weather data will have to be retrieved using the ".../2.5/weather?..." API call and forecast data (5 day / 3 hour forecast) will have to be retrieved separately using the ".../2.5/forecast?..." API call. There is no longer a “onecall” for 2.5 that includes all the current and forecast data in one response. The “onecall” for 3.0 would require every user (old and new) to subscribe to that separate service, which WILL charge you if you go over the daily limit. The 2.5 API will just not respond if you go over the limit.

Links: https://openweathermap.org/full-price#current https://openweathermap.org/current https://openweathermap.org/forecast5

n0bel commented 1 year ago

@SerBrynden Thank you for the research. I'll work on PiClock to split up the calls. I don't like the age (sometimes 2-4 hours) of the 'current' (/weather) data provided by OWM anyway. Thats why I added the METAR option. So it'll be metar vs owm current, and then owm forcast

Not a quick and dirty fix, but not difficult either. Probably a whole bunch of lines will change however.

I want to get this done for those hitting the March 31 deadline, and have OWM working. I guess I'll deal with tomorrowio v4 as well.

billskeen68 commented 1 year ago

I used my new 3.0 API Key and got the following data using this URL: https://api.openweathermap.org/data/3.0/onecall?lat=xx.xx&lon=-yy.yy&appid=zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

{"lat":xx.xx,"lon":-yy.yy,"timezone":"America/Chicago","timezone_offset":-18000,"current":{"dt":1680025017,"sunrise":1680005359,"sunset":1680049980,"temp":292.88,"feels_like":291.82,"pressure":1025,"humidity":35,"dew_point":277,"uvi":7.98,"clouds":0,"visibility":10000,"wind_speed":5.14,"wind_deg":350,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}]},"minutely":[{"dt":1680025020,"precipitation":0},{"dt":1680025080,"precipitation":0},{"dt":1680025140,"precipitation":0},{"dt":1680025200,"precipitation":0},{"dt":1680025260,"precipitation":0},{"dt":1680025320,"precipitation":0},{"dt":1680025380,"precipitation":0},{"dt":1680025440,"precipitation":0},{"dt":1680025500,"precipitation":0},{"dt":1680025560,"precipitation":0},{"dt":1680025620,"precipitation":0},{"dt":1680025680,"precipitation":0},{"dt":1680025740,"precipitation":0},{"dt":1680025800,"precipitation":0},{"dt":1680025860,"precipitation":0},{"dt":1680025920,"precipitation":0},{"dt":1680025980,"precipitation":0},{"dt":1680026040,"precipitation":0},{"dt":1680026100,"precipitation":0},{"dt":1680026160,"precipitation":0},{"dt":1680026220,"precipitation":0},{"dt":1680026280,"precipitation":0},{"dt":1680026340,"precipitation":0},{"dt":1680026400,"precipitation":0},{"dt":1680026460,"precipitation":0},{"dt":1680026520,"precipitation":0},{"dt":1680026580,"precipitation":0},{"dt":1680026640,"precipitation":0},{"dt":1680026700,"precipitation":0},{"dt":1680026760,"precipitation":0},{"dt":1680026820,"precipitation":0},{"dt":1680026880,"precipitation":0},{"dt":1680026940,"precipitation":0},{"dt":1680027000,"precipitation":0},{"dt":1680027060,"precipitation":0},{"dt":1680027120,"precipitation":0},{"dt":1680027180,"precipitation":0},{"dt":1680027240,"precipitation":0},{"dt":1680027300,"precipitation":0},{"dt":1680027360,"precipitation":0},{"dt":1680027420,"precipitation":0},{"dt":1680027480,"precipitation":0},{"dt":1680027540,"precipitation":0},{"dt":1680027600,"precipitation":0},{"dt":1680027660,"precipitation":0},{"dt":1680027720,"precipitation":0},{"dt":1680027780,"precipitation":0},{"dt":1680027840,"precipitation":0},{"dt":1680027900,"precipitation":0},{"dt":1680027960,"precipitation":0},{"dt":1680028020,"precipitation":0},{"dt":1680028080,"precipitation":0},{"dt":1680028140,"precipitation":0},{"dt":1680028200,"precipitation":0},{"dt":1680028260,"precipitation":0},{"dt":1680028320,"precipitation":0},{"dt":1680028380,"precipitation":0},{"dt":1680028440,"precipitation":0},{"dt":1680028500,"precipitation":0},{"dt":1680028560,"precipitation":0},{"dt":1680028620,"precipitation":0}],"hourly":[{"dt":1680022800,"temp":292.22,"feels_like":291.2,"pressure":1025,"humidity":39,"dew_point":277.96,"uvi":6.95,"clouds":19,"visibility":10000,"wind_speed":6.5,"wind_deg":350,"wind_gust":8.01,"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02d"}],"pop":0},{"dt":1680026400,"temp":292.88,"feels_like":291.82,"pressure":1025,"humidity":35,"dew_point":277,"uvi":7.98,"clouds":0,"visibility":10000,"wind_speed":5.7,"wind_deg":354,"wind_gust":7.33,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"pop":0},{"dt":1680030000,"temp":292.49,"feels_like":291.42,"pressure":1025,"humidity":36,"dew_point":277.06,"uvi":7.98,"clouds":12,"visibility":10000,"wind_speed":5.68,"wind_deg":360,"wind_gust":7.03,"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02d"}],"pop":0},{"dt":1680033600,"temp":292.14,"feels_like":291.06,"pressure":1025,"humidity":37,"dew_point":277.14,"uvi":6.47,"clouds":18,"visibility":10000,"wind_speed":5.65,"wind_deg":1,"wind_gust":6.91,"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02d"}],"pop":0},{"dt":1680037200,"temp":291.66,"feels_like":290.56,"pressure":1024,"humidity":38,"dew_point":277.09,"uvi":4.28,"clouds":35,"visibility":10000,"wind_speed":5.26,"wind_deg":4,"wind_gust":6.74,"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"}],"pop":0},{"dt":1680040800,"temp":290.91,"feels_like":289.84,"pressure":1024,"humidity":42,"dew_point":277.84,"uvi":2.01,"clouds":55,"visibility":10000,"wind_speed":4.65,"wind_deg":8,"wind_gust":6.02,"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],"pop":0},{"dt":1680044400,"temp":289.18,"feels_like":288.14,"pressure":1024,"humidity":50,"dew_point":278.85,"uvi":0.69,"clouds":75,"visibility":10000,"wind_speed":4.11,"wind_deg":11,"wind_gust":6.6,"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],"pop":0},{"dt":1680048000,"temp":286.71,"feels_like":285.69,"pressure":1024,"humidity":60,"dew_point":279.11,"uvi":0.11,"clouds":79,"visibility":10000,"wind_speed":3.4,"wind_deg":15,"wind_gust":7.9,"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],"pop":0},{"dt":1680051600,"temp":284.47,"feels_like":283.33,"pressure":1025,"humidity":64,"dew_point":277.99,"uvi":0,"clouds":100,"visibility":10000,"wind_speed":2.93,"wind_deg":13,"wind_gust":7.4,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04n"}],"pop":0},{"dt":1680055200,"temp":283.44,"feels_like":282.3,"pressure":1025,"humidity":68,"dew_point":277.75,"uvi":0,"clouds":100,"visibility":10000,"wind_speed":2.99,"wind_deg":27,"wind_gust":8.61,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04n"}],"pop":0},{"dt":1680058800,"temp":282.67,"feels_like":281.21,"pressure":1025,"humidity":71,"dew_point":277.69,"uvi":0,"clouds":100,"visibility":10000,"wind_speed":2.79,"wind_deg":42,"wind_gust":8.6,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04n"}],"pop":0},{"dt":1680062400,"temp":282.31,"feels_like":280.75,"pressure":1025,"humidity":72,"dew_point":277.6,"uvi":0,"clouds":100,"visibility":10000,"wind_speed":2.84,"wind_deg":53,"wind_gust":8.92,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04n"}],"pop":0},{"dt":1680066000,"temp":281.86,"feels_like":280.5,"pressure":1025,"humidity":72,"dew_point":277.09,"uvi":0,"clouds":100,"visibility":10000,"wind_speed":2.42,"wind_deg":62,"wind_gust":6.91,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04n"}],"pop":0},{"dt":1680069600,"temp":281.07,"feels_like":279.46,"pressure":1025,"humidity":74,"dew_point":276.69,"uvi":0,"clouds":100,"visibility":10000,"wind_speed":2.56,"wind_deg":66,"wind_gust":7.2,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04n"}],"pop":0},{"dt":1680073200,"temp":280.52,"feels_like":278.84,"pressure":1025,"humidity":76,"dew_point":276.59,"uvi":0,"clouds":100,"visibility":10000,"wind_speed":2.52,"wind_deg":68,"wind_gust":7,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04n"}],"pop":0},{"dt":1680076800,"temp":279.86,"feels_like":278.14,"pressure":1025,"humidity":79,"dew_point":276.48,"uvi":0,"clouds":97,"visibility":10000,"wind_speed":2.42,"wind_deg":67,"wind_gust":5.71,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04n"}],"pop":0},{"dt":1680080400,"temp":279.27,"feels_like":277.3,"pressure":1025,"humidity":81,"dew_point":276.27,"uvi":0,"clouds":78,"visibility":10000,"wind_speed":2.6,"wind_deg":67,"wind_gust":6.2,"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04n"}],"pop":0},{"dt":1680084000,"temp":279.2,"feels_like":277.29,"pressure":1025,"humidity":81,"dew_point":276.31,"uvi":0,"clouds":83,"visibility":10000,"wind_speed":2.51,"wind_deg":69,"wind_gust":6.8,"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04n"}],"pop":0},{"dt":1680087600,"temp":278.84,"feels_like":276.85,"pressure":1025,"humidity":83,"dew_point":276.16,"uvi":0,"clouds":87,"visibility":10000,"wind_speed":2.52,"wind_deg":71,"wind_gust":6.2,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04n"}],"pop":0},{"dt":1680091200,"temp":278.47,"feels_like":276.4,"pressure":1026,"humidity":85,"dew_point":276.11,"uvi":0,"clouds":89,"visibility":10000,"wind_speed":2.54,"wind_deg":71,"wind_gust":6.51,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04n"}],"pop":0},{"dt":1680094800,"temp":279.3,"feels_like":277.36,"pressure":1026,"humidity":82,"dew_point":276.58,"uvi":0.28,"clouds":49,"visibility":10000,"wind_speed":2.56,"wind_deg":86,"wind_gust":7.12,"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"}],"pop":0},{"dt":1680098400,"temp":282.03,"feels_like":280.16,"pressure":1026,"humidity":71,"dew_point":277.06,"uvi":1.23,"clouds":34,"visibility":10000,"wind_speed":3.26,"wind_deg":100,"wind_gust":5.62,"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"}],"pop":0},{"dt":1680102000,"temp":284.37,"feels_like":283.17,"pressure":1026,"humidity":62,"dew_point":277.49,"uvi":2.97,"clouds":25,"visibility":10000,"wind_speed":3.2,"wind_deg":108,"wind_gust":4.61,"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"}],"pop":0},{"dt":1680105600,"temp":286.27,"feels_like":285.1,"pressure":1025,"humidity":56,"dew_point":277.85,"uvi":5.01,"clouds":40,"visibility":10000,"wind_speed":3.35,"wind_deg":108,"wind_gust":4.04,"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"}],"pop":0},{"dt":1680109200,"temp":287.55,"feels_like":286.43,"pressure":1025,"humidity":53,"dew_point":278.03,"uvi":6.95,"clouds":46,"visibility":10000,"wind_speed":2.94,"wind_deg":111,"wind_gust":3.42,"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"}],"pop":0},{"dt":1680112800,"temp":289.38,"feels_like":288.34,"pressure":1024,"humidity":49,"dew_point":278.62,"uvi":7.97,"clouds":46,"visibility":10000,"wind_speed":2.7,"wind_deg":118,"wind_gust":2.8,"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"}],"pop":0},{"dt":1680116400,"temp":290.56,"feels_like":289.56,"pressure":1023,"humidity":46,"dew_point":278.96,"uvi":8.18,"clouds":7,"visibility":10000,"wind_speed":2.58,"wind_deg":120,"wind_gust":2.82,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"pop":0},{"dt":1680120000,"temp":291.43,"feels_like":290.49,"pressure":1021,"humidity":45,"dew_point":279.2,"uvi":6.64,"clouds":6,"visibility":10000,"wind_speed":2.26,"wind_deg":111,"wind_gust":2.6,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"pop":0},{"dt":1680123600,"temp":291.93,"feels_like":291.01,"pressure":1021,"humidity":44,"dew_point":279.42,"uvi":4.4,"clouds":6,"visibility":10000,"wind_speed":2.04,"wind_deg":102,"wind_gust":2.42,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"pop":0},{"dt":1680127200,"temp":291.83,"feels_like":290.93,"pressure":1020,"humidity":45,"dew_point":279.59,"uvi":2.31,"clouds":5,"visibility":10000,"wind_speed":2.23,"wind_deg":103,"wind_gust":2.8,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"pop":0},{"dt":1680130800,"temp":291.33,"feels_like":290.59,"pressure":1020,"humidity":53,"dew_point":281.59,"uvi":0.79,"clouds":5,"visibility":10000,"wind_speed":2.44,"wind_deg":97,"wind_gust":3.41,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"pop":0},{"dt":1680134400,"temp":288.65,"feels_like":287.93,"pressure":1020,"humidity":64,"dew_point":281.87,"uvi":0.13,"clouds":6,"visibility":10000,"wind_speed":2.49,"wind_deg":86,"wind_gust":3.22,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"pop":0},{"dt":1680138000,"temp":286.22,"feels_like":285.25,"pressure":1020,"humidity":64,"dew_point":279.59,"uvi":0,"clouds":5,"visibility":10000,"wind_speed":2.34,"wind_deg":98,"wind_gust":2.31,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"pop":0},{"dt":1680141600,"temp":285.59,"feels_like":284.56,"pressure":1021,"humidity":64,"dew_point":278.99,"uvi":0,"clouds":3,"visibility":10000,"wind_speed":2.25,"wind_deg":119,"wind_gust":2.32,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"pop":0},{"dt":1680145200,"temp":285.05,"feels_like":283.99,"pressure":1021,"humidity":65,"dew_point":278.77,"uvi":0,"clouds":2,"visibility":10000,"wind_speed":2.39,"wind_deg":119,"wind_gust":2.41,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"pop":0},{"dt":1680148800,"temp":284.37,"feels_like":283.32,"pressure":1021,"humidity":68,"dew_point":278.71,"uvi":0,"clouds":1,"visibility":10000,"wind_speed":2.71,"wind_deg":112,"wind_gust":3.71,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"pop":0},{"dt":1680152400,"temp":283.62,"feels_like":282.6,"pressure":1021,"humidity":72,"dew_point":278.81,"uvi":0,"clouds":1,"visibility":10000,"wind_speed":2.67,"wind_deg":120,"wind_gust":5.21,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"pop":0},{"dt":1680156000,"temp":283.24,"feels_like":282.18,"pressure":1021,"humidity":72,"dew_point":278.51,"uvi":0,"clouds":5,"visibility":10000,"wind_speed":2.77,"wind_deg":131,"wind_gust":6.8,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"pop":0},{"dt":1680159600,"temp":282.95,"feels_like":281.54,"pressure":1021,"humidity":72,"dew_point":278.14,"uvi":0,"clouds":31,"visibility":10000,"wind_speed":2.8,"wind_deg":131,"wind_gust":8.31,"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03n"}],"pop":0},{"dt":1680163200,"temp":284.37,"feels_like":283.27,"pressure":1020,"humidity":66,"dew_point":278.17,"uvi":0,"clouds":62,"visibility":10000,"wind_speed":2.63,"wind_deg":127,"wind_gust":9.03,"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04n"}],"pop":0},{"dt":1680166800,"temp":284.67,"feels_like":283.55,"pressure":1020,"humidity":64,"dew_point":278.19,"uvi":0,"clouds":75,"visibility":10000,"wind_speed":2.74,"wind_deg":127,"wind_gust":8.81,"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04n"}],"pop":0},{"dt":1680170400,"temp":284.77,"feels_like":283.66,"pressure":1020,"humidity":64,"dew_point":278.29,"uvi":0,"clouds":81,"visibility":10000,"wind_speed":2.76,"wind_deg":128,"wind_gust":8.7,"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04n"}],"pop":0},{"dt":1680174000,"temp":284.77,"feels_like":283.68,"pressure":1020,"humidity":65,"dew_point":278.39,"uvi":0,"clouds":85,"visibility":10000,"wind_speed":2.78,"wind_deg":119,"wind_gust":7.81,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04n"}],"pop":0},{"dt":1680177600,"temp":284.8,"feels_like":283.72,"pressure":1020,"humidity":65,"dew_point":278.39,"uvi":0,"clouds":88,"visibility":10000,"wind_speed":2.99,"wind_deg":126,"wind_gust":8.35,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04n"}],"pop":0},{"dt":1680181200,"temp":284.8,"feels_like":283.8,"pressure":1021,"humidity":68,"dew_point":279.08,"uvi":0.24,"clouds":100,"visibility":10000,"wind_speed":2.63,"wind_deg":128,"wind_gust":7.82,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"pop":0},{"dt":1680184800,"temp":285.32,"feels_like":284.39,"pressure":1021,"humidity":69,"dew_point":279.89,"uvi":1.03,"clouds":100,"visibility":10000,"wind_speed":2.97,"wind_deg":119,"wind_gust":8.23,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"pop":0},{"dt":1680188400,"temp":285.47,"feels_like":284.59,"pressure":1021,"humidity":70,"dew_point":280.19,"uvi":2.49,"clouds":100,"visibility":10000,"wind_speed":2.66,"wind_deg":126,"wind_gust":7.82,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"pop":0},{"dt":1680192000,"temp":290.02,"feels_like":289.2,"pressure":1021,"humidity":55,"dew_point":280.89,"uvi":3.23,"clouds":100,"visibility":10000,"wind_speed":3.7,"wind_deg":145,"wind_gust":6.22,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"pop":0}],"daily":[{"dt":1680026400,"sunrise":1680005359,"sunset":1680049980,"moonrise":1680021960,"moonset":1679987220,"moon_phase":0.25,"temp":{"day":292.88,"min":282.31,"max":292.88,"night":282.31,"eve":286.71,"morn":285.54},"feels_like":{"day":291.82,"night":280.75,"eve":285.69,"morn":284.9},"pressure":1025,"humidity":35,"dew_point":277,"wind_speed":6.5,"wind_deg":350,"wind_gust":8.92,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"clouds":0,"pop":0,"uvi":7.98},{"dt":1680112800,"sunrise":1680091678,"sunset":1680136423,"moonrise":1680111600,"moonset":1680076800,"moon_phase":0.27,"temp":{"day":289.38,"min":278.47,"max":291.93,"night":284.37,"eve":288.65,"morn":278.47},"feels_like":{"day":288.34,"night":283.32,"eve":287.93,"morn":276.4},"pressure":1024,"humidity":49,"dew_point":278.62,"wind_speed":3.35,"wind_deg":108,"wind_gust":7.2,"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"}],"clouds":46,"pop":0,"uvi":8.18},{"dt":1680199200,"sunrise":1680177997,"sunset":1680222866,"moonrise":1680201420,"moonset":1680165960,"moon_phase":0.3,"temp":{"day":292.83,"min":282.95,"max":295.35,"night":291.34,"eve":292.03,"morn":284.8},"feels_like":{"day":292.24,"night":291.17,"eve":291.83,"morn":283.72},"pressure":1019,"humidity":53,"dew_point":282.93,"wind_speed":5.58,"wind_deg":147,"wind_gust":15,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"clouds":98,"pop":0.48,"uvi":5.98},{"dt":1680285600,"sunrise":1680264316,"sunset":1680309310,"moonrise":1680291300,"moonset":1680254760,"moon_phase":0.33,"temp":{"day":295.74,"min":287.02,"max":295.74,"night":287.02,"eve":292.47,"morn":292.7},"feels_like":{"day":296.2,"night":286.03,"eve":291.76,"morn":293.06},"pressure":1009,"humidity":82,"dew_point":292.61,"wind_speed":8.93,"wind_deg":204,"wind_gust":19.31,"weather":[{"id":501,"main":"Rain","description":"moderate rain","icon":"10d"}],"clouds":100,"pop":1,"rain":8.69,"uvi":3.12},{"dt":1680372000,"sunrise":1680350636,"sunset":1680395753,"moonrise":1680381180,"moonset":1680343260,"moon_phase":0.36,"temp":{"day":295.06,"min":283.03,"max":297.36,"night":290.36,"eve":292.55,"morn":283.03},"feels_like":{"day":294.3,"night":289.52,"eve":292.01,"morn":281.38},"pressure":1017,"humidity":38,"dew_point":280.31,"wind_speed":3.62,"wind_deg":216,"wind_gust":12.6,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"clouds":85,"pop":0,"uvi":4},{"dt":1680458400,"sunrise":1680436956,"sunset":1680482197,"moonrise":1680471060,"moonset":1680431520,"moon_phase":0.39,"temp":{"day":299.13,"min":284.27,"max":301.67,"night":293.66,"eve":297.07,"morn":284.27},"feels_like":{"day":299.13,"night":294.17,"eve":297.5,"morn":283.63},"pressure":1013,"humidity":59,"dew_point":290.5,"wind_speed":5.23,"wind_deg":212,"wind_gust":13.61,"weather":[{"id":501,"main":"Rain","description":"moderate rain","icon":"10d"}],"clouds":2,"pop":1,"rain":4.82,"uvi":4},{"dt":1680544800,"sunrise":1680523276,"sunset":1680568640,"moonrise":1680560940,"moonset":1680519540,"moon_phase":0.42,"temp":{"day":301.17,"min":290.92,"max":301.17,"night":294.74,"eve":296.38,"morn":291.99},"feels_like":{"day":302.74,"night":295.25,"eve":297.03,"morn":292.31},"pressure":1007,"humidity":61,"dew_point":292.89,"wind_speed":7.49,"wind_deg":220,"wind_gust":18,"weather":[{"id":501,"main":"Rain","description":"moderate rain","icon":"10d"}],"clouds":55,"pop":1,"rain":7,"uvi":4},{"dt":1680631200,"sunrise":1680609596,"sunset":1680655084,"moonrise":1680650760,"moonset":1680607440,"moon_phase":0.45,"temp":{"day":298.55,"min":281.08,"max":300.19,"night":281.08,"eve":290.79,"morn":293.41},"feels_like":{"day":299,"night":277.78,"eve":290.36,"morn":293.97},"pressure":1004,"humidity":71,"dew_point":292.89,"wind_speed":9.37,"wind_deg":330,"wind_gust":14.91,"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":100,"pop":1,"rain":0.76,"uvi":4}]}

billskeen68 commented 1 year ago

If you need any testing for OWM or Tomorrow.io, please let me know. I have keys for both.

SerBrynden commented 1 year ago

@n0bel I'm making the updates as well. ;-) I've already got Tomorrow.io v4 running and am working on splitting the OWM calls.

billskeen68 commented 1 year ago

I modified @SerBrynden's PiClock branch file PyQtPiClock.py as shown below, and it works.

def getwx_owm(): global wxurl global wxreply print("getting current and forecast: " + time.ctime()) wxurl = 'https://api.openweathermap.org/data/3.0/onecall?appid=' + ApiKeys.owmapi

Vindictor commented 1 year ago

@SerBrynden Thank you for the research. I'll work on PiClock to split up the calls. I don't like the age (sometimes 2-4 hours) of the 'current' (/weather) data provided by OWM anyway. Thats why I added the METAR option. So it'll be metar vs owm current, and then owm forcast

Not a quick and dirty fix, but not difficult either. Probably a whole bunch of lines will change however.

I want to get this done for those hitting the March 31 deadline, and have OWM working. I guess I'll deal with tomorrowio v4 as well.

@n0bel , If there's one good thing for me that's come out of the past few days of troubleshooting, it's learning about METAR. Previously I was quite happy with DarkSky, running for however many years I've been using it after the weather service before that went offline, and I haven't changed anything since. Then a few days ago DarkSky stopped working, so I looked into fixes and found the METAR thing. Actually @n0bel had mentioned it to me in a post in this very thread two years ago, and I just replied that there are no airports near me. Well, since DarkSky went offline I had a think and realised there's a military base not so far away, so I found the code for that, nano'd the Config.py, and boom, localised current weather, seemingly updated every 60 min or so. So I'm loving the METAR and I'll continue using that from now on, all I'm missing is the weekly forecast. I'm still seeing rainviewer clouds passing over my location... I love PiClock. Everyone who sees mine thinks it's great (or some girls are amused at ANOTHER screen in my living room - one commented that it looks like NASA in here ;)) But anyway, looking forward to getting it all running again. One small issue I mentioned previously, maybe I can fix it in the Config (?) is that now we're on Summer Time, my Sunrise and Sunset are an hour out. This has happened each year and I've just ignored it, but while I'm posting... if anyone knows why? :)

I also mentioned that the @SerBrynden fork just crashed to desktop for me after a new install (and owmapi key issue) but in the split second that the clock was visible, it did look as though the sunrise and sunset times were correct in that version. it's probably just a case of tweaking a value in the Config? Great work, thank you. Have a good evening / rest of the day, depending on where you are.

billskeen68 commented 1 year ago

DarkSky 20230328_133047

OWM 20230328_133016

Vindictor commented 1 year ago

Cool.
Weird how DarkSky just suddenly stopped working for me a few days ago, along with other people who've posted here. That's what got me posting here again in the first place, to get an alternative working.
I need to stop, now... but it's looking hopeful that I should be up and running again, soon. If there's going to be a choice between openweathermap and climacell both working, then I'll have to find out which is best / most accurate. All the best.

EDIT: and I'd have been happy to pay a fair fee to keep using DarkSky per year! (NB, NOT $99!) ;) well, maybe openweathermap or climacell will end up being better.... and hopefully last for many years to come!

n0bel commented 1 year ago

@billskeen68 Welllllllll is it cloudy or clear?? And...... are you expecting rain on Sunday 93% or 46%...

I've always found DarkSky to be accurate, and OWM to be less than accurate. I don't really like the forecast from OWM nor Climacell (tomorrow io).

Actually I liked weather underground too as well.

DarkSky 20230328_133047

OWM 20230328_133016

billskeen68 commented 1 year ago

@n0bel Yes, that was why I posted the pictures to show the small differences. I've seen that happen on various iPhone and Android apps as well. No telling whose data they are using. I also get notifications from Amazon Alexa and watch several different weather channels on TV and YouTube. I can't recall seeing any of them agree on the forecasts. lol

Vindictor commented 1 year ago

@billskeen68 Welllllllll is it cloudy or clear?? And...... are you expecting rain on Sunday 93% or 46%...

I've always found DarkSky to be accurate, and OWM to be less than accurate. I don't really like the forecast from OWM nor Climacell (tomorrow io).

Actually I liked weather underground too as well.

Ah yes, Weather Underground, that was the previous one. A shame if the two current options aren’t as accurate, of course. I was also happy with Dark Sky. Oh well. The main thing for me, at the moment, was to have something, any forecast in those right hand side orange boxes, and after that worry about accuracy. If both openweathermap and climacell will work, then it’ll be a matter of flipping between them, and comparing what they say to the actual weather.

@billskeen68 Haha, yes… I generally check my PiClock first when I’m at home, then I might check the weather app on my phone, and then maybe ask Alexa. They can vary wildly! Oh well. The PiClock is still cool. To be honest the accuracy of the forecast is probably the least important part. I REALLY make use of the rainviewer window. I can see rain heading my way and be able to judge when it’ll hit, or wait and have an idea when it will pass over. It’s been invaluable over the years. Often I’ll have on the TV and the weather will come on, and I’ll see the same rain clouds in their satellite image as I have on my PiClock. I find using the rainviewer windows to be more accurate than other forecasts. Should I hang the washing out? TV forecast says it’ll be clear but.. I can see a blue/orange blob heading my way so maybe I’ll wait. The current weather, and of course the time are also important…. And I do appreciate, and use, the forecast on the right of the screen…. It’s still important, but not quite as much as the rest. It does look sad with all those empty, orange boxes, though! :’( ;) Will check back tomorrow (UK time) and see how things are progressing. Maybe I’ll be able to pull some gits, and update some py’s. I think I can now type nano ApiKeys.py and nano Config.py with just my mind!

SerBrynden commented 1 year ago

@n0bel If you haven’t found out already, since the OWM 2.5 API only offers forecast data in 3hr increments, we can only get the max/min temperature for each of those 3hr periods. There is no way to get the daily max/min temperature unless we put all the 3hr temps in a list for each day and extract the max/min… or make everyone subscribe to the One Call by Call 3.0 API and warn them not to go over the limit.

xxxDrewedxxx commented 1 year ago

Has anyone else noticed that open weather seems drunk on weather more than a couple of days out? Mine is suggesting that I’’m going to have 15+ inches of rain on Friday. I live in Wisconsin…. Lol

SerBrynden commented 1 year ago

@xxxDrewedxxx That's probably due to a unit conversion error in PiClock that I just noticed. It'll be fixed.

SerBrynden commented 1 year ago

@n0bel One more thing to consider... I just noticed that if you do subscribe to the OWM One Call by Call 3.0 API, you can manually set the limit so you do not get charged for overages. Once you subscribe to this plan, 2,000 API calls per day are set up by default, but the free limit per day is 1,000 calls. If you want to change this limit, please go to the "Billing plans" tab in your Personal account to update standard settings. Please see the screen below:

image

SerBrynden commented 1 year ago

I took the easy route and updated my PiClock with the OWM 3.0 API, so you'll have to subscribe to that plan. You can also use Tomorrow.io. All documentation and everything else has been updated. Get it here: https://github.com/SerBrynden/PiClock

Excerpt from new install instructions:

An OpenWeather One Call API 3.0 key is required to use OpenWeather data. (Requires credit card which won't be charged unless usage is high.)

OpenWeather One Call API 3.0 keys are created by signing up at this link: https://home.openweathermap.org/subscriptions/unauth_subscribe/onecall_30/base

Once you subscribe to the One Call API 3.0 plan, the default call limit is set to 2,000 API calls per day, however only the first 1,000 calls are free, which you should not exceed under typical PiClock operation. After the daily limit is reached, the overage charge is $0.15 per 100 calls. To be safe, it is recommended you change the daily limit by going to the "Billing plans" tab in your OpenWeather Personal account, and change the standard "Calls per day (no more than)" setting to 1,000 calls.

There is also a pull request here for the n0bel:Python3-SerBrynden branch to update that as well: #246.

billskeen68 commented 1 year ago

@SerBrynden Curious as to how many the API calls the PiClock normally makes in a 24 period. I have 3 of them running under the same account.

SerBrynden commented 1 year ago

@SerBrynden Curious as to how many the API calls the PiClock normally makes in a 24 period. I have 3 of them running under the same account.

That's simple. In the Config.py file, there is a weather_refresh parameter. The default is 30 minutes. So 48 API calls per day, per PiClock.

n0bel commented 1 year ago

Updated Open Weather Map code: either new api keys, that don't support 'onecall' or old api keys will work. Only new api keys are issued by them at this time. This required changes to PiClock to use 2 api calls 'weather' and 'forecast' In addition 'forecast' has no 'daily' format, so the hourly format is used to synthesize a daily forecast. Most of the changes were done on this commit: https://github.com/n0bel/PiClock/commit/1a1b399c52863caeb95aef3ad98b0736cb7a7fc7 This thread has all the discussions about OWM new/old api keys which caused the last minute changes.

Vindictor commented 1 year ago

Updated Open Weather Map code: either new api keys, that don't support 'onecall' or old api keys will work. Only new api keys are issued by them at this time. This required changes to PiClock to use 2 api calls 'weather' and 'forecast' In addition 'forecast' has no 'daily' format, so the hourly format is used to synthesize a daily forecast. Most of the changes were done on this commit: 1a1b399 This thread has all the discussions about OWM new/old api keys which caused the last minute changes.

I have just updated my original PiClock, for that's the SD card that happened to be in my Pi at the moment. I edited my ApiKeys.py to use the OWM key that I obtained earlier in the week that hasn't worked until now (not a OneCall 3.0 key) rebooted and.... forecast data is displayed!! :) Oh, thank you. While people are reading.... I have noticed that because the font of the 3 hourly forecast is larger than the font used in the other forecast data, the weather info is overwriting the day/time. [EDIT: as you can see at the top right of the attached photo, below] Likewise, we're at the end of a storm right now, and so the wind data doesn't fit on the screen. [on the left] This is running on an old 24" 1080p display, mounted high up on the wall. Current data provided by local METAR. These are just tiny niggles that I thought I'd point out, but mainly I'm delighted to have forecast data back. I've commented out the Climacell key, but will swap between them now and then to compare results.

Finally, as I mentioned in a previous post, the sunrise and sunset info is incorrect now that we're on Summer Time. I've had this issue for some years.... during the winter the times are correct, but during summer they're an hour out. Sunrise is actually 7am at the moment, and sunset is more like 7pm right now. Is there a setting I can tweak for this?

Thanks so much for the time and effort, to all involved. Hugely appreciated. Thank you.

PiClock

SerBrynden commented 1 year ago

@Vindictor I too had that problem with the font size and it was one of the many tweaks I made years ago in https://github.com/SerBrynden/PiClock.

Regarding the sun rise/set times, I think we did have a bug in the PiClock code that caused it to not account for daylight saving time in the summer, but I thought we fixed that awhile ago. I'll take a look again, but in the mean time, make sure the time in your Raspberry Pi operating system is set to the correct timezone. Menu -> Preferences -> Raspberry Pi Configuration -> Localisation

n0bel commented 1 year ago

Tomorrow.io support updated. https://github.com/n0bel/PiClock/commit/f6f7661171cbf7660de6362d46d94fe5c700d78f I stole almost all the code from @SerBrynden It came from the SerBryden python3 branch, and of course their own repository https://github.com/SerBrynden/PiClock.

SerBrynden commented 1 year ago

There was a sunrise/sunset time issue (https://github.com/n0bel/PiClock/issues/218#issuecomment-871888238) with a fix but it was closed by the OP author before any fix was implemented in the master branch. There is now a pull rquest #248 for the fix.

n0bel commented 1 year ago

@SerBrynden https://github.com/n0bel/PiClock/pull/248 merged and tested

feh123 commented 1 year ago

This is brilliant. Thanks a lot to everyone for all the upgrades. Just to check what I need to do now - I have been using the @SerBrynden fork. Should I clone that or @n0bel 's? It's great to have my PiClock working!

Vindictor commented 1 year ago

Damn, now even my Sun Rise and Sun Set times are correct. Thank you so very much, and may I wish all involved a great weekend.

SerBrynden commented 1 year ago

@feh123 go with n0bel's PiClock in his master branch if you want the Python2 version. It should work with the legacy OWM 2.5 API calls (if you have an older OWM account), the newer OWM 2.5 API calls (if you have a newer OWM account... don't ask me when that change occured), and the Tomorrow.io API calls.

If you want the Python3 version, go with the SerBrynden version. But, it only works with the OWM One Call 3.0 API, for now (which is also free but requires extra steps found in the install instructions), and the Tomorrow.io API calls.

feh123 commented 1 year ago

Hi @SerBrynden I went with your version as I have the OWM 3.0 API. So I git cloned your code and installed that. However I have always used my own Config.py (and image folder) because I have my own clock face, colours and fonts. Before I did not try to add your black maps. However I like the idea of the dark maps so I added your code: map_base = 'bcurley/cj712peyz0bwr2sqfndbggupb' and map_overlay = 'bcurley/cj712r01c0bw62rm9isme3j8c' to my Config.py just below the metric or analog clock line. I have done nothing else but this gives an error and I see my normal maps. So I am missing something! PiClock is working so I was just wondering if it's obvious what I am missing - no problem if it's not simple, I will go with what I have. Thanks!

SerBrynden commented 1 year ago

Hi @SerBrynden I went with your version as I have the OWM 3.0 API. So I git cloned your code and installed that. However I have always used my own Config.py (and image folder) because I have my own clock face, colours and fonts. Before I did not try to add your black maps. However I like the idea of the dark maps so I added your code: map_base = 'bcurley/cj712peyz0bwr2sqfndbggupb' and map_overlay = 'bcurley/cj712r01c0bw62rm9isme3j8c' to my Config.py just below the metric or analog clock line. I have done nothing else but this gives an error and I see my normal maps. So I am missing something! PiClock is working so I was just wondering if it's obvious what I am missing - no problem if it's not simple, I will go with what I have. Thanks!

@feh123 What are the error messages in the log? What were your "normal maps"? Google Maps? Basic Mapbox street maps? Were you using my version before, or did you just recently switch over from n0bel's? There are probably other settings in the config that need to be copied over.

GrampDamnpus commented 1 year ago

I hate to be that guy, but here goes. Is there a clear step guide for morons that havent updated or touched their clock in years that woke up this AM and lost all forecast information?

n0bel commented 1 year ago

@GrampDamnpus You could try this: https://github.com/n0bel/PiClock/blob/master/Documentation/Install-Jessie.md#updating-to-newerupdated-versions

In addition if you wanted to start from scratch, start at the top of that document. Note that it is referring to an older version of PiOS (Raspbian) and includes instructions how to download that.

feh123 commented 1 year ago

@SerBrynden I logged the startup and the error message I briefly saw on my screen and thought was an error related to dark maps was in fact just telling me that the METAR config was not present. I am using mapbox maps. I have used your version so some time now but I always added back my config.py file to get my clock face. I tried taking your Config.py and adding my values. That works in that I get radar and forecast but the clock is a mix of my design and your design! So somewhere there is a link in the code to other files. It does not look easy to fix. If you have any ideas I am happy to try them but I am happy to live with what I have! Thanks!

SerBrynden commented 1 year ago

@SerBrynden I logged the startup and the error message I briefly saw on my screen and thought was an error related to dark maps was in fact just telling me that the METAR config was not present. I am using mapbox maps. I have used your version so some time now but I always added back my config.py file to get my clock face. I tried taking your Config.py and adding my values. That works in that I get radar and forecast but the clock is a mix of my design and your design! So somewhere there is a link in the code to other files. It does not look easy to fix. If you have any ideas I am happy to try them but I am happy to live with what I have! Thanks!

@feh123 And you commented out any previous map_base and map_overlay settings in your config? Also, make sure there are 'basemap': map_base, and 'overlay': map_overlay, settings in each of the radar sections near the bottom of the config.