CQC Community Support Forum
OpenWeatherMap JSON Weather Driver (Old Fields) - Printable Version

+- CQC Community Support Forum (https://cqccommunity.com)
+-- Forum: Community General Discussion (https://cqccommunity.com/forumdisplay.php?fid=1)
+--- Forum: Driver Development (https://cqccommunity.com/forumdisplay.php?fid=4)
+--- Thread: OpenWeatherMap JSON Weather Driver (Old Fields) (/showthread.php?tid=8)



OpenWeatherMap JSON Weather Driver (Old Fields) - kblagron - 01-18-2024

OpenWeatherMap.org released an API (named OneCall) that provides current weather information based on your lat/long along with 8 days of forecast data in JSON format.  It allows 1000 calls per day to the free account that you will have to set up on their website (which is the same API key that the shipped OWM driver used).

This version is backward compatible with the old Weather, Weather Underground, and DarkSky driver fields, but their is another version is available that is V2 compatible.  This version has many additional fields and weather alerts, so unless you are just stuck on the V2 functionality, this driver would be the one to use.

Edit:  I updated the files below to V0.52.  This will now support OpenWeatherMap 3.0 API, which will require you to sign up for that API on the website and add a credit card.  The first 1000 API calls per day are free.


.cqcdrvpack   OpenWeatherMapJSON1.0 V0.52.CQCDrvPack (Size: 15.65 KB / Downloads: 1)
.html   OWM-JSON1.0 V0.52 Documentation.html (Size: 26.76 KB / Downloads: 0)


RE: OpenWeatherMap JSON Weather Driver (Old Fields) - kfly - 08-23-2024

Looks like like my OpenWeather requests stopped working. I am getting a 401 returned on the request.
(OpenWeatherMapJSON10) driver

Fingers crossed its just updating the url in the driver to 3.0 from 2.5 and releasing a new driver.
http://api.openweathermap.org/data/2.5/onecall
Returns HTTP error 401

http://api.openweathermap.org/data/3.0/onecall
Works

Thx
K

------------------------------
Dear OpenWeather client,

We would like to inform you that we started One Call 2.5 depreciation, and your access to the product will be stopped on August, 19, 2024.


RE: OpenWeatherMap JSON Weather Driver (Old Fields) - kblagron - 08-26-2024

I noticed mine not working for a few hours probably around that time, but mine seems to working fine since then.


RE: OpenWeatherMap JSON Weather Driver (Old Fields) - kfly - 08-26-2024

(08-26-2024, 06:11 AM)kblagron Wrote: I noticed mine not working for a few hours probably around that time, but mine seems to working fine since then.

OK waited a few days and mine is still returning 401.  But works with the 3.0 URL modification.(below)
Looks like on the openweathermap account you can have a legacy 2.5 or 3.0 One Call API   Free data subscription. (for now).
Appears they have just disabled any 3.0 subscriptions from calling the 2.5 URL. 
Seems they are baby stepping this transition to 3.0 Smile.

Guess the CQC community will only have issues if they finally sunset 2.5 for everyone. Or if they are a new user since you cannot sign up for a 2.5 openweathermap API subscription anymore.

I am ok with using my one off 3.0 URL patch for now. no issues so far.

-----------------------------
// Make an http call to get a JSON stream of the latest data
            DoGET("http://api.openweathermap.org/data/3.0/onecall");


RE: OpenWeatherMap JSON Weather Driver (Old Fields) - kblagron - 08-27-2024

So did you have to log into the OWM website to enable the 3.0 subscription? Or did your old subscription now work for 3.0? I can update the driver to 3.0 pretty easily (as you did).


RE: OpenWeatherMap JSON Weather Driver (Old Fields) - kfly - 08-27-2024

(08-27-2024, 02:52 AM)kblagron Wrote: So did you have to log into the OWM website to enable the 3.0 subscription?  Or did your old subscription now work for 3.0?  I can update the driver to 3.0 pretty easily (as you did).

Yes last year  I started using Home Assistant for zwave/zigbee, I changed to a 3.0 subscription.  I didn't need to change anything on CQC as it used the same API key. I think I only had to put a credit card on file if I go over 1,000 api calls a day. With CQC and HA both polling( every 15 minutes I believe),  I only use 200 a day so should always be free. Seems having to enter a credit card for free service is an effective Bot filter. Bots don't have good credit Smile.


RE: OpenWeatherMap JSON Weather Driver (Old Fields) - Shaky - 09-30-2024

Mine stopped working now since Sept. 23rd. Searching my inbox and found an email that I must have missed: "We would like to inform you that we started One Call 2.5 deprecation, and your access to the product will be stopped on September 23, 2024. "

Looks like just a simple edit as suggested above to the URL (changing 2.5 to 3.0) in the driver around line 938 did the trick. Back up and running here now.


RE: OpenWeatherMap JSON Weather Driver (Old Fields) - kblagron - 10-30-2024

Mine stopped today, and finally got around to updating the driver. I have updated the link in the first post to cover the required change needed.


RE: OpenWeatherMap JSON Weather Driver (Old Fields) - kfly - 10-30-2024

(10-30-2024, 06:27 AM)kblagron Wrote: Mine stopped today, and finally got around to updating the driver.  I have updated the link in the first post to cover the required change needed.

Just upgraded to your new version and it is work great. Thanks again.