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.58k stars 30.75k forks source link

Netatmo integration stopped working with guest weather stations after 2022.10 #79829

Closed snurre0 closed 2 years ago

snurre0 commented 2 years ago

The problem

Hi,

I'm having issues with all my sensors in the Netatmo integration being unavailable after I upgraded to 2022.10 (and later 2022.10.1 which didnt change anything related to this issue). I've seen two other issues here kinda similar but related to Home Assistant Cloud if I read them correctly. I don't use the Cloud feature of home assistant, and I'm unsure if it's related.

I could try to re-add my Netatmo integration, but I really don't want to lose my historical sensor data if it's possible to avoid, so I'm asking for help on how to fix this issue first. Is there any way to re-authenticate or anything like that, without removing the integration?

What version of Home Assistant Core has the issue?

2022.10(.1)

What was the last working version of Home Assistant Core?

2022.9.7

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

config_entry-netatmo-dad510ef0667c6866bfcc5a87e4af827.json.txt

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Not sure if this is related to my issue, but I don't think I've use webhook with this integration before. This is all the log I could find:

Logger: homeassistant.components.netatmo
Source: components/netatmo/__init__.py:200
Integration: Netatmo (documentation, issues)
First occurred: 19:37:42 (1 occurrences)
Last logged: 19:37:42

Webhook not registered - https and port 443 is required to register the webhook

Additional information

No response

homeassistant commented 2 years 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! (message by CodeOwnersMention)


netatmo documentation netatmo source (message by IssueLinks)

cgtobi commented 2 years ago

If you re-install the integration without restarting HA in between the entity names should remain the same and you should not loose connection to historical data.

cgtobi commented 2 years ago

Also, please check the integrations page about the registered entities and their state. Further, raise the log level for the integration and pyatmo to debug, restart HA and watch the logs.

AceEye03 commented 2 years ago

Hello,

I have the same problem.

My logs :

2022-10-07 07:30:06.890 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Home Assistant Cloud for netatmo File "/usr/src/homeassistant/homeassistant/components/netatmo/init.py", line 164, in async_setup_entry File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 151, in async_setup File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 243, in subscribe File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 199, in async_fetch_data 2022-10-07 07:39:13.653 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Home Assistant Cloud for netatmo File "/usr/src/homeassistant/homeassistant/components/netatmo/init.py", line 164, in async_setup_entry File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 151, in async_setup File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 243, in subscribe File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 199, in async_fetch_data 2022-10-07 22:00:35.469 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Home Assistant Cloud for netatmo File "/usr/src/homeassistant/homeassistant/components/netatmo/init.py", line 164, in async_setup_entry File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 151, in async_setup File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 243, in subscribe File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 199, in async_fetch_data 2022-10-07 22:08:35.221 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Home Assistant Cloud for netatmo File "/usr/src/homeassistant/homeassistant/components/netatmo/init.py", line 164, in async_setup_entry File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 151, in async_setup File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 243, in subscribe File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 199, in async_fetch_data

cgtobi commented 2 years ago

@AceEye03 please read the comments above.

AceEye03 commented 2 years ago

@cgtobi No worries, I read the comment above.

I sent these logs because I have already tried everything. I restored a previous version, taking care to remove the Netatmo integration, to reboot, to update again and finally to reinstall Netatmo, in vain...

snurre0 commented 2 years ago

All entities that are not disabled in the integration, says "This entity is no longer being provided by the netatmo integration" after the upgrade.

After enabling the suggested debug logging, I get this in my logs:

2022-10-07 22:42:26.895 DEBUG (MainThread) [pyatmo.helpers] Server response: {'body': {'homes': [], 'user': {'email': '<MASKED>', 'language': 'en', 'locale': 'en-GB', 'feel_like_algorithm': 0, 'unit_pressure': 0, 'unit_system': 0, 'unit_wind': 2, 'id': '<MASKED>'}}, 'status': 'ok', 'time_exec': 0.013409137725830078, 'time_server': 1665175346}
2022-10-07 22:37:14.808 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] No device data available

I can see all my entities and data in my Netatmo app, and if logging into Netatmo's website, everything is there. It sounds to me like there is some kind of authentication issue maybe, that makes Home Assistant unable to see my homes from Netatmo.

Is there any way to re-authenticate without removing the integration and re-adding it? I might test that later, if there is no way around it.

cgtobi commented 2 years ago

@snurre0 you should be prompted to re-authorize the integration due to changes of the scope. Please provide diagnostics data for further debugging.

snurre0 commented 2 years ago

I actually went ahead and removed and re-added the integration. I'll live without historical data. But that didn't solve my issue.

Here is diagnostics from the integration: config_entry-netatmo-2add39f41989c7e01c014d687cf8c436.json.txt

Might be a stupid question, but is the Netatmo integration dependent of using Home Assistant Cloud? I found the integration documentation to be a bit unclear about that. I don't have a cloud subscription, but I haven't had that in a long time, so that hasn't changed. I had a trial a few months ago, but I let it expire without renewing it. I'm reading about webhook integration between Netatmo and HA Cloud, is this a requirement for this extension to work? If so, then it's a bit weird if this has been working all this time without a subscription.

cgtobi commented 2 years ago

No, the could subscription is not required at all. And the app works fine without webhook. Webhook events can provide significantly improved responsiveness for some devices (Netatmo only).

snurre0 commented 2 years ago

All right, thank you for the clarification.

From the debug log I can see that I still get a blank "devices" array in the response when setting up the integration from scratch, which is really weird. I'm getting redirected to the auth.netatmo.com site when setting it up as expected, and I approve the authorization.

Any logs or information somewhere that might help me get to the bottom of this?

cgtobi commented 2 years ago

There does not seem to an account linked. Could it be that you choose the wrong Netatmo account? What devices do you have?

snurre0 commented 2 years ago

I only have one account, I get my correct email address in return in the same response when setting up the integration. This account is actually a guest account on a family members system. They have two homes, with indoor units, out door units, rain and wind sensors at both homes. I can see all the devices with all the data if I log into the netatmo website or in the netatmo app.

I've been using this account in the HA integration for quite a few months without any issues. The only thing I can think of that has changes is my email address on the netatmo account, but that was like a month ago and I have restarted HA many times after that, it only stopped working after the update. Though I agree with you that it seems like my account doesnt have access to any homes and devices.

Maybe netatmo changed something, or something got messed up with email change or something else at their end? Kinds weird it didnt happen immediately if that is the case though. Maybe I can try to poll data from their api directly tomorrow, and see where that takes me.

nrosier commented 2 years ago

In my case the module seems to work partially. Available:

Unavailable:

When I reload the module I get following messages in the log:

2022-10-07 23:51:21.053 INFO (MainThread) [homeassistant.components.netatmo] Unregister Netatmo webhook
2022-10-07 23:51:21.256 INFO (MainThread) [homeassistant.components.camera] Setting up camera.netatmo
2022-10-07 23:51:21.256 INFO (MainThread) [homeassistant.components.climate] Setting up climate.netatmo
2022-10-07 23:51:21.259 INFO (MainThread) [homeassistant.components.cover] Setting up cover.netatmo
2022-10-07 23:51:21.259 INFO (MainThread) [homeassistant.components.light] Setting up light.netatmo
2022-10-07 23:51:21.260 INFO (MainThread) [homeassistant.components.select] Setting up select.netatmo
2022-10-07 23:51:21.260 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.netatmo
2022-10-07 23:51:21.261 INFO (MainThread) [homeassistant.components.switch] Setting up switch.netatmo
2022-10-07 23:51:21.324 WARNING (MainThread) [homeassistant.helpers.entity_platform] Ignoring invalid device configuration_url ''
2022-10-07 23:51:21.328 WARNING (MainThread) [homeassistant.helpers.entity_platform] Ignoring invalid device configuration_url ''
2022-10-07 23:51:21.333 WARNING (MainThread) [homeassistant.helpers.entity_platform] Ignoring invalid device configuration_url ''
2022-10-07 23:51:21.336 WARNING (MainThread) [homeassistant.helpers.entity_platform] Ignoring invalid device configuration_url ''
2022-10-07 23:51:21.341 WARNING (MainThread) [homeassistant.helpers.entity_platform] Ignoring invalid device configuration_url ''
2022-10-07 23:51:21.345 WARNING (MainThread) [homeassistant.helpers.entity_platform] Ignoring invalid device configuration_url ''
2022-10-07 23:51:21.349 WARNING (MainThread) [homeassistant.helpers.entity_platform] Ignoring invalid device configuration_url ''
2022-10-07 23:51:21.353 WARNING (MainThread) [homeassistant.helpers.entity_platform] Ignoring invalid device configuration_url ''
2022-10-07 23:51:21.357 WARNING (MainThread) [homeassistant.helpers.entity_platform] Ignoring invalid device configuration_url ''
2022-10-07 23:51:21.361 WARNING (MainThread) [homeassistant.helpers.entity_platform] Ignoring invalid device configuration_url ''
2022-10-07 23:51:21.958 INFO (MainThread) [homeassistant.components.netatmo] Register Netatmo webhook: xxxx
snurre0 commented 2 years ago

If I understand how this works correctly, there is a Netatmo app named "Home Assistant Cloud" that exists at your(Home Assistant) Netatmo account, which is used to read data from users Netatmo accounts. And that is the App I grant access to when setting up the integration. And as far as I understand this, it uses the Authorization code grant type to authorize access to users Netatmo accounts.

So I went ahead and created a test app at my own Netatmo account, and used the Authorization code grant type to get a code via web with all the same scopes as the HA integration does it, like this: https://api.netatmo.com/oauth2/authorize?client_id=<ID of my app>&redirect_uri=https://my.web.server&scope=access_camera access_presence read_bubendorff read_camera read_carbonmonoxidedetector read_homecoach read_magellan read_mx read_presence read_smarther read_smokedetector read_station read_thermostat write_bubendorff write_camera write_magellan write_mx write_presence write_smarther write_thermostat&state=my_unique_string123 I authorized the access for my app via web with the same Netatmo account I used when authorizing HA, and picked up the code I got back via my webserver my.web.server(ofc with a real url).

I then asked the token endpoint https://api.netatmo.com/oauth2/token with the following body:

client_id = "<ID of my app>"
client_secret = "<Secret of my app>"
grant_type = "authorization_code"
code = "<Code from previous step>"
redirect_uri = "https://my.web.server"
scope = "access_camera access_presence read_bubendorff read_camera read_carbonmonoxidedetector read_homecoach read_magellan read_mx read_presence read_smarther read_smokedetector read_station read_thermostat write_bubendorff write_camera write_magellan write_mx write_presence write_smarther write_thermostat"

I got an access_token back, which I used to query https://api.netatmo.com/api/getstationsdata with a header of: Authorization = "Bearer <access_token from previous step" I got both devices back for both homes in the response, with all data as expected.

I also tried to query https://api.netatmo.com/api/homesdata with the same token, but I got an empty homes list back, but with my correct user information in the response. Maybe because I'm a guest user, this doesnt qualify as "my homes"? Either way, me having guest access has never been an issue for weather data with this integration.

I'm kinda stuck here, as the HA integration seems to get no devices back, as seen in the logs below, while I get my devices back just fine when trying it manually with the same account with my own app.

2022-10-08 08:51:20.801 DEBUG (MainThread) [pyatmo.helpers] Server response: {'body': {'homes': [], 'user': {'email': '<REMOVED>', 'language': 'en', 'locale': 'en-GB', 'feel_like_algorithm': 0, 'unit_pressure': 0, 'unit_system': 0, 'unit_wind': 2, 'id': '<REMOVED>'}}, 'status': 'ok', 'time_exec': 0.016096115112304688, 'time_server': 1665211880}

2022-10-08 08:51:21.074 DEBUG (MainThread) [pyatmo.helpers] Server response: {'body': {'devices': [], 'user': {'mail': '<REMOVED>', 'administrative': {'lang': 'en', 'reg_locale': 'en-GB', 'country': 'NO', 'unit': 0, 'windunit': 2, 'pressureunit': 0, 'feel_like_algo': 0}}}, 'status': 'ok', 'time_exec': 0.027365922927856445, 'time_server': 1665211881}
cgtobi commented 2 years ago

@snurre0 Please use that Netatmo dev account. in Home Assistant too if you already have that. But it is curious that the API shows no result. I have plenty of guest access homes for testing and no issues whatsoever.

snurre0 commented 2 years ago

I created a new app on my netatmo dev account just to have a clean app with no granted access from anywhere. Added the id/secret as credentials in HA and used that when adding the integration. Granted all the access it asked for when redirect to api.netatmo.com.

Unfortunately I get no devices back still. This is the complete log:

2022-10-08 10:46:01.210 INFO (MainThread) [homeassistant.components.netatmo.config_flow] Successfully authenticated
2022-10-08 10:46:01.295 DEBUG (MainThread) [pyatmo.helpers] Server response: {'body': {'homes': [], 'user': {'email': '<REMOVED>', 'language': 'en', 'locale': 'en-GB', 'feel_like_algorithm': 0, 'unit_pressure': 0, 'unit_system': 0, 'unit_wind': 2, 'id': '<REMOVED>'}}, 'status': 'ok', 'time_exec': 0.012959003448486328, 'time_server': 1665218761}
2022-10-08 10:46:01.295 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] No device data available
2022-10-08 10:46:01.295 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Publisher account added
2022-10-08 10:46:02.810 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Publisher weather added
2022-10-08 10:46:02.901 DEBUG (MainThread) [pyatmo.helpers] Server response: {'body': {'devices': [], 'user': {'mail': '<REMOVED>', 'administrative': {'lang': 'en', 'reg_locale': 'en-GB', 'country': 'NO', 'unit': 0, 'windunit': 2, 'pressureunit': 0, 'feel_like_algo': 0}}}, 'status': 'ok', 'time_exec': 0.02652883529663086, 'time_server': 1665218762}
2022-10-08 10:46:02.901 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] No device data available
2022-10-08 10:46:02.901 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Publisher air_care added
2022-10-08 10:46:03.088 DEBUG (MainThread) [pyatmo.auth] The Netatmo API returned b'{"error":{"code":21,"message":"Allowed ports for webhooks are 80, 88, 443 and 9443."}}' (400)
2022-10-08 10:46:03.088 ERROR (MainThread) [homeassistant.components.netatmo] Error during webhook registration - 400 - Bad request - Allowed ports for webhooks are 80, 88, 443 and 9443. (21) when accessing 'https://api.netatmo.com/api/addwebhook'

I guess I can ignore the webhook part of this?

snurre0 commented 2 years ago

I removed the integration and credentials again, restarted HA. Also got my friend to remove my access to his homes in Netatmo completely. He gave me new invite-links, I logged into my account and got my access back to both his homes with all devices. Re-added the netatmo integration to HA and tried both with the built-in authentication, and created a new app at my dev account and added the id/secret into HA.

Still nothing. I get the "Successfully authenticated" and the user object back, but no homes or devices, just an empty array.

Either there is something seriously wrong with my Netatmo account, or something else with HA or the integration that I don't understand.

snurre0 commented 2 years ago

I doubt this, but I'll ask anyway: Is there any way to downgrade the Netatmo component manually without reverting HA to a backup, just for the sake of testing it? Maybe that's just a stupid thing to do if there are other dependencies etc.

I see that there have been four commits mentioning Netatmo in 2022.10, but I don't understand a fraction of it, and also, I seem to be the only one having this particular issue, so the release is probably just fine.

palota324 commented 2 years ago

Hello, I'm the same way, after the last upgrade the Netamo integration doesn't work. Entities remain, but controlling or reading states does not work.

zdch26 commented 2 years ago

Same issue after upgrade. Deleting Netatmo integration and re-adding it (with the same names) temporary solves the issue, but only until restart or reboot. After this integration stops working: "This entity is no longer being provided by the netatmo integration".

propi62 commented 2 years ago

My main thermostat and valves stopped working. Indoor camera and weater station works, but outdoor cameras dont. Lights of outdoor cameras work better then ever before. I have dev account.

cgtobi commented 2 years ago

Please, I need more details other than "this or that device doesn't work any more". Upload details about your setup and upload diagnostics and debug logs in order to gather insights.

snurre0 commented 2 years ago

I cant think of anything else to share here, other that what I have already shared. If there is anything I havent shared that I should, to help get to the bottom of this, please tell me and I will.

Akulatraxas commented 2 years ago

I have the same issue since 2022.10. In only have an Indoor and an Outdoor Module. Both are unavailable. I dont get any messages in the logs i can share except for the missing webhook (that was there since forever).

Edit: The Integration also provides Data for a public weather station. Those data is still there

cgtobi commented 2 years ago

@snurre0 that was not targeted at you, sorry. I am still confused about your case.

cgtobi commented 2 years ago

@Akulatraxas Please raise the log level for the integration and pyatmo to debug and restart your instance.

cgtobi commented 2 years ago

Just to mention is here, what @snurre0 provided was of great help. He provided all data available plus he replicated the issue with the Netatmo API itself. Unfortunately I still don't have a clue what might have gone wrong here. In case any of you have outdoor cameras, please restart them and let me know if this has any effect since those caused issues in the past.

snurre0 commented 2 years ago

Not sure if it was clear from my previous replies, but I replicated just the part where I dont get any homes back from the api. I get the devices just fine when going directly to the api. I have no idea if I were able to get my homes from the api before, I never tested. Is the HA integration dependent on first to get homes and then get devices matching those homes or something? That could make sense if the api doesnt give me my homes.

snurre0 commented 2 years ago

For others in here with similar issues: I'll share my logging config, since I know I struggled to find the exact names of these components to enable debugging (I probably didnt know where to look)

I added this to my configuration.yaml, since I didnt have any other logging config. Adjust as needed if you already got some logging defined in there:

logger:
  default: warning
  logs:
    pyatmo: debug
    homeassistant.components.netatmo: debug
propi62 commented 2 years ago

i switched fuse to restart the outdoor cameras. after some seconds all valves, thermostate and outdoorcameras (all) works. thank you for the good work. with old versions i always had problems after homeassistant restart and had to rlead integration multiple times. now its perfect. Danke

DarKOrange75 commented 2 years ago

Same issue, data from devices of accounts where I am invited are no longer available. I had to revert back to 2022.9.x

snurre0 commented 2 years ago

Same issue, data from devices of accounts where I am invited are no longer available. I had to revert back to 2022.9.x

So your own devices work, but not guest access devices? That's interresting.. So you get the same empty "homes" and "devices" values in the logs if you enable debug logging?

cgtobi commented 2 years ago

Not sure if it was clear from my previous replies, but I replicated just the part where I dont get any homes back from the api. I get the devices just fine when going directly to the api. I have no idea if I were able to get my homes from the api before, I never tested. Is the HA integration dependent on first to get homes and then get devices matching those homes or something? That could make sense if the api doesnt give me my homes.

The account is the central element. That holds the registered homes. If those are empty no devices would be registered.

snurre0 commented 2 years ago

The account is the central element. That holds the registered homes. If those are empty no devices would be registered.

Right, so even if the api gives me devices directly from the stations endpoint, the ha integration wont fetch them because no homes are present to connect with those devices.

Maybe something changed at netatmo's api, for guest access to stations? A bit weird if that happened exactly at the same time as I upgraded HA though. I had sensor values ticking in until the minute HA restarted for upgrade.

DarKOrange75 commented 2 years ago

Yes my own devices work, I can't see devices from accounts where I am invited (HA says "this entity is no longer produced by netatmo integration" or something like that since my HA is in French)

All I have in the logs is that:

Logger: homeassistant.components.netatmo Source: components/netatmo/init.py:218 Integration: Netatmo (documentation, issues) First occurred: 11:40:14 (1 occurrences) Last logged: 11:40:14

Error during webhook registration - 400 - Bad request - Allowed ports for webhooks are 80, 88, 443 and 9443. (21) when accessing 'https://api.netatmo.com/api/addwebhook'

snurre0 commented 2 years ago

Yes my own devices work, I can't see devices from accounts where I am invited (HA says "this entity is no longer produced by netatmo integration" or something like that since my HA is in French)

All I have in the logs is that:

Logger: homeassistant.components.netatmo Source: components/netatmo/init.py:218 Integration: Netatmo (documentation, issues) First occurred: 11:40:14 (1 occurrences) Last logged: 11:40:14

Error during webhook registration - 400 - Bad request - Allowed ports for webhooks are 80, 88, 443 and 9443. (21) when accessing 'https://api.netatmo.com/api/addwebhook'

Add the debug logging we've been mentioning above, and restart ha. You should see more info and response messages from the netatmo api stating if your homes and devices lists are indeed empty in the response.

DarKOrange75 commented 2 years ago

here is my

Yes my own devices work, I can't see devices from accounts where I am invited (HA says "this entity is no longer produced by netatmo integration" or something like that since my HA is in French) All I have in the logs is that: Logger: homeassistant.components.netatmo Source: components/netatmo/init.py:218 Integration: Netatmo (documentation, issues) First occurred: 11:40:14 (1 occurrences) Last logged: 11:40:14 Error during webhook registration - 400 - Bad request - Allowed ports for webhooks are 80, 88, 443 and 9443. (21) when accessing 'https://api.netatmo.com/api/addwebhook'

Add the debug logging we've been mentioning above, and restart ha. You should see more info and response messages from the netatmo api stating if your homes and devices lists are indeed empty in the response.

here is my logging configuration, anything wrong?

logger: default: warning logs: pyatmo: debug homeassistant.components.netatmo: debug

DarKOrange75 commented 2 years ago

here is the complete log:

2022-10-09 11:58:44.031 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Publisher account added 2022-10-09 11:58:44.485 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Publisher weather added 2022-10-09 11:58:44.887 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] No device data available 2022-10-09 11:58:44.887 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Publisher air_care added 2022-10-09 11:58:45.182 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Publisher home-5ed00b49047437bee7435cc0 added 2022-10-09 11:58:52.358 DEBUG (MainThread) [pyatmo.auth] The Netatmo API returned b'{"error":{"code":21,"message":"Allowed ports for webhooks are 80, 88, 443 and 9443."}}' (400) 2022-10-09 11:58:52.358 ERROR (MainThread) [homeassistant.components.netatmo] Error during webhook registration - 400 - Bad request - Allowed ports for webhooks are 80, 88, 443 and 9443. (21) when accessing 'https://api.netatmo.com/api/addwebhook'

2022-10-09 11:58:44.887 DEBUG (MainThread) [pyatmo.helpers] Server response: {'body': {'devices': [], 'user': {'mail': 'xxxxxxx', 'administrative': {'country': 'FR', 'feel_like_algo': 0, 'lang': 'fr-FR', 'reg_locale': 'fr-FR', 'unit': 0, 'windunit': 0}}}, 'status': 'ok', 'time_exec': 0.05775594711303711, 'time_server': 1665309524} 2022-10-09 11:58:52.358 DEBUG (MainThread) [pyatmo.auth] The Netatmo API returned b'{"error":{"code":21,"message":"Allowed ports for webhooks are 80, 88, 443 and 9443."}}' (400)

cgtobi commented 2 years ago

I doubt that something changed on Netatmo side that broke things for you. I need to replicate this. Can you explain what devices don't work anymore and how you get invited?

snurre0 commented 2 years ago

I doubt that something changed on Netatmo side that broke things for you. I need to replicate this. Can you explain what devices don't work anymore and how you get invited?

For my situation, I only have guest access to two weather stations, I dont own any netatmo devices myself. Those two weather stations have connected various wind, rain and indoor/outdoor sensors.

I got access via invitation links that looks like this:

https://auth.netatmo.com/invitation/station/<some identifier or invite code>/<some kind of mac address?>/weather

I opened each link and logged into my "empty" netatmo account that I created, and the weather stations got added as guest stations to my account.

DarKOrange75 commented 2 years ago

Well it was working forever... I can't remind when I was invited but it was well before I installed Home Assistant and it was via Netatmo invitation procedure in the Netatmo app, my friends sent me an invitation and I accepted it. All my devices work (station, rain gauge) and all devices from my friends don't work.

AceEye03 commented 2 years ago

Hi, After multiple tries, I still have the same problem. For information, I only have the complete weather station (no camera, no thermostat...) I put some screenshots and the logs. I don't know how to put pyatmo in debug... If someone can help me to do it ? Thanks in advance. Netatmo 01 Netatmo 02

Logs details:

Logger: homeassistant.config_entries Source: components/netatmo/data_handler.py:199 First occurred: 12:08:33 (1 occurrences) Last logged: 12:08:33

Error setting up entry Home Assistant Cloud for netatmo Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 365, in async_setup result = await component.async_setup_entry(hass, self) File "/usr/src/homeassistant/homeassistant/components/netatmo/init.py", line 164, in async_setup_entry await data_handler.async_setup() File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 151, in async_setup await self.subscribe(ACCOUNT, ACCOUNT, None) File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 243, in subscribe await self.async_fetch_data(signal_name) File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 199, in async_fetch_data await getattr(self.account, self.publisher[signal_name].method)( File "/usr/local/lib/python3.10/site-packages/pyatmo/account.py", line 69, in async_update_topology self.process_topology() File "/usr/local/lib/python3.10/site-packages/pyatmo/account.py", line 58, in process_topology self.homes[home_id] = Home(self.auth, raw_data=home) File "/usr/local/lib/python3.10/site-packages/pyatmo/home.py", line 48, in init self.modules = { File "/usr/local/lib/python3.10/site-packages/pyatmo/home.py", line 49, in module["id"]: getattr(modules, module["type"])( AttributeError: module 'pyatmo.modules' has no attribute 'NLPO'

Complete logs:

2022-10-09 11:55:14.126 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Home Assistant Cloud for netatmo File "/usr/src/homeassistant/homeassistant/components/netatmo/init.py", line 164, in async_setup_entry File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 151, in async_setup File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 243, in subscribe File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 199, in async_fetch_data 2022-10-09 12:08:33.201 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Home Assistant Cloud for netatmo File "/usr/src/homeassistant/homeassistant/components/netatmo/init.py", line 164, in async_setup_entry File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 151, in async_setup File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 243, in subscribe File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 199, in async_fetch_data

snurre0 commented 2 years ago

I don't know how to put pyatmo in debug... If someone can help me to do it ?

I've literally given the config above: https://github.com/home-assistant/core/issues/79829#issuecomment-1272408469

DarKOrange75 commented 2 years ago

If it can help, I reverted back to 2022.9.7 from 2022.10.1 and everything is back to normal. So something is broken between 2022.9.7 and 2022.10.1

AceEye03 commented 2 years ago

I don't know how to put pyatmo in debug... If someone can help me to do it ?

I've literally given the config above: #79829 (comment)

I'm really sorry, I missed your explanation. I just added it and restarted Home Assistant, but the logs are the same. Maybe I'm looking for the wrong thing?

Logs:

Logger: homeassistant.config_entries Source: components/netatmo/data_handler.py:199 First occurred: 12:52:12 (1 occurrences) Last logged: 12:52:12

Error setting up entry Home Assistant Cloud for netatmo Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 365, in async_setup result = await component.async_setup_entry(hass, self) File "/usr/src/homeassistant/homeassistant/components/netatmo/init.py", line 164, in async_setup_entry await data_handler.async_setup() File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 151, in async_setup await self.subscribe(ACCOUNT, ACCOUNT, None) File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 243, in subscribe await self.async_fetch_data(signal_name) File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 199, in async_fetch_data await getattr(self.account, self.publisher[signal_name].method)( File "/usr/local/lib/python3.10/site-packages/pyatmo/account.py", line 69, in async_update_topology self.process_topology() File "/usr/local/lib/python3.10/site-packages/pyatmo/account.py", line 58, in process_topology self.homes[home_id] = Home(self.auth, raw_data=home) File "/usr/local/lib/python3.10/site-packages/pyatmo/home.py", line 48, in init self.modules = { File "/usr/local/lib/python3.10/site-packages/pyatmo/home.py", line 49, in module["id"]: getattr(modules, module["type"])( AttributeError: module 'pyatmo.modules' has no attribute 'NLPO'

Complete logs:

2022-10-09 12:52:12.881 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Home Assistant Cloud for netatmo File "/usr/src/homeassistant/homeassistant/components/netatmo/init.py", line 164, in async_setup_entry File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 151, in async_setup File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 243, in subscribe File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 199, in async_fetch_data

AceEye03 commented 2 years ago

If it can help, I reverted back to 2022.9.7 from 2022.10.1 and everything is back to normal. So something is broken between 2022.9.7 and 2022.10.1

I tried this but it didn't work for me.

DarKOrange75 commented 2 years ago

If it can help, I reverted back to 2022.9.7 from 2022.10.1 and everything is back to normal. So something is broken between 2022.9.7 and 2022.10.1

I tried this but it didn't work for me.

Maybe because your issue is different from the one discussed here. We are talking about previously working integration and you are talking about problem during the installation of the integration.

AceEye03 commented 2 years ago

If it can help, I reverted back to 2022.9.7 from 2022.10.1 and everything is back to normal. So something is broken between 2022.9.7 and 2022.10.1

I tried this but it didn't work for me.

Maybe because your issue is different from the one discussed here. We are talking about previously working integration and you are talking about problem during the installation of the integration.

No no, my integration was working fine before the 2022.10.1 update.

DarKOrange75 commented 2 years ago

If it can help, I reverted back to 2022.9.7 from 2022.10.1 and everything is back to normal. So something is broken between 2022.9.7 and 2022.10.1

I have installed 2022.10.0 and same issue, my devices work, not devices from inviting accounts. So the issue is between 2022.9.7 and 2022.10.0