home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.41k stars 29.9k forks source link

Invalid API Key provided #82863

Closed madchap closed 6 months ago

madchap commented 1 year ago

The problem

Hi,

image

The API key works with curl. I also generated a 2nd one, same problem.

At first, the default when setting up the integration was not onecall_daily but hourly. The very first time, I think the integration worked as sensors were created (but didn't get data). I then realized I could not change the integration's configuration, so deleted it and now I am faced with that problem.

What version of Home Assistant Core has the issue?

2022.11.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

openweathermap

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No, but on the openweathermap website, nothing is shown as "blocked".

Additional information

No response

toadkicker commented 1 year ago

I experienced a similar issue but worked around it doing these steps:

home-assistant[bot] commented 1 year ago

Hey there @fabaff, @freekode, @nzapponi, mind taking a look at this issue as it has been labeled with an integration (openweathermap) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `openweathermap` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Change the title of the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign openweathermap` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


openweathermap documentation openweathermap source (message by IssueLinks)

madchap commented 1 year ago

Thanks @toadkicker - I tried your steps, but I still have the problem.

BKneer commented 1 year ago

I had the same problem with the message "wrong API key...". It looks to me that the daily feature is no longer free on weatherman.org. Changing the configuration to hourly I get at least this configuration up and running again. For the daily configuration you have to have the Startup subscription on opernweathermap.org

bkbilly commented 1 year ago

I had the same issue, but with Home Assistant Core and this fixed the problem:

sudo pip3.9 install pyowm
NeoFax75 commented 1 year ago
sudo pip3.9 install pyowm

I am using HASS OS and this does not work as pip3.9 is not installed. The only thing that works is hourly calls.

ghostly commented 1 year ago

Having the same issue on HA OS fully up to date at this time. None of the 4 available options are working. Will look for a new Weather service.

mariusnop commented 1 year ago

I have the same problem.

History: I click under >Settings< on >Devices & Services< and then on the button at the bottom right >ADD INTEGRATION<. As brand name I choose >OpenWeatherMap< and enter there all information incl. API Key.

As answer I get >Invalid API key<.

I called the API without the APP and got a 200 as answer.

log 2023-01-22 09:28:55.639 ERROR (MainThread) [frontend.js.latest.202301100] :0:0 ResizeObserver loop completed with undelivered notifications.

Home Assistant 2023.1.6 Supervisor 2022.12.1 Operating System 9.4 Frontend 20230110.0 - latest

greetings Marius

Berondal commented 1 year ago

same at me ... >>The only thing that works is hourly calls.

risiko79 commented 1 year ago

Same - only hourly calls is working

sealbro commented 1 year ago

Yep, same problem

image
OH010 commented 1 year ago

Same problem here, none of the options work. Signed up for the new (?) One Call API 3.0 that should give all hourly, daily etc. in one API call and includes 1000 calls per day. Is this integration not supported in HAOS?

andreid1303 commented 1 year ago

I was using OWM integration with FREE account for a year but now it constantly returned API call error. I checked with curl that only calls https://api.openweathermap.org/data/2.5/weather and https://api.openweathermap.org/data/2.5/forecast returns data with API key I am using. That is accordance with FREE plan. The calls like https://api.openweathermap.org/data/2.5/forecast/daily and https://api.openweathermap.org/data/2.5/forecast/hourly return {"cod":"404","message":"Internal error"}

I do not understand what calls HA integration is using. For me any mode is not working.

Gyosa3 commented 1 year ago

Hi, I subscribed recently to OWM and didn't know which option to choose, got the same errors at the beginning by trying all options. On the OWM website I could find that the free API key only allows the "hourly" call, which actually is a 3h period granularity. image

So selecting "hourly" works, but the other 3 options require a subscription to the OWM service as it seems.

I am therefore interested to have an option in the integration to retrieve the data on a 3h interval basis, but have a subsequent option to either process the data "as is" or aggregate it into a 24h dataset instead (calculated, so probably not as accurate as a "real" 24h dataset that you would retrieve from OWM).

My use case for example would be to know how much it would rain "tomorrow", so I could just use the sensor "Forecast Precipitation" and I would get a 24h value instead of the 3h value I have now, which doesn't help me much for what I want to do (deciding to water the garden or not).

I do it at the moment with NodeRed outside of the integration, by a direct query to OWM with my API key and it works, the raw data is there. But my script does not send back the calculated data to the Weather entity so I cannot use weather cards to display the aggregated data. I have to create my own parallel weather entity, so at the end I +/- have to rewrite the integration, so it's too complex.

Edit: actually, it's now mentioned in the integration page image

Flameancer commented 1 year ago

This appears to still not be working. New HA setup and I already had an account with openweather. Attempted to use an already working API that's currently used with a streamdeck action and that was invalid. I created a new key just for home assistant and that was also listed as invalid.

Eulenbaer commented 1 year ago

Having the same problem.

wonx commented 1 year ago

I am also affected by this bug. None of the 4 options work, and my API keys were generated several days ago.

hocomadvies commented 1 year ago

I experience this also "today". It says can not connect.. Key generated again today. Also have a paid account for the 3.0 one call api. Any chance to get this working? It might also affect the HA "smart irrigation" integration which uses the info from OW as well.

Scherm­afbeelding 2023-07-07 om 13 10 06
scarolan commented 1 year ago

Also not working for me. I had some old API keys that were working, but none of the newly generated ones do. I tried upgrading to their Onecall 3.0 subscription, now can't get connected with any of the four options.

masterx1981 commented 1 year ago

No one resolved this issue? Same to me. Works only in hourly.

timdj commented 1 year ago

Just signed up for openweathermap. None of the options work. They all give invalid api key

dselzle commented 1 year ago

Same issue here. Using One Call API 3.0, the "hourly" option works, but none of the other ones do.

Any chance this issue can get looked at? We're coming up on a year of it being broken.

masterx1981 commented 1 year ago

For now i've switched to accuweather, and seem to work well....

amaisano commented 11 months ago

I am paying for a subscription (Open 3.0). I should be able to use the "daily" option for this integration. What gives.

jbrownza commented 11 months ago

I have a similar issue. I have an API Key that is about 12 hours old. The key is definitely valid, but the integration is returning "Failed setup, will retry" and when I hover my mouse over the error it shows "Invalid API Key provided"

This is also reflected in the Home Assistant logs:

`Logger: homeassistant.config_entries Source: config_entries.py:441 First occurred: October 8, 2023 at 21:54:01 (7 occurrences) Last logged: 10:52:00

Config entry 'OpenWeatherMap' for openweathermap integration not ready yet: Invalid API Key provided; Retrying in background`

image

popsyann commented 10 months ago

Same here! Screenshot from 2023-11-17 09-23-12

Tried again after half an hour and it worked!...

issue-triage-workflows[bot] commented 6 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.