ebaauw / homebridge-ws

Homebridege plugin for virtual weather station
Apache License 2.0
106 stars 4 forks source link

Invalid API key #49

Closed Lennylennrich closed 1 year ago

Lennylennrich commented 1 year ago

Hello, I got a OWM account with a free subscription. And I got an API key. But everytime IO use it, I get an error that the key is invalid. Can anybody help me with that?

openweathermap request 1: GET 2.5/weather?q=Umkirch, De [12/10/2022, 09:34:16] [Wetter] warning: openweathermap request 1: openweathermap status: 401 Invalid API key. Please see https://openweathermap.org/faq#error401 for more info. [12/10/2022, 09:34:16] [Wetter] warning: Umkirch, De: ignore unknown location [12/10/2022, 09:34:16] [Wetter] openweathermap request 2: GET 2.5/weather?id=2820190 [12/10/2022, 09:34:16] [Wetter] warning: openweathermap request 2: openweathermap status: 401 Invalid API key. Please see https://openweathermap.org/faq#error401 for more info. [12/10/2022, 09:34:16] [Wetter] warning: 2820190: ignore unknown city id

Thank you :)

Stradivyrus commented 1 year ago

This is a tough one. Long story short, it's because "new" API keys generated recently (seems to be after August 2022) can only access the /data/3.0/ endpoint.

What that means is that new API keys will not work with this plugin, but all hope is not lost. Follow these steps:-

1) Subscribe for "One Call by Call" subscription plan here 2) Set daily limit to 1,000 (the first 1,000 calls per day are free) 3) No, you will not be billed at this juncture (or theoretically ever, if your daily limit is set to 1,000) 4) Your previously generated "new" API key should now work

Refer to this thread for more information

ebaauw commented 1 year ago

Last time I checked, the weather endpoint still works with a new Free plan API key. You’ll still need a One Call per Call plan API key for the onecall endpoint, but best double-check that you entered the key correctly in config.json (or through the Homebridge UI).

Stradivyrus commented 1 year ago

My new Free plan API key initially did not work until I subscribed for the One Call per Call plan. I suspect we are talking about the same thing but in different ways (likely due to my layman perspective on such technical matters)

The plugin works wonderfully by the way, amazing work!