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
72.67k stars 30.43k forks source link

Netatmo Presence camera down sinds 2021.8.x upgrade #54222

Closed ghost closed 3 years ago

ghost commented 3 years ago

The problem

Hey, upgraded to 2021.8.x and poef! Netatmo not starting anymore, gives error in the log. Can you take a look? Running on Raspberry Pi 4b

What is version of Home Assistant Core has the issue?

core-2021.8.3

What was the last working version of Home Assistant Core?

core-2021.7.4

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/

Example YAML snippet

Config flow

Anything in the logs that might be useful for us?

Logger: homeassistant.components.camera
Source: components/netatmo/data_handler.py:149
Integration: Camera (documentation, issues)
First occurred: 16:19:55 (1 occurrences)
Last logged: 16:19:55

Error while setting up netatmo platform for camera
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 969, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore  # 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 ('192.168.66.66', 80)

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

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/src/homeassistant/homeassistant/components/netatmo/camera.py", line 62, in async_setup_entry
    await data_handler.register_data_class(
  File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 192, in register_data_class
    await self.async_fetch_data(data_class_entry)
  File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 149, in async_fetch_data
    await self.data[data_class_entry].async_update()
  File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 607, in async_update
    await self._async_update_all_camera_urls()
  File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 617, 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 696, in async_update_camera_urls
    self.cameras[home_id][camera_id]["local_url"] = await async_check_url(
  File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 682, 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 306, in async_post_request
    async with self.websession.post(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 1117, in __aenter__
    self._resp = await self._coro
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 520, in _request
    conn = await self._connector.connect(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 535, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 892, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1051, in _create_direct_connection
    raise last_exc
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1020, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 975, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 192.168.66.66:80 ssl:default [Connect call failed ('192.168.66.66', 80)]

Additional information

Did not try removing and re-adding them. This sometimes solves things (or makes things worse). Wanted to show you the error first before doing the removal + re-add.

probot-home-assistant[bot] commented 3 years ago

netatmo documentation netatmo source (message by IssueLinks)

probot-home-assistant[bot] commented 3 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)

ghost commented 3 years ago

Removed cams, re-added them. But no image....

JPG

cgtobi commented 3 years ago

Did you restart the camera(s)?

ghost commented 3 years ago

No effect. Removed them again. Dit a reboot of the whole Raspberry pie, not only the core. Re-added them. Re-adding proces is fine, but after that no image. HA log:

2021-08-10 17:42:28 WARNING (MainThread) [slixmpp.stringprep] Using slower stringprep, consider compiling the faster cython/libidn one.

2021-08-10 17:42:36 ERROR (MainThread) [homeassistant] Error doing job: Task was destroyed but it is pending!

2021-08-10 17:43:14 WARNING (MainThread) [zeroconf] Error with socket 29 (('fe80::c311:2059:a8b5:7e5', 5353, 0, 3))): [Errno 101] Network unreachable
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 1056, in sendto
    self._sock.sendto(data, addr)
OSError: [Errno 101] Network unreachable

2021-08-10 17:44:17 WARNING (MainThread) [homeassistant.components.netatmo] Webhook not registered - https and port 443 is required to register the webhook

2021-08-10 17:44:18 WARNING (MainThread) [homeassistant.components.climate] Platform netatmo not ready yet: None; Retrying in background in 30 seconds

2021-08-10 17:44:18 WARNING (MainThread) [homeassistant.components.sensor] Platform netatmo not ready yet: None; Retrying in background in 30 seconds

2021-08-10 17:45:23 ERROR (MainThread) [frontend.js.latest.202108090] :0:0 ResizeObserver loop completed with undelivered notifications.

When clicking the Netatmo image (greyed out):

2021-08-10 17:51:10 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream None/live/files/high/index.m3u8

2021-08-10 17:51:15 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream None/live/files/high/index.m3u8

2021-08-10 17:51:20 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream None/live/files/high/index.m3u8

2021-08-10 17:51:25 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream None/live/files/high/index.m3u8

2021-08-10 17:51:31 ERROR (MainThread) [frontend.js.latest.202108090] :0:0 ResizeObserver loop completed with undelivered notifications.

2021-08-10 17:51:40 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream None/live/files/high/index.m3u8
ghost commented 3 years ago

@cgtobi Am I the onlyone with this issue? Should I re-install HA from scratch?

ghost commented 3 years ago

Clean-install did not solve, still no image in lovelace.

Is it because I have 2 Netatmo Presences? I have a 3th old Presence laying on the shelf wich had an issue, but is functional for programming use, are you interested that I donate this one to you cgtobi?

2021-08-18 17:56:14 WARNING (MainThread) [homeassistant.components.netatmo] Webhook not registered - https and port 443 is required to register the webhook
2021-08-18 17:56:14 WARNING (MainThread) [homeassistant.components.select] Platform netatmo not ready yet: None; Retrying in background in 30 seconds
2021-08-18 17:56:14 WARNING (MainThread) [homeassistant.components.sensor] Platform netatmo not ready yet: None; Retrying in background in 30 seconds
2021-08-18 18:10:26 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream None/live/files/high/index.m3u8
2021-08-18 18:10:32 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream None/live/files/high/index.m3u8
cgtobi commented 3 years ago

Sorry for not responding earlier. I'll investigate ASAP what changes might have caused this problem. Two presence cameras should not be an issue as I know of bigger installations that are/were working fine. Would it be possible for your to set up a separate core installation for testing purposes?

ghost commented 3 years ago

Hi, it would be not so handy to fuckup my current installation, but I can do something with the logs if you wish...

If not, then I can "hook up a spare 3th Precence" to a fresh Raspberry pi3b with also the latest core I think.... Hmm wait, maybe it's better to "just change" the SD card in the current installation with your test for a moment.

What do you prefer? I prefer putting the logs in debug, but the other options are also fine.

cgtobi commented 3 years ago

Exactly, I don't want to put your current/original installation at jeopardy. That's why I suggested a separate installation if possible.

Of course the debug logs would be helpful as well.

Feel free to ping me on Discord if you have an account there.

ghost commented 3 years ago

Oke what do you want to do?

Do you want me to reboot, re-add the camera's and then immiately post you the log of the whole proces? Should this be my setting?

logger: default: error logs: pyatmo.auth: debug libav.h264: info homeassistant.components.stream.worker: debug homeassistant.components.netatmo: debug

cgtobi commented 3 years ago

That would be a good start. 👍

Am 07.09.2021 um 18:50 schrieb HAuser2019 @.***>:

 Oke what do you want to do?

Do you want me to reboot, re-add the camera's and then immiately post you the log of the whole proces? Should this be my setting?

logger: default: error logs: pyatmo.auth: debug libav.h264: info homeassistant.components.stream.worker: debug homeassistant.components.netatmo: debug

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

ghost commented 3 years ago

Here we go: Clean reboot, Config flow sees Netatmo Presence, I add them using NabuCasa authentication. Everything goes smooth...

2021-09-08 19:51:51 INFO (MainThread) [homeassistant.components.netatmo.config_flow] Successfully authenticated
2021-09-08 19:51:51 WARNING (MainThread) [homeassistant.components.netatmo] Webhook not registered - https and port 443 is required to register the webhook
2021-09-08 19:51:51 INFO (MainThread) [homeassistant.components.netatmo.camera] Cameras are currently not supported with this authentication method
2021-09-08 19:51:51 INFO (MainThread) [homeassistant.components.netatmo.light] Cameras are currently not supported with this authentication method
2021-09-08 19:51:51 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] No device data available
2021-09-08 19:51:51 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Data class AsyncWeatherStationData added
2021-09-08 19:51:51 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Data class AsyncHomeData added
2021-09-08 19:51:51 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Data class AsyncCameraData added
2021-09-08 19:51:51 DEBUG (MainThread) [homeassistant.components.netatmo.camera] Adding cameras [<Entity Netatmo Presence achtertuin: idle>, <Entity Netatmo Presence zijtuin: idle>]
2021-09-08 19:51:51 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] No device data available
2021-09-08 19:51:51 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Data class AsyncHomeCoachData added
2021-09-08 19:51:51 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Data class AsyncHomeStatus-5e0c8de5a11ec59aa71922e7 added
2021-09-08 19:51:51 DEBUG (MainThread) [homeassistant.components.netatmo.climate] Adding climate devices []

Result:

empty

When clicking on the camera's log says:

2021-09-08 19:54:21 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream None/live/files/high/index.m3u8
2021-09-08 19:54:31 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream None/live/files/high/index.m3u8
2021-09-08 19:54:51 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream None/live/files/high/index.m3u8
2021-09-08 19:55:21 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream None/live/files/high/index.m3u8

I've added the wheater station thingies, just in case it. They work fine. Then I reboot, then logs say this after completing the boot:

2021-09-08 20:00:21 INFO (MainThread) [homeassistant.components.netatmo.camera] Cameras are currently not supported with this authentication method
2021-09-08 20:00:22 INFO (MainThread) [homeassistant.components.netatmo.light] Cameras are currently not supported with this authentication method
2021-09-08 20:00:22 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] No device data available
2021-09-08 20:00:22 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Data class AsyncWeatherStationData added
2021-09-08 20:00:22 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Data class AsyncHomeData added
2021-09-08 20:00:22 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] No device data available
2021-09-08 20:00:22 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Data class AsyncHomeCoachData added
2021-09-08 20:00:23 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Data class AsyncHomeStatus-5e0c8de5a11ec59aa71922e7 added
2021-09-08 20:00:23 DEBUG (MainThread) [homeassistant.components.netatmo.climate] Adding climate devices []
2021-09-08 20:00:23 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Data class AsyncCameraData added
2021-09-08 20:00:23 DEBUG (MainThread) [homeassistant.components.netatmo.camera] Adding cameras [<Entity Netatmo Presence achtertuin: idle>, <Entity Netatmo Presence zijtuin: idle>]
2021-09-08 20:00:23 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Data class AsyncPublicData-14630afe-5d6e-45bd-973f-95cd67e97f07 added
2021-09-08 20:00:53 WARNING (MainThread) [homeassistant.components.netatmo] Webhook not registered - https and port 443 is required to register the webhook
2021-09-08 20:00:53 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream None/live/files/high/index.m3u8
2021-09-08 20:00:53 DEBUG (MainThread) [homeassistant.components.netatmo.select] Adding climate schedule select entities [<Entity Netatmo Het huis: None>]
2021-09-08 20:01:03 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream None/live/files/high/index.m3u8

"Cameras are currently not supported with this authentication method" that is weird? Hope this make sense in solving :) Thanks in advance.

cgtobi commented 3 years ago

I would strongly recommend to configure your client_id and client_secret in the configuration.yaml and use that instead on the HA Cloud Link. The HA Cloud Link ("NabuCasa authentication") does currently not reliably support webhook events due to some limitation of the Netatmo backend.

ghost commented 3 years ago

WORKS AGAIN directly! Maybe change the online documentation mention?

If I rembember correctly I moved off the "credentials in configyaml" because it was announced in the release notes a while ago with the new configflow. So using the "manual config flow" now again....

Thanks!