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
74.18k stars 31.15k forks source link

Netatmo Cloud becomes unavailable #125615

Open Fatalmose opened 2 months ago

Fatalmose commented 2 months ago

The problem

This will be the third time I'f installed Netatmo. It works fine for several days before becoming unavailable.

What version of Home Assistant Core has the issue?

2024.9.1

What was the last working version of Home Assistant Core?

2024.9.0

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Netatmo

Link to integration documentation on our website

No response

Diagnostics information

Not available.

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Échec de la configuration, nouvel essai: 500, message='Internal Server Error', url='https://account-link.nabucasa.com/refresh_token/netatmo'

Additional information

No response

gvigroux commented 2 months ago

Same for me

Fatalmose commented 2 months ago

Hello.

Have the impression that HA loses the Netatmo access token when updating to newer Core or Operating System. When having a HA problem where you decide to reinstall a saved previous HA version it also loses the Netatmo access token. I’f noticed that because every time you delete and reinstall the Netatmo integration it works again.

Regards.

JS.

Le mar. 10 sept. 2024 à 18:30, gvigroux @.***> a écrit :

Same for me

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/125615#issuecomment-2341432251, or unsubscribe https://github.com/notifications/unsubscribe-auth/BGEH4FSZW3SWI7JZSL4GCSDZV4NCHAVCNFSM6AAAAABN464PWOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBRGQZTEMRVGE . You are receiving this because you authored the thread.Message ID: @.***>

home-assistant[bot] commented 2 months ago

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

Code owner commands Code owners of `netatmo` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign netatmo` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


netatmo documentation netatmo source (message by IssueLinks)

AnthonyBe commented 2 months ago

Log details in English for broader searchability.

Logger: homeassistant.components.netatmo
Source: components/netatmo/__init__.py:90
integration: Netatmo (documentation, issues)
First occurred: 12:26:46 (123 occurrences)
Last logged: 15:05:05

API error: 500 (Internal Server Error)

2024-09-11 15:03:43.326 WARNING (MainThread) [homeassistant.components.netatmo] API error: 500 (Internal Server Error)

Just2Confuse commented 2 months ago

Same problem. "Einrichtung fehlgeschlagen, wird erneut versucht: 500, message='Internal Server Error', url='https://account-link.nabucasa.com/refresh_token/netatmo'"

CorentinMic commented 2 months ago

Same problem here

sven-debug commented 2 months ago

Dear @cgtobi ,

is there something we can provide to help you solving this issue? Any additional logs, protocols...

BR Sven

Sohnkarlsruhes commented 2 months ago

if I delete the integration and setup again, it works for a few weeks. same problem every few weeks

HansWegman commented 2 months ago

Same here

Just2Confuse commented 2 months ago

if I delete the integration and setup again, it works for a few weeks. same problem every few weeks

Thats it. Delete it, and set it up again. You will not lost any data

mfiordi commented 2 months ago

deleting and re-setting up works but you lose the relationships of the devices (for example the room they are in, within Hassio)

janchlebek commented 2 months ago

It does not seem to be related to core update, happened to me while still on 2024.8

WueBumbum commented 2 months ago

I have the same issue since today

AnthonyBe commented 2 months ago

It does not seem to be related to core update, happened to me while still on 2024.8

That's interesting. I never encountered the issue until I updated from 2024.8.3 to 2024.9.1

Ralphy140 commented 2 months ago

Yep same problem, Never had it drop out before updating to 2024.9 and then it stopped working so will try removing and re-adding

Ralphy140 commented 2 months ago

As a word or warning, When i re-added I lost all my sensor history, Not a huge issue but i had ~4 years of hystoical data thats now lost in Home assistant, I still have it in the netatmo platform so more annoying than anything else

janchlebek commented 2 months ago

As a word or warning, When i re-added I lost all my sensor history, Not a huge issue but i had ~4 years of hystoical data thats now lost in Home assistant, I still have it in the netatmo platform so more annoying than anything else

Sometimes the entity_id changes when you remove and add the integration. You need to make sure your entity names are the same as before (update them to old values after re-adding the integration). Then all history will stay.

WueBumbum commented 2 months ago

Sometimes the entity_id changes when you remove and add the integration. You need to make sure your entity names are the same as before (update them to old values after re-adding the integration). Then all history will stay.

You are right, that is great.

Haifi58 commented 2 months ago

Same for me - can do an integration with Netatmo, but can't see all my home netatmo sensors . . . tried to restore a backup, but no improvement . . .

janchlebek commented 2 months ago

Same for me - can do an integration with Netatmo, but can't see all my home netatmo sensors . . . tried to restore a backup, but no improvement . . .

After you add the integration it might take a minute for all the devices and entities to appear.

Haifi58 commented 2 months ago

Same for me - can do an integration with Netatmo, but can't see all my home netatmo sensors . . . tried to restore a backup, but no improvement . . .

After you add the integration it might take a minute for all the devices and entities to appear.

Agreed, thats how IT worked the last 12 month, but no success since two days, see only kind of public Sensors with no values behind

Foguet commented 2 months ago

It does not seem to be related to core update, happened to me while still on 2024.8

That's interesting. I never encountered the issue until I updated from 2024.8.3 to 2024.9.1

The same thing happens to me since yesterday and I am still on version 2024.7.4; Supervisor 2024.09.1; Frontend 20240710.0;

2Joda2 commented 2 months ago

is there a solution without re-adding ?

janchlebek commented 2 months ago

is there a solution without re-adding ?

I'm afraid not at the moment - the developer of the integration or someone capable would need to implement it.

But there is nothing to worry about, just remove and add again, adjust entities in case they were customized.

SupercowsNL commented 2 months ago

Same issues here.

luissimoes commented 2 months ago

Same issues - annoying when this is used to trigger decisions…

flashouillette commented 2 months ago

same issue

doctorlunch commented 2 months ago

Heating back on ready for winter...same issue

nickgr6 commented 1 month ago

I have the same error. HA Version 2024.8.2

spanzetta commented 1 month ago

Same issue here.. for the 1st time after long time .. without updating anything (I am still using Core 2024.6.4 and OS 12.2) Just started to give this error now without any apparent reason

spanzetta commented 1 month ago

But apparently the problem is that... the nabucasa server is down.. Am I wrong?

Screenshot_20241008_133705_PingTools

Fatalmose commented 1 month ago

Nabucasa server just working fine for me…

Le mar. 8 oct. 2024 à 13:38, Stefano Panzetta @.***> a écrit :

But apparently the problem is that... the nabucasa server is down.. Am I wrong?

Screenshot_20241008_133705_PingTools.jpg (view on web) https://github.com/user-attachments/assets/815870ca-d18f-4f6b-b03e-3d500a5b54bf

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/125615#issuecomment-2399604443, or unsubscribe https://github.com/notifications/unsubscribe-auth/BGEH4FT6IPMNCPEGTA42AWDZ2O73JAVCNFSM6AAAAABN464PWOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJZGYYDINBUGM . You are receiving this because you authored the thread.Message ID: @.***>

spanzetta commented 1 month ago

Nabucasa server just working fine for me… Le mar. 8 oct. 2024 à 13:38, Stefano Panzetta @.> a écrit : But apparently the problem is that... the nabucasa server is down.. Am I wrong? Screenshot_20241008_133705_PingTools.jpg (view on web) https://github.com/user-attachments/assets/815870ca-d18f-4f6b-b03e-3d500a5b54bf — Reply to this email directly, view it on GitHub <#125615 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/BGEH4FT6IPMNCPEGTA42AWDZ2O73JAVCNFSM6AAAAABN464PWOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJZGYYDINBUGM . You are receiving this because you authored the thread.Message ID: @.>

But not https://account-link.nabucasa.com/ isn't it?

Fatalmose commented 1 month ago

Sorry to hear… I’m on my HA wright now using the Nabucasa Cloud. So I guess the server is working…

Le mar. 8 oct. 2024 à 14:52, Stefano Panzetta @.***> a écrit :

Nabucasa server just working fine for me… Le mar. 8 oct. 2024 à 13:38, Stefano Panzetta @.

> a écrit : … <#m1785336620119816059> But apparently the problem is that... the nabucasa server is down.. Am I wrong? Screenshot_20241008_133705_PingTools.jpg (view on web) https://github.com/user-attachments/assets/815870ca-d18f-4f6b-b03e-3d500a5b54bf https://github.com/user-attachments/assets/815870ca-d18f-4f6b-b03e-3d500a5b54bf — Reply to this email directly, view it on GitHub <#125615 (comment) https://github.com/home-assistant/core/issues/125615#issuecomment-2399604443>, or unsubscribe https://github.com/notifications/unsubscribe-auth/BGEH4FT6IPMNCPEGTA42AWDZ2O73JAVCNFSM6AAAAABN464PWOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJZGYYDINBUGM https://github.com/notifications/unsubscribe-auth/BGEH4FT6IPMNCPEGTA42AWDZ2O73JAVCNFSM6AAAAABN464PWOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJZGYYDINBUGM . You are receiving this because you authored the thread.Message ID: @.>

But not https://account-link.nabucasa.com/ isn't it?

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/125615#issuecomment-2399763844, or unsubscribe https://github.com/notifications/unsubscribe-auth/BGEH4FW7DRUEALWSUU6PVTLZ2PIRJAVCNFSM6AAAAABN464PWOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJZG43DGOBUGQ . You are receiving this because you authored the thread.Message ID: @.***>

spanzetta commented 1 month ago

apparently this is the not working link.. that returns Error 500

Échec de la configuration, nouvel essai: 500, message='Internal Server Error', url='https://account-link.nabucasa.com/refresh_token/netatmo'

spanzetta commented 1 month ago

I tried anyway to remove the integration and configure it again, as many people was suggesting, the result is that .. there is no entity now.. What's happening???

spanzetta commented 1 month ago

I tried anyway to remove the integration and configure it again, as many people was suggesting, the result is that .. there is no entity now.. What's happening???

ops.. sorry.. there was a little problem with setup now solved (I was missing one step)...

I confirm that after reconfiguring it (and suddenly the used link is still with 'https://account-link.nabucasa.com/refresh_token/netatmo') it start again to work..

millenniumy2k commented 1 month ago

Same here...

mfiordi commented 1 month ago

Hi, has anybody talked with NETATMO API SUPPORT? I wrote them on X, and they suggested to write here: https://dev.netatmo.com/contact-us-form they request an app-id, so maybe it's better if the creator of the hassio add-on does it?!

HansWegman commented 1 month ago

I have had this already 7 times the past months

Van: Tobias Sauerwein @.> Beantwoorden - Aan: home-assistant/core @.> Datum: donderdag 10 oktober 2024 om 10:04 Aan: home-assistant/core @.> CC: @." @.>, Comment @.> Onderwerp: Re: [home-assistant/core] Netatmo Cloud becomes unavailable (Issue #125615)

Is anyone having this issue using the save Netatmo app credentials more than once?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

mfiordi commented 1 month ago

Hi, I have been in contact with NetAtmo, below is their reply. Apparently, there is not much they can do on their end; it seems that it's HA that should differently manage the connection. I am not a dev, can someone with technical understanding read what they sent me and comment it?

_Hi Martino, No, I haven't already been contacted for this problem As I see it works back correctly after a deletion/re-add of the integration. So my opinion about this :

when you set back the installation, it sends an new /authorize request to our servers leading you after a /token request to get your first valid pair of access/refresh_token and let you use correctly the HA integration for any reason after a few days/weeks, HA is not able anymore to get the latest generated access/refresh_token values. You retrieve a 500 error code (it seems to be what nabucasa sends for this case, on our side we send a 400 error code "invalid_grant" in case of a bad refresh_token request) what I would think about the problem is that the latest generated refresh_token value is not correctly stored at a moment, and no value or the invalidated previous one is used (possibly a down of nabucasa during a /token request ?)

Unfortunately, I think we can't do much more on our side. You should check if there is no problem with the storage of the latest stored values, and/or if a temporary down of nabucasa could erase the value or not re-send a /token request in case of a fail_

WueBumbum commented 1 month ago

Hello,

I don't know how the integrations works, but I am no Nabu Casa user and also have this issue. (But the calls may be done anyways in the background from the Nabu Casa Cloud Servers)

best regards Bumbum

svandav commented 1 month ago

Here’s a workaround that prevents the loss of history and integration connections. There might be an easier way, but I approached it through a "trial and error" method.

After creating a new Netatmo integration, new tokens are generated. These are stored in /config/.storage/core.config_entries. What we need to do is back up the "data" element (which is inside the settings for the Netatmo service and contains the tokens).

Here’s the procedure that worked for me:

  1. Back up the state where the Netatmo integration is no longer functioning, but we still have connections to the integrations.
  2. Delete the Netatmo integration.
  3. Create a new Netatmo integration.
  4. Back up the mentioned "data" element (in core.config_entries).
  5. Restore the original backup.
  6. Replace the "data" element.
leebger commented 1 month ago

Any update on this issue? For me this happens after every reboot of HA. After deletion and reinstall Netatmo Hub it works until next reboot! IMG_4035

leebger commented 1 month ago

Is there a relation to this problem?

https://github.com/home-assistant/core/issues/128486

Nutti85 commented 1 month ago

Commenting to say I have the same issue and it's quite critical. If i delete the integration and reinstall it, do I get new entity id's?

tott commented 5 days ago

Same here - it looks to be an issue with the nabucasa endpoint. Would be great to get a solution here that lasts longer than until the next token expiration.