core icon indicating copy to clipboard operation
core copied to clipboard

Error setting up entry Home Assistant Cloud for netatmo since 2022.3

Open atchoum31 opened this issue 2 years ago • 228 comments

The problem

Since the 2022.3 update, the Netatmo integration didn't work. After a delete/reinstall here is the issue. I have one camera and several temperature sensors.

For information the IP address 169.254.214.58 doesn't mean anything, my local IP range is 192.168.x.x

What version of Home Assistant Core has the issue?

core-2022.3.0

What was the last working version of Home Assistant Core?

core-2022.2.9

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Netatmo

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.config_entries
Source: components/netatmo/data_handler.py:166 
First occurred: 17:35:38 (2 occurrences) 
Last logged: 19:19:07

Error setting up entry Home Assistant Cloud for netatmo
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 986, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore[return-value]  # noqa
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1056, in create_connection
    raise exceptions[0]
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1041, in create_connection
    sock = await self._connect_sock(
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 955, in _connect_sock
    await self.sock_connect(sock, address)
  File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 502, in sock_connect
    return await fut
  File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 537, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
OSError: [Errno 113] Connect call failed ('169.254.214.58', 80)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 335, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/netatmo/__init__.py", line 144, in async_setup_entry
    await data_handler.async_setup()
  File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 108, in async_setup
    await asyncio.gather(
  File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 210, in register_data_class
    await self.async_fetch_data(data_class_entry)
  File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 166, in async_fetch_data
    await self.data[data_class_entry].async_update()
  File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 649, in async_update
    await self._async_update_all_camera_urls()
  File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 659, in _async_update_all_camera_urls
    await self.async_update_camera_urls(camera_id)
  File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 724, in async_update_camera_urls
    ] = await self._async_check_url(
  File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 731, in _async_check_url
    resp = await self.auth.async_post_request(url=f"{url}/command/ping")
  File "/usr/local/lib/python3.9/site-packages/pyatmo/auth.py", line 335, in async_post_request
    async with self.websession.post(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 1138, in __aenter__
    self._resp = await self._coro
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 535, in _request
    conn = await self._connector.connect(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 542, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 907, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1206, in _create_direct_connection
    raise last_exc
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 992, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 169.254.214.58:80 ssl:default [Connect call failed ('169.254.214.58', 80)]

Additional information

No response

atchoum31 avatar Mar 03 '22 18:03 atchoum31

netatmo documentation netatmo source (message by IssueLinks)

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)

The statement "the Netatmo integration doesn't work" is a bit broad. Please provide detailed information about what exactly doesn't work.

cgtobi avatar Mar 03 '22 21:03 cgtobi

No data are available on any sensors and the integration says "configuration failure. check the log". I pasted the log in the original ticket.

atchoum31 avatar Mar 03 '22 21:03 atchoum31

Same issue here

paki81 avatar Mar 04 '22 08:03 paki81

Same here! It is the entire integration failing (climate, weather, cameras). I also note there is no 'reload' option in the integration box menu. There is no option to download the diagnostics either. I had issues of this kind in the past, but it was limited to the Presence cameras. If it is the same cause, then now it affects the entire integration setup. Log:

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

Error setting up entry Configuration.yaml for netatmo
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 986, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore[return-value]  # noqa
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1056, in create_connection
    raise exceptions[0]
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1041, in create_connection
    sock = await self._connect_sock(
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 955, in _connect_sock
    await self.sock_connect(sock, address)
  File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 502, in sock_connect
    return await fut
  File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 537, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
OSError: [Errno 113] Connect call failed ('169.xxx.xxx.xxx', 80)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 335, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/netatmo/__init__.py", line 144, in async_setup_entry
    await data_handler.async_setup()
  File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 108, in async_setup
    await asyncio.gather(
  File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 210, in register_data_class
    await self.async_fetch_data(data_class_entry)
  File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 166, in async_fetch_data
    await self.data[data_class_entry].async_update()
  File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 649, in async_update
    await self._async_update_all_camera_urls()
  File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 659, in _async_update_all_camera_urls
    await self.async_update_camera_urls(camera_id)
  File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 724, in async_update_camera_urls
    ] = await self._async_check_url(
  File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 731, in _async_check_url
    resp = await self.auth.async_post_request(url=f"{url}/command/ping")
  File "/usr/local/lib/python3.9/site-packages/pyatmo/auth.py", line 335, in async_post_request
    async with self.websession.post(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 1138, in __aenter__
    self._resp = await self._coro
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 535, in _request
    conn = await self._connector.connect(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 542, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 907, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1206, in _create_direct_connection
    raise last_exc
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 992, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 169.xxx.xxx.xxx:80 ssl:default [Connect call failed ('169.xxx.xxx.xxx', 80)]

Friedrieck avatar Mar 04 '22 17:03 Friedrieck

Same for me and if i restore the backup made before the upgrade Netatmo still doesn't work.

Edit: i rostore to the previous version and deleted netatmon integration. Instaal the new version and then install again the netatmo integration and everythings works now

(netatmo with configuration.yaml)

axel2906 avatar Mar 04 '22 19:03 axel2906

Same for me and if i restore the backup made before the upgrade Netatmo still doesn't work.

Edit: i rostore to the previous version and deleted netatmon integration. Instaal the new version and then install again the netatmo integration and everythings works now

(netatmo with configuration.yaml)

Agree, the previous version of HA works but this bug appears with the 2022.3

atchoum31 avatar Mar 04 '22 21:03 atchoum31

Same for me and if i restore the backup made before the upgrade Netatmo still doesn't work. Edit: i rostore to the previous version and deleted netatmon integration. Instaal the new version and then install again the netatmo integration and everythings works now (netatmo with configuration.yaml)

Agree, the previous version of HA works but this bug appears with the 2022.3

try to restore to the previous version and dlete the netatmo integration (if you use the configuration.yaml delete the netatmo line too)

upgrade to the new version and install again the integration solved the issue for me

axel2906 avatar Mar 05 '22 10:03 axel2906

Doesn't worked for me.

paki81 avatar Mar 05 '22 11:03 paki81

Same here. Since I updated to 2022.3.1 from the latest 2022.2 the Netatmo integration doesn‘t work at all.

`Logger: homeassistant.config_entries Source: components/netatmo/data_handler.py:166 First occurred: 14:59:10 (1 occurrences) Last logged: 14:59:10

Error setting up entry Home Assistant Cloud for netatmo Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 986, in _wrap_create_connection return await self._loop.create_connection(*args, **kwargs) # type: ignore[return-value] # noqa File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1056, in create_connection raise exceptions[0] File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1041, in create_connection sock = await self._connect_sock( File "/usr/local/lib/python3.9/asyncio/base_events.py", line 955, in _connect_sock await self.sock_connect(sock, address) File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 502, in sock_connect return await fut File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 537, in _sock_connect_cb raise OSError(err, f'Connect call failed {address}') OSError: [Errno 101] Connect call failed ('169.254.72.2', 80)

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 335, in async_setup result = await component.async_setup_entry(hass, self) File "/usr/src/homeassistant/homeassistant/components/netatmo/init.py", line 144, in async_setup_entry await data_handler.async_setup() File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 108, in async_setup await asyncio.gather( File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 210, in register_data_class await self.async_fetch_data(data_class_entry) File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 166, in async_fetch_data await self.data[data_class_entry].async_update() File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 649, in async_update await self._async_update_all_camera_urls() File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 659, in _async_update_all_camera_urls await self.async_update_camera_urls(camera_id) File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 724, in async_update_camera_urls ] = await self._async_check_url( File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 731, in _async_check_url resp = await self.auth.async_post_request(url=f"{url}/command/ping") File "/usr/local/lib/python3.9/site-packages/pyatmo/auth.py", line 335, in async_post_request async with self.websession.post( File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 1138, in aenter self._resp = await self._coro File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 535, in _request conn = await self._connector.connect( File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 542, in connect proto = await self._create_connection(req, traces, timeout) File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 907, in _create_connection _, proto = await self._create_direct_connection(req, traces, timeout) File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1206, in _create_direct_connection raise last_exc File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection transp, proto = await self._wrap_create_connection( File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 992, in _wrap_create_connection raise client_error(req.connection_key, exc) from exc aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 169.254.72.2:80 ssl:default [Connect call failed ('169.254.72.2', 80)]

`

Friedi1970 avatar Mar 05 '22 14:03 Friedi1970

Backed up to 2022.2.9 and everything is working fine. @cgtobi please fix 🙏

Friedi1970 avatar Mar 05 '22 20:03 Friedi1970

+1 same problem

Flixi1403 avatar Mar 06 '22 09:03 Flixi1403

Just to make sure, everyone of you that is having this issue is using the HA Cloud Link option for the Netatmo integration?

cgtobi avatar Mar 06 '22 12:03 cgtobi

Just to make sure, everyone of you that is having this issue is using the HA Cloud Link option for the Netatmo integration?

Not for me. I'm using the integration via thé configuration.yaml

axel2906 avatar Mar 06 '22 12:03 axel2906

Just to make sure, everyone of you that is having this issue is using the HA Cloud Link option for the Netatmo integration?

To be honest, I didn‘t know there is another way … Btw. I wrote everything is working fine after roll bach. Not really true: both of the cams are not available :(

Friedi1970 avatar Mar 06 '22 12:03 Friedi1970

You can try with this method. With the update version of HA it's work for me

https://www.home-assistant.io/integrations/netatmo/#development--testing-with-your-own-client-id

axel2906 avatar Mar 06 '22 12:03 axel2906

Just to make sure, everyone of you that is having this issue is using the HA Cloud Link option for the Netatmo integration?

Yep, introduced with 2022.3

Flixi1403 avatar Mar 06 '22 12:03 Flixi1403

I'm using the integration via thé configuration.yaml and it dosn't work anymore. But it works with Homekit controller

katla50 avatar Mar 06 '22 13:03 katla50

Just to make sure, everyone of you that is having this issue is using the HA Cloud Link option for the Netatmo integration?

HA Cloud Link option

paki81 avatar Mar 06 '22 13:03 paki81

Just to make sure, everyone of you that is having this issue is using the HA Cloud Link option for the Netatmo integration?

Same issue either for configuration.yaml or HA Cloud integration options.

atchoum31 avatar Mar 06 '22 15:03 atchoum31

Same after Update to 2022.3. Cloud Integration.

Ottmar0815 avatar Mar 06 '22 15:03 Ottmar0815

It is the entire integration failing (climate, weather, cameras).

Strangely enough, after a new reboot, no more errors in the log and the integration just set up fine (on 2022.3.1).

Friedrieck avatar Mar 06 '22 16:03 Friedrieck

Nothing is working:

Logger: homeassistant.config_entries Source: components/netatmo/data_handler.py:166 First occurred: 19:26:42 (1 occurrences) Last logged: 19:26:42

Error setting up entry Home Assistant Cloud for netatmo Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 986, in _wrap_create_connection return await self._loop.create_connection(*args, **kwargs) # type: ignore[return-value] # noqa File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1056, in create_connection raise exceptions[0] File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1041, in create_connection sock = await self._connect_sock( File "/usr/local/lib/python3.9/asyncio/base_events.py", line 955, in _connect_sock await self.sock_connect(sock, address) File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 502, in sock_connect return await fut File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 537, in _sock_connect_cb raise OSError(err, f'Connect call failed {address}') OSError: [Errno 113] Connect call failed ('169.254.79.219', 80)

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 335, in async_setup result = await component.async_setup_entry(hass, self) File "/usr/src/homeassistant/homeassistant/components/netatmo/init.py", line 144, in async_setup_entry await data_handler.async_setup() File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 108, in async_setup await asyncio.gather( File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 210, in register_data_class await self.async_fetch_data(data_class_entry) File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 166, in async_fetch_data await self.data[data_class_entry].async_update() File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 649, in async_update await self._async_update_all_camera_urls() File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 659, in _async_update_all_camera_urls await self.async_update_camera_urls(camera_id) File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 724, in async_update_camera_urls ] = await self._async_check_url( File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 731, in _async_check_url resp = await self.auth.async_post_request(url=f"{url}/command/ping") File "/usr/local/lib/python3.9/site-packages/pyatmo/auth.py", line 335, in async_post_request async with self.websession.post( File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 1138, in aenter self._resp = await self._coro File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 535, in _request conn = await self._connector.connect( File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 542, in connect proto = await self._create_connection(req, traces, timeout) File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 907, in _create_connection _, proto = await self._create_direct_connection(req, traces, timeout) File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1206, in _create_direct_connection raise last_exc File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection transp, proto = await self._wrap_create_connection( File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 992, in _wrap_create_connection raise client_error(req.connection_key, exc) from exc aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 169.254.79.219:80 ssl:default [Connect call failed ('169.254.79.219', 80)]

Ottmar0815 avatar Mar 06 '22 18:03 Ottmar0815

You can try with this method. With the update version of HA it's work for me

https://www.home-assistant.io/integrations/netatmo/#development--testing-with-your-own-client-id

Already using this method, but same problem as everyone above here.

Alomon31 avatar Mar 06 '22 22:03 Alomon31

To be honest, I have no idea where that IPs (e.g. 169.254.79.219) are coming from. Maybe some DNS issue. Can you please run nslookup api.netatmo.com from both the machine you're using as well as the host system that HA is running on and report what that resolves to.

cgtobi avatar Mar 08 '22 06:03 cgtobi

From my machine :

nslookup api.netatmo.com
Server:		192.168.86.176
Address:	192.168.86.176#53

Non-authoritative answer:
api.netatmo.com	canonical name = front-azure.netatmo.net.
Name:	front-azure.netatmo.net
Address: 51.145.143.28

From HA:

nslookup api.netatmo.com
Server:		192.168.86.1
Address:	192.168.86.1#53

Non-authoritative answer:
api.netatmo.com	canonical name = front-azure.netatmo.net.
Name:	front-azure.netatmo.net
Address: 51.145.143.28

For your information, all my DNS requests go to a AdGuard Home DNS which transfers the request to quad9 DNS

atchoum31 avatar Mar 08 '22 06:03 atchoum31

Those IPs look perfectly correct.

Did you try to downgrade to 2022.2 already to see if the issue is related to 2022.3 exactly?

cgtobi avatar Mar 08 '22 06:03 cgtobi

No downgrade but when I tested the dev release (actually the 2022.3 version) I had the issue and when I go back to the stable (the 2022.2 at that moment) the issue was gone.

atchoum31 avatar Mar 08 '22 06:03 atchoum31

Please upgrade to 2022.3.3 and let me know if the issue persists. For now I can't replicate the issue and don't see where it might originate.

cgtobi avatar Mar 08 '22 07:03 cgtobi