openhab-addons icon indicating copy to clipboard operation
openhab-addons copied to clipboard

[openweathermap] One Call API 2.5 to be discontinued June 2024

Open holgerfriedrich opened this issue 2 years ago • 8 comments

OpenWeather announced to shut down the One Call 2.5 API in June 2024

You can find the announcement and migration guide to the current One Call API 3.0 here: https://openweathermap.org/one-call-transfer

I cannot judge how much of the functionality of the binding will be affected. Just briefly looking at the code I see a lot of "2.5" in the query strings 🙈

Ping @cweitkamp, maybe you can give some advice on this.

holgerfriedrich avatar Apr 19 '24 18:04 holgerfriedrich

Read the Docs:

https://github.com/openhab/openhab-addons/blob/342b7b83f9df9d5fd14a3fdd7d34bed33eb97cee/bundles/org.openhab.binding.openweathermap/README.md?plain=1#L33

There is also a link to the FAQ of openweather. When you subsribe, you can set a limit in your OpenWeather account to prevent costs.

bohni avatar Apr 19 '24 19:04 bohni

Thanks, @bohni

So it seems that openweathermap:onecall* things will work after reconfiguration (i.e. subscription needs to be changed, new API key for 3.0 to be installed, API version to be set to 3.0).

Maybe one possible task is to extend documentation:

  • Describe how to do a migration of existing installations (configured with API 2.5, old api keys). ✔️ done, #16705
  • Maybe we should notify via update.lst as well. ✔️ openhab/openhab-distro#1651
  • Example config (textual) does not include apiversion, maybe we should add it or change the default to 3.0 for the next release (not specifying in the text config is fall back to default 2.5). ✔️ there for 4.2 docs, not for 4.1 openhab/openhab-docs#2291

Can we assume that other APIs like the air pollution API, which states version 2.5 as well, are not affected by the shutdown?

holgerfriedrich avatar Apr 19 '24 20:04 holgerfriedrich

.e. subscription needs to be changed, new API key for 3.0 to be installed, API version to be set to 3.0

I just made the move and I did not need to generate a new API key. All I had to do was toggle to the 3.0 setting in the account Thing.

I think though that a slight change need to be made to the add-on to no longer default to 2.5 but to default to 3.0. And of course after June when the 2.5 is shut down, all references to 2.5 removed, at least in the parts exposed to end users.

rkoshak avatar Apr 26 '24 13:04 rkoshak

How do you do this when the THING is file based, what is the parameter to pass into it for v3?

--> All I had to do was toggle to the 3.0 setting in the account Thing. <--

Best, Jay

jaywiseman1971 avatar Apr 26 '24 14:04 jaywiseman1971

Community thread started here: https://community.openhab.org/t/open-weather-map-owm-api-2-5-closing-switch-to-3-0-api/155591

rkoshak avatar Apr 26 '24 15:04 rkoshak

@jaywiseman1971, in short: Add , apiVersion="3.0" to the text config (right after apiKey="xxx"). Check the item in the UI. It will show a login error, if you did not activate API 3.0 on https://home.openweathermap.org/subscriptions yet. You will need paid API 3.0 subscription, which comes with a number of free calls per day (currently 1000). Set limits, see FAQ entry "I'm worried that I might accidentally make too many calls and be charged for them. How can I limit API calls?". Check openhab again and see if Thing is online.

holgerfriedrich avatar Apr 26 '24 15:04 holgerfriedrich

@holgerfriedrich , thank you and it worked perfectly! Already had the 3.0 subscription at the account level so it was just adding that parameter.

jaywiseman1971 avatar Apr 26 '24 15:04 jaywiseman1971

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/open-weather-map-owm-api-2-5-closing-switch-to-3-0-api/155591/4

openhab-bot avatar Apr 26 '24 23:04 openhab-bot

@holgerfriedrich I have created #16705 to update the docs and the default API version. The other OpenWeatherMa APIs remain unchanged, therefore the other Things continue to work.

However do I feel that OneCall is the future API for OpenWeatherMap, so for new users, I recommend to use the OneCall Thing and not the hourly or daily forecast Things.

florian-h05 avatar Apr 29 '24 22:04 florian-h05

@florian-h05 should we also change the docs in the 4.1.x repo? Same disclaimer, and extending the onecall example by apiVersion="3.0"? This is the only open point in my comment above https://github.com/openhab/openhab-addons/issues/16665#issuecomment-2067258715

holgerfriedrich avatar Apr 30 '24 16:04 holgerfriedrich

Good idea 👍

https://github.com/openhab/openhab-docs/blob/final-stable/_addons_bindings/openweathermap/readme.md needs to be modified for this. Afterwards either Netlify automatically redeploys the website or I will trigger this manually (I have access to Netlify).

I’m out for today, so if you want you can open a PR to this file on the final-stable branch, just ping me so I know when it’s merged.

florian-h05 avatar Apr 30 '24 16:04 florian-h05

Set limits, see FAQ entry "I'm worried that I might accidentally make too many calls and be charged for them. How can I limit API calls?". Check openhab again and see if Thing is online.

I can't find this FAQ on the OWM website, and I can't figure out where to set the limit. Can anyone point me in the right direction? I just subscribed to 3.0.

Edit: never mind. See this post: https://community.openhab.org/t/open-weather-map-owm-api-2-5-closing-switch-to-3-0-api/155591/3

dathbe avatar May 28 '24 20:05 dathbe

euh.... first hit on google: https://openweathermap.org/faq

lsiepel avatar May 28 '24 20:05 lsiepel