naofireblade / homebridge-weather-plus

A comprehensive weather plugin for homebridge.
MIT License
311 stars 61 forks source link

v3.2.7 / Openweather map produces 401 #253

Closed bondskin closed 1 year ago

bondskin commented 1 year ago

Hi.

After upgrading HB weather, I get the following error message.

My API key is active.

[28/12/2022, 13:14:13] [WeatherPlus] Error retrieving weather report [28/12/2022, 13:14:13] [WeatherPlus] undefined [28/12/2022, 13:14:13] [WeatherPlus] { cod: 401, message: 'Please note that using One Call 3.0 requires a separate subscription to the One Call by Call plan. Learn more here https://openweathermap.org/price. If you have a valid subscription to the One Call by Call plan, but still receive this error, then please see https://openweathermap.org/faq#error401 for more info.' }

{ "nameNow": "Balkon OpenWeather", "service": "openweathermap", "key": "251a89c82e0a50f6139eXXXXX", "locationGeo": [ 53.x, 10.x ], "language": "de", "compatibility": "both", "conditionCategory": "simple", "now": true, "extraHumidity": true }

matbe81 commented 1 year ago

Same error since updating the plugin. Is the error related to the plugin update or because OpenWeather updated their products price plan?

naofireblade commented 1 year ago

I switched to the new OpenWeatherMap API 3.0, I'm working on a fix to support the old and new version.

matbe81 commented 1 year ago

Can you confirm:

Thank you

palasinio commented 1 year ago

Can you confirm:

  • the "new" version is now a paid one?
  • the "old" version will continue to co-exist free of charge?

Thank you

In the API 3.0 „One Call“ Plan the there are still 1000 calls/month free. You have to add pay information, but can limit the use to 1000 calls.

matbe81 commented 1 year ago

Thanks. Prefer to avoid having to give pay information if not willing to pay for. I also don't think it's GDPR compliant. So thanks to @naofireblade in advance to implement the old API back :)

naofireblade commented 1 year ago

I looked into this. OpenWeather restricted the old free API in some points (no uv-index, no dew-point, no sunrise-time, no sunset-time). Most notably the daily forecast is not available any longer, only a 3hr forecast over the next 5 days. I will try to make some calculations to get useful daily forecasts.

naofireblade commented 1 year ago

Done, v3.2.8 with automatic support for legacy api is released.

matbe81 commented 1 year ago

Thank you!

Should something special should be made in the configuration to make it work back free?

naofireblade commented 1 year ago

No, just restart homebridge. The plug-in will try api 3.0 and if it doesn’t succeed it will use api 2.5 (old one)

matbe81 commented 1 year ago

Great. Thanks. Could be nice for some people to have the 2 version of the api in the provider list for forcing using a specific api.