Openweathermap api key still not valid after 12 hours

I am attempting to integrate openweathermap.

I have an openweather account and have selected one call apu 3.0. All went well and I now have both a default api key on my account plus one I created for Homeassistant.

I realise the suggestion is it takes up to 2 hours for the api key to be available in HA.

However, 12 hours on, when I add the openweathermap integration in HA, and enter either of the api keys I mentioned above (not changing the name or lat/long values - the default name is OpenWeatherMap), I always get Invalid API Key.

Update: if I run the suggested full api call outside of HA, it works. The format for that is

https://api.openweathermap.org/data/3.0/onecall?lat={lat}&lon={lon}&appid={API key}

So I know that this is working as a full url call.

However, the API key in the integration still does not work.

I don’t know what to do to get this integration working

3 Likes

Quick check which one you are using? I remember there being issues (which may have been fixed) if you tried to use One Call hourly, but One Call daily should work.

1 Like

There is an open issue with the library that is the core of the openweathermap integration (as I understand it).

I swear I remember seeing a forum post here about it too, but now I can’t find it. It appears to be more of an issue with newer API keys.

I have tried onecall_hourly and onecall_daily. Both fail.

1 Like

I’m having the same issue. Has anyone figured this out?

I have exactly the same problem. API is valid when I make the call directly (as per the OP) but not through Home Assistant. Would love to know how to solve.

I did contact Openweather but unsurprisingly they said it was a third party issue ie Home Assistant.

1 Like

Add me to the list of the frustrated and confused too…

Created an account (at OpenWeather) generated an API. wait over night, copied API.
tried to add a new OpenWeather integration in HA. Copy and paste the API and HA responds with an “empty” dialog box that just says “Open Weather Map” with no message and the only option is “close”

Click close and nothing happens, no integration, no logs, nothing. Tried with every polling “mode”

Looks like for Home Assistant OpenWeather is Closed…

There was a note in the changelog for 2022.09.1 that would seem to indicate that this is fixed. I haven’t been having the problem (I have an older API key that seems to work fine), but if you’re having this issue you might want to upgrade to 2022.09.1 and see if that helps.

You are correct. That has worked now. Cheers

Spoke too soon. Although it allowed initial addition of the integration, it now states the Api is invalid again.

It might be worth submitting a Github issue for that then. I’m kind of shooting in the dark here because my older API key seems to mean I can still use some of the older calls, so this has never been broken for me.

Same here. After updating to 2022.9.2, OpenWeatherMap now saves the API key, but still complains about invalid API keys.

I’ve filed an issue here: OpenWeatherMap not accepting API keys · Issue #78241 · home-assistant/core · GitHub

Same here, same problem, same setup. New API 3.0 key will become invalid in HomeAssistand after a few hours. Wors great outside HomeAssistant, so it’s not an OpenWeatherMap problem. Would be great to see a fix as OpenWeathermap is a nice choice. Any updates from anyone following this?

1 Like

Hi. I had the same problem. The solution is to set the location in the HA settings.
Settings/System/General

I have my location set in General and I still get the Invalid API key issue

Actually, it started working after an hour of creating the API key. The keys aren’t instantaneously valid.

2 Likes

Had the same issue, you need to choose “onecall_hourly”, that did the trick!

2 Likes

FWIW: I signed up and my key was active immediately.
Still I couldn’t finish the configuration of this integration, tried all 4 interval options.
It was only after when I signed out of the account in my browser that I succeeded.

Coincidence?

2 Likes

I just had the same experience, did not work until i signed out on the openweathermap website. Thanks for sharing. :slight_smile:

1 Like

Has anyone else had trouble with the API key being invalid? I registered a week ago and it still does not work. Login/logout, all the tricks mentioned in this thread have not helped. Curious if this is just me or larger?

Thanks!