core: Synology camera stream auth expires

The problem

Camera streams from my Synology NAS appear to fail to authenticate after a period of time (1 hour?). When I add a fresh synology_dsm integration I can successfully authenticate and see all the cameras, their streams and other NAS information. After a while, at least an hour or more, the camera streams fail with the 401 Unauthorized error listed below. The static camera images and other NAS sensors continue to function without issue the whole time.

If I reload the synology_dsm integration, the streams immediately begin to work again.

Environment

  • Home Assistant Core release with the issue: 0.117.4
  • Last working Home Assistant Core release (if known): Not sure.
  • Operating environment (OS/Container/Supervised/Core): Core / docker
  • Integration causing this issue: synology_dsm
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/synology_dsm/

Problem-relevant configuration.yaml

The integration was configured using the UI.

Traceback/Error logs

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/stream/worker.py", line 54, in stream_worker
    _stream_worker_internal(hass, stream, quit_event)
  File "/usr/src/homeassistant/homeassistant/components/stream/worker.py", line 71, in _stream_worker_internal
    container = av.open(stream.source, options=stream.options, timeout=STREAM_TIMEOUT)
  File "av/container/core.pyx", line 354, in av.container.core.open
  File "av/container/core.pyx", line 225, in av.container.core.Container.__cinit__
  File "av/container/core.pyx", line 257, in av.container.core.Container.err_check
  File "av/error.pyx", line 336, in av.error.err_check
av.error.HTTPUnauthorizedError: [Errno 825242872] Server returned 401 Unauthorized (authorization failed): 'rtsp://syno:REDACTED@10.0.2.191:554/Sms=12.unicast'; last error log: [rtsp] method DESCRIBE failed: 401 Unauthorized

Additional information

I suspect, though have nothing to back this up, that this could be caused by one of two issues:

  1. The stream rtsp links aren’t refreshed whenever the API auth is refreshed; and/or
  2. The stream rtsp links are the 1 hour “temporary” streams that are available from the Surveillance Station UI and these expire and aren’t refreshed. See here for info on share stream link expiry.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 3
  • Comments: 33 (17 by maintainers)

Most upvoted comments

I think I might have a lead on this. In the Surveillance Station UI, there is a screen to grab a stream URL:

Surveillance Station > IP Camera > Right click on a camera > Share Stream Path

One of the settings in there is to set how long this link should be valid for - 1 hour or forever. I had assumed that these links were generated when you click save and the validity period was specific for that URL however it looks as though the validity period is for all streams - including those generated by the API.

It is possible that this default setting may have changed in a recent SS release as I don’t remember changing it to 1 hour and the stream URL’s previously did work forever.

If you go into that “Share Stream Path” window and change the validity period to forever, this bug doesn’t seem to happen any more.

I still think that this is a bug with the integration as a “401 Unauthorized” should be detected, reauthenticated and a new stream URL pulled from the API. What are everyone’s thoughts on that?

Hello @mib1185, Thanks, I have be using release 2021.4.6 for about a month now and I have not observed any Synology issues.

Hello @mib1185, I just started logging now with your latest version. For your information I am running Home Assistant version 2021.2.3 and I have the stream validity duration set to 1 hour for all three cameras. I will attach the results in a few days.

Update: I have attached a file that includes the section of the log file from the initial start and with the sections of the log file that had a Synology error. I missed any errors from the February 21 because I forgot I was recording the log and re-started HA for other reasons. synology_dsm_log02-20-21.txt

Hi @mib1185, The test is in progress. I will attach a text file of the debug log when done.
Update: I did not get any Synology errors during the 24 hour period. I did get some ‘Exceptions’ with my driveway camera, but maybe they are because it disconnects once and a while when the microwave is running. I had the stream validity duration set to 1 hour for most the the 24 hour period. I did change to a 24 hour stream validity duration for a few hours. I have attached a shortened version of the log that includes the first ~ 15 minutes of the log and the areas with exceptions because the whole log is 6.5MB. Let me know if you would like the entire log file.

synology_dsm_log_short.txt.

Hello @mib1185, Thanks for the tip. The testing was very easy using that approach. I have using your modified synology_dsm component for 12+ hours with no issues. I was able to access the camera live feeds many hours after I set the stream validity to one hour. The camera live feeds also worked fine with the stream validity set to forever. All the other monitors worked without any issues. There were 2 errors in the 14 hour period. I have included my log for this period.

2021-02-08 20:33:50 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for synology_dsm which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2021-02-09 03:34:58 ERROR (MainThread) [custom_components.synology_dsm] Error fetching 2050RLRQDJ2ZF_central data: Error communicating with API: 12
2021-02-09 04:02:08 WARNING (Thread-8) [pychromecast.socket_client] [Family Room Audio Cast(192.168.1.63):8009] Heartbeat timeout, resetting connection
2021-02-09 04:13:33 WARNING (Thread-12) [pychromecast.socket_client] [Family Room TV(192.168.1.65):8009] Heartbeat timeout, resetting connection
2021-02-09 04:16:52 WARNING (Thread-10) [pychromecast.socket_client] [Basement speaker(192.168.1.164):8009] Heartbeat timeout, resetting connection
2021-02-09 04:26:49 WARNING (Thread-7) [pychromecast.socket_client] [Kitchen speaker(192.168.1.128):8009] Heartbeat timeout, resetting connection
2021-02-09 04:27:40 ERROR (Thread-14) [pychromecast.socket_client] [First Floor Group(192.168.1.64):42406] Error reading from socket.
2021-02-09 04:27:40 WARNING (Thread-14) [pychromecast.socket_client] [First Floor Group(192.168.1.64):42406] Error communicating with socket, resetting connection
2021-02-09 04:28:15 WARNING (Thread-13) [pychromecast.socket_client] [Four Season Porch(192.168.1.64):8009] Heartbeat timeout, resetting connection
2021-02-09 04:28:27 ERROR (Thread-14) [pychromecast.socket_client] [First Floor Group(192.168.1.63):42406] Error reading from socket.
2021-02-09 04:28:27 WARNING (Thread-14) [pychromecast.socket_client] [First Floor Group(192.168.1.63):42406] Error communicating with socket, resetting connection
2021-02-09 04:28:27 ERROR (Thread-14) [pychromecast.socket_client] [First Floor Group(192.168.1.64):42406] Failed to connect to service Google-Cast-Group-550783085ae24ebebceb28ff674e730f-1._googlecast._tcp.local., retrying in 5.0s
2021-02-09 04:28:39 WARNING (zeroconf-ServiceBrowser__googlecast._tcp.local._599) [homeassistant.components.cast.discovery] setup_internal_discovery failed to get info for 55078308-5ae2-4ebe-bceb-28ff674e730f, Google-Cast-Group-550783085ae24ebebceb28ff674e730f._googlecast._tcp.local.
2021-02-09 06:50:29 ERROR (MainThread) [custom_components.synology_dsm] Error fetching 2050RLRQDJ2ZF_central data: Error communicating with API: 12
2021-02-09 10:23:50 WARNING (Thread-10) [pychromecast.socket_client] [Basement speaker(192.168.1.164):8009] Heartbeat timeout, resetting connection
2021-02-09 10:25:46 ERROR (Thread-14) [pychromecast.socket_client] [First Floor Group(192.168.1.64):42406] Error reading from socket.
2021-02-09 10:25:46 WARNING (Thread-14) [pychromecast.socket_client] [First Floor Group(192.168.1.64):42406] Error communicating with socket, resetting connection
2021-02-09 10:25:52 ERROR (Thread-14) [pychromecast.socket_client] [First Floor Group(192.168.1.63):42406] Error reading from socket.
2021-02-09 10:25:52 WARNING (Thread-14) [pychromecast.socket_client] [First Floor Group(192.168.1.63):42406] Error communicating with socket, resetting connection
2021-02-09 10:26:04 WARNING (zeroconf-ServiceBrowser__googlecast._tcp.local._599) [homeassistant.components.cast.discovery] setup_internal_discovery failed to get info for 55078308-5ae2-4ebe-bceb-28ff674e730f, Google-Cast-Group-550783085ae24ebebceb28ff674e730f._googlecast._tcp.local.```

@mib1185 The short report is that I tested the fix and it works with the cameras set to 1 hour stream validity! I did not use the docker image. I am using a virtual environment running version 0.118.4. So the way I tested the fix was as follows:

  • I stopped Home Assistant.
  • I replaced the __init__.py, camera.py and switch.py files in the synology_dsm component folder with the ones from your link.
  • I deleted all the compiled .pyc files in the __pycache__ sub-directory.
  • I set the stream validity of all the cameras to one hour in the Synology Surveillance Station.
  • I then restarted Home Assistant.
  • When I accessed the camera live feeds many hours later they worked like when the stream validity was set to forever.

I did log some synology errors even when I was not accessing the live stream. I can attach my log since the reboot if you would like. I restarted Home-assistant again yesterday just to get a clean log. I have included the log errors associated with cameras and synology_dsm. The live stream feature has been solid when using the one hour stream validity setting.

2020-12-06 13:52:40 WARNING (SyncWorker_55) [urllib3.connectionpool] Connection pool is full, discarding connection: 192.168.1.194
2020-12-06 13:53:10 WARNING (SyncWorker_38) [urllib3.connectionpool] Connection pool is full, discarding connection: 192.168.1.194
2020-12-06 13:55:10 WARNING (SyncWorker_37) [urllib3.connectionpool] Connection pool is full, discarding connection: 192.168.1.194
2020-12-06 13:56:11 WARNING (SyncWorker_36) [urllib3.connectionpool] Connection pool is full, discarding connection: 192.168.1.194
2020-12-06 13:57:11 WARNING (SyncWorker_38) [urllib3.connectionpool] Connection pool is full, discarding connection: 192.168.1.194
2020-12-06 13:57:40 WARNING (SyncWorker_13) [urllib3.connectionpool] Connection pool is full, discarding connection: 192.168.1.194
2020-12-06 13:58:11 WARNING (SyncWorker_12) [urllib3.connectionpool] Connection pool is full, discarding connection: 192.168.1.194
2020-12-06 13:59:11 WARNING (SyncWorker_13) [urllib3.connectionpool] Connection pool is full, discarding connection: 192.168.1.194
2020-12-06 14:34:40 WARNING (SyncWorker_51) [urllib3.connectionpool] Connection pool is full, discarding connection: 192.168.1.194
2020-12-06 14:43:10 WARNING (SyncWorker_31) [urllib3.connectionpool] Connection pool is full, discarding connection: 192.168.1.194
2020-12-06 16:05:11 ERROR (MainThread) [homeassistant.helpers.entity] Update for camera.nas_front_door_2 fails
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 474, in async_device_update
raise exc
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/synology_dsm/camera.py", line 117, in async_update
await self.hass.async_add_executor_job(self._api.surveillance_station.update)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/api/surveillance_station/__init__.py", line 34, in update
self._cameras_by_id[camera_id].update_motion_detection(
KeyError: 12
2020-12-06 16:05:11 ERROR (MainThread) [homeassistant.helpers.entity] Update for camera.nas_driveway fails
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 474, in async_device_update
raise exc
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/synology_dsm/camera.py", line 119, in async_update
self._camera = await self.hass.async_add_executor_job(
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/api/surveillance_station/__init__.py", line 63, in get_camera
return self._cameras_by_id[camera_id]
KeyError: 2
2020-12-06 16:05:11 ERROR (MainThread) [homeassistant.helpers.entity] Update for camera.nas_back_door fails
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 474, in async_device_update
raise exc
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/synology_dsm/camera.py", line 117, in async_update
await self.hass.async_add_executor_job(self._api.surveillance_station.update)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/api/surveillance_station/__init__.py", line 34, in update
self._cameras_by_id[camera_id].update_motion_detection(
KeyError: 12
2020-12-06 22:35:13 ERROR (MainThread) [homeassistant.helpers.entity] Update for camera.nas_front_door_2 fails
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 474, in async_device_update
raise exc
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/synology_dsm/camera.py", line 117, in async_update
await self.hass.async_add_executor_job(self._api.surveillance_station.update)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/api/surveillance_station/__init__.py", line 49, in update
self._cameras_by_id[live_view_data["id"]].live_view.update(live_view_data)
KeyError: 1
2020-12-06 23:05:12 ERROR (MainThread) [homeassistant.helpers.entity] Update for camera.nas_driveway fails
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 474, in async_device_update
raise exc
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/synology_dsm/camera.py", line 117, in async_update
await self.hass.async_add_executor_job(self._api.surveillance_station.update)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/api/surveillance_station/__init__.py", line 34, in update
self._cameras_by_id[camera_id].update_motion_detection(
KeyError: 12
2020-12-06 23:05:12 ERROR (MainThread) [homeassistant.helpers.entity] Update for camera.nas_front_door_2 fails
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 474, in async_device_update
raise exc
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/synology_dsm/camera.py", line 117, in async_update
await self.hass.async_add_executor_job(self._api.surveillance_station.update)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/api/surveillance_station/__init__.py", line 34, in update
self._cameras_by_id[camera_id].update_motion_detection(
KeyError: 2
2020-12-06 23:05:13 ERROR (MainThread) [homeassistant.helpers.entity] Update for camera.nas_back_door fails
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 474, in async_device_update
raise exc
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/synology_dsm/camera.py", line 117, in async_update
await self.hass.async_add_executor_job(self._api.surveillance_station.update)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/api/surveillance_station/__init__.py", line 34, in update
self._cameras_by_id[camera_id].update_motion_detection(
KeyError: 12
2020-12-06 23:07:56 ERROR (Thread-12) [pychromecast.socket_client] [First Floor Group(192.168.1.63):42406] Error reading from socket.
2020-12-06 23:07:56 WARNING (Thread-12) [pychromecast.socket_client] [First Floor Group(192.168.1.63):42406] Error communicating with socket, resetting connection
2020-12-06 23:20:13 ERROR (MainThread) [homeassistant.helpers.entity] Update for camera.nas_driveway fails
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 474, in async_device_update
raise exc
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/synology_dsm/camera.py", line 117, in async_update
await self.hass.async_add_executor_job(self._api.surveillance_station.update)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/api/surveillance_station/__init__.py", line 34, in update
self._cameras_by_id[camera_id].update_motion_detection(
KeyError: 12
2020-12-06 23:20:13 ERROR (MainThread) [homeassistant.helpers.entity] Update for camera.nas_back_door fails
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 474, in async_device_update
raise exc
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/synology_dsm/camera.py", line 117, in async_update
await self.hass.async_add_executor_job(self._api.surveillance_station.update)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/api/surveillance_station/__init__.py", line 34, in update
self._cameras_by_id[camera_id].update_motion_detection(
KeyError: 12
2020-12-06 23:20:13 ERROR (MainThread) [homeassistant.helpers.entity] Update for camera.nas_front_door_2 fails
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 474, in async_device_update
raise exc
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/synology_dsm/camera.py", line 117, in async_update
await self.hass.async_add_executor_job(self._api.surveillance_station.update)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/api/surveillance_station/__init__.py", line 34, in update
self._cameras_by_id[camera_id].update_motion_detection(
KeyError: 12
2020-12-06 23:35:13 ERROR (MainThread) [homeassistant.helpers.entity] Update for camera.nas_back_door fails
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 474, in async_device_update
raise exc
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/synology_dsm/camera.py", line 119, in async_update
self._camera = await self.hass.async_add_executor_job(
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/api/surveillance_station/__init__.py", line 63, in get_camera
return self._cameras_by_id[camera_id]
KeyError: 1
2020-12-06 23:35:13 ERROR (MainThread) [homeassistant.helpers.entity] Update for camera.nas_front_door_2 fails
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 474, in async_device_update
raise exc
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/synology_dsm/camera.py", line 119, in async_update
self._camera = await self.hass.async_add_executor_job(
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/api/surveillance_station/__init__.py", line 63, in get_camera
return self._cameras_by_id[camera_id]
KeyError: 12
2020-12-06 23:35:13 ERROR (MainThread) [homeassistant.helpers.entity] Update for camera.nas_driveway fails
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 474, in async_device_update
raise exc
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/synology_dsm/camera.py", line 117, in async_update
await self.hass.async_add_executor_job(self._api.surveillance_station.update)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/api/surveillance_station/__init__.py", line 49, in update
self._cameras_by_id[live_view_data["id"]].live_view.update(live_view_data)
KeyError: 1
2020-12-06 23:50:13 ERROR (MainThread) [homeassistant.helpers.entity] Update for camera.nas_back_door fails
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 474, in async_device_update
raise exc
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/synology_dsm/camera.py", line 117, in async_update
await self.hass.async_add_executor_job(self._api.surveillance_station.update)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/api/surveillance_station/__init__.py", line 34, in update
self._cameras_by_id[camera_id].update_motion_detection(
KeyError: 12
2020-12-06 23:50:13 ERROR (MainThread) [homeassistant.helpers.entity] Update for camera.nas_front_door_2 fails
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 474, in async_device_update
raise exc
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/synology_dsm/camera.py", line 117, in async_update
await self.hass.async_add_executor_job(self._api.surveillance_station.update)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/api/surveillance_station/__init__.py", line 34, in update
self._cameras_by_id[camera_id].update_motion_detection(
KeyError: 12
2020-12-06 23:50:13 ERROR (MainThread) [homeassistant.helpers.entity] Update for camera.nas_driveway fails
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 474, in async_device_update
raise exc
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/synology_dsm/camera.py", line 119, in async_update
self._camera = await self.hass.async_add_executor_job(
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/api/surveillance_station/__init__.py", line 63, in get_camera
return self._cameras_by_id[camera_id]
KeyError: 2
2020-12-07 00:05:13 ERROR (MainThread) [homeassistant.helpers.entity] Update for camera.nas_driveway fails
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 474, in async_device_update
raise exc
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/synology_dsm/camera.py", line 117, in async_update
await self.hass.async_add_executor_job(self._api.surveillance_station.update)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/api/surveillance_station/__init__.py", line 34, in update
self._cameras_by_id[camera_id].update_motion_detection(
KeyError: 2
2020-12-07 00:05:13 ERROR (MainThread) [homeassistant.helpers.entity] Update for camera.nas_front_door_2 fails
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 474, in async_device_update
raise exc
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/synology_dsm/camera.py", line 117, in async_update
await self.hass.async_add_executor_job(self._api.surveillance_station.update)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/api/surveillance_station/__init__.py", line 34, in update
self._cameras_by_id[camera_id].update_motion_detection(
KeyError: 12
2020-12-07 00:05:13 ERROR (MainThread) [homeassistant.helpers.entity] Update for camera.nas_back_door fails
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 474, in async_device_update
raise exc
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/synology_dsm/camera.py", line 119, in async_update
self._camera = await self.hass.async_add_executor_job(
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/api/surveillance_station/__init__.py", line 63, in get_camera
return self._cameras_by_id[camera_id]
KeyError: 1
2020-12-07 00:35:07 ERROR (Thread-12) [pychromecast.socket_client] [First Floor Group(192.168.1.64):42406] Error reading from socket.
2020-12-07 00:35:07 WARNING (Thread-12) [pychromecast.socket_client] [First Floor Group(192.168.1.64):42406] Error communicating with socket, resetting connection
2020-12-07 00:35:13 ERROR (MainThread) [homeassistant.helpers.entity] Update for camera.nas_back_door fails
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 474, in async_device_update
raise exc
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/synology_dsm/camera.py", line 117, in async_update
await self.hass.async_add_executor_job(self._api.surveillance_station.update)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/api/surveillance_station/__init__.py", line 34, in update
self._cameras_by_id[camera_id].update_motion_detection(
KeyError: 12
2020-12-07 00:35:13 ERROR (MainThread) [homeassistant.helpers.entity] Update for camera.nas_driveway fails
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 474, in async_device_update
raise exc
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/synology_dsm/camera.py", line 119, in async_update
self._camera = await self.hass.async_add_executor_job(
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/api/surveillance_station/__init__.py", line 63, in get_camera
return self._cameras_by_id[camera_id]
KeyError: 2
2020-12-07 00:35:13 ERROR (MainThread) [homeassistant.helpers.entity] Update for camera.nas_front_door_2 fails
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 474, in async_device_update
raise exc
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/synology_dsm/camera.py", line 117, in async_update
await self.hass.async_add_executor_job(self._api.surveillance_station.update)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/api/surveillance_station/__init__.py", line 34, in update
self._cameras_by_id[camera_id].update_motion_detection(
KeyError: 12
2020-12-07 01:20:12 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/synology_dsm/__init__.py", line 487, in async_update
await self._hass.async_add_executor_job(
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/synology_dsm.py", line 336, in update
self._surveillance.update()
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/api/surveillance_station/__init__.py", line 34, in update
self._cameras_by_id[camera_id].update_motion_detection(
KeyError: 2
2020-12-07 02:05:12 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/synology_dsm/__init__.py", line 487, in async_update
await self._hass.async_add_executor_job(
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/synology_dsm.py", line 336, in update
self._surveillance.update()
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/api/surveillance_station/__init__.py", line 34, in update
self._cameras_by_id[camera_id].update_motion_detection(
KeyError: 2
2020-12-07 02:20:12 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/synology_dsm/__init__.py", line 487, in async_update
await self._hass.async_add_executor_job(
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/synology_dsm.py", line 336, in update
self._surveillance.update()
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/api/surveillance_station/__init__.py", line 34, in update
self._cameras_by_id[camera_id].update_motion_detection(
KeyError: 12
2020-12-07 03:05:13 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/synology_dsm/__init__.py", line 487, in async_update
await self._hass.async_add_executor_job(
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/synology_dsm.py", line 336, in update
self._surveillance.update()
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/api/surveillance_station/__init__.py", line 34, in update
self._cameras_by_id[camera_id].update_motion_detection(
KeyError: 2
2020-12-07 03:20:13 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/synology_dsm/__init__.py", line 487, in async_update
await self._hass.async_add_executor_job(
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/synology_dsm.py", line 336, in update
self._surveillance.update()
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/api/surveillance_station/__init__.py", line 34, in update
self._cameras_by_id[camera_id].update_motion_detection(
KeyError: 12
2020-12-07 03:25:45 WARNING (Thread-14) [pychromecast.socket_client] [Family Room Audio Cast(192.168.1.63):8009] Heartbeat timeout, resetting connection
2020-12-07 03:50:13 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/synology_dsm/__init__.py", line 487, in async_update
await self._hass.async_add_executor_job(
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/synology_dsm.py", line 336, in update
self._surveillance.update()
File "/srv/homeassistant/lib/python3.8/site-packages/synology_dsm/api/surveillance_station/__init__.py", line 49, in update
self._cameras_by_id[live_view_data["id"]].live_view.update(live_view_data)
KeyError: 1