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
73.38k stars 30.64k forks source link

Netatmo integration cannot go trough add process #103867

Closed bvalat closed 11 months ago

bvalat commented 11 months ago

The problem

When i click on Add integration and validate, it opens the netatmo website to grant permission on my devices. If i click on Yes I agree, the webite loops on itself (I see activity on the browser tab) so i can't finish the process of adding it... It seems that the callback URI is never called if i agree. Only if i cancel it redirects me on https://account-link.nabucasa.com/ I see someone having the same problem on the forum : https://community.home-assistant.io/t/netatmo-integration-not-working-on-2023-11/639754

What version of Home Assistant Core has the issue?

core-2023.11.2

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

Netatmo

Link to integration documentation on our website

https://www.home-assistant.io/integrations/netatmo

Diagnostics information

No log since the problem seems to be beteewn https://auth.netatmo.com/ and nabucasa.com

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

Brand new HAOS installation on RPI3 I only own a netatmo weather station with temp modules and rain meter. Tried with Chrome, Edg,firefox and Opera web browser. When i authenticate, the netatmo website opens https://home.netatmo.com/security intead of previously https://my.netatmo.com/app/station. Maybe legrand/netatmo broke something?

cgtobi commented 10 months ago

@jaal2001 Have set debug logging and checked the log while doing that?

jaal2001 commented 10 months ago

@cgtobi Already tried that. So far nothing useful.

DueErre commented 10 months ago

@cgtobi Already tried that. So far nothing useful.

Anyone having the same issue again with 2023.12.1? I'm trying to add Netatmo, but even when the NabuCasa website appears, the integration still does not show up. Logfile does not show any hint so far.

Same problem here, in 2024.1.2 :-( I removed my previous Netatmo integration because not working anymore, but i cannot configure a new one. I already created my new app on Netatmo dev site, get my cliend ID and secret, added into HA as new credentials related to Netatmo integration. When I try to add the integration the wizard starts; I am redirect to Netatmo site to authorize; I am then redirect to my Home Assistant page and if I try to "Link account" using local (private) URL for HA (but also using public URL, exposed on port 9000 -- not sure it can be relevant) I return to HA integrations page with an error ("Error while obtaining access token"): image No integration is shown at the end. No useful information from logs.

deosrc commented 10 months ago

@DueErre Based on the error message and description of what happens, it sounds like authentiction is succeeding on the browser side, but your home assistant instance is unable to make the API call to retrieve the auth token after you have logged in.

This may seem like a strange question but can your home assistant access the internet? If my understanding of OAuth is correct, your situation would be explained by a network connectivity issue with your home assistant instance, which isn't affecting the machine your browser is on.

If you can provide any details about how you are running home assitant it could be a big help.

jaal2001 commented 10 months ago

If you can provide any details about how you are running home assitant it could be a big help.

In my case HA is running in docker, internet access is open from internal network to external network. (i.e. HA can send Telegram notifications).

DueErre commented 10 months ago

@DueErre Based on the error message and description of what happens, it sounds like authentiction is succeeding on the browser side, but your home assistant instance is unable to make the API call to retrieve the auth token after you have logged in.

This may seem like a strange question but can your home assistant access the internet? If my understanding of OAuth is correct, your situation would be explained by a network connectivity issue with your home assistant instance, which isn't affecting the machine your browser is on.

You are right, and also another cloud integration seems to have similar problems... Finally I solved, and it seems not a problem related with Netatmo integration. Sorry for bothering you all :-(

I restored a previous HA version (2023.12.4) image and its configuration backup. Then I re-upgrade to HA 2024.1.2 and all was ok, working perfectly. To test the environment I removed the Netatmo integration and setup a new one, wthout problems. Maybe something wrong during previous HA upgrades. By the way: my HA core installation is in a docker container, on a QNAP NAS, hosted in my primary internal VLAN (the same where my computer/browser was used to reinstall integration) and proxy-reversed with Caddy.

Thank you for precious support.