[Synology DSM] Camera stream not working

I see this same behavior. I have 4 built in NICs and 2 10Gb via add-in card. I use 1 of the 1Gbps built in NICs for a direct connect to a backup NAS and the RTSP stream tries to use this instead of the correct 10Gbps NIC thats connected to the main network. Disabling the 1Gbps NIC let’s it switch to the right NIC but I need that one back on and no setting changes in DSM seem to make a difference.

For some reason the HA integration is not using the configured IP address and is instead gathering the IP from DSM somehow and choosing the wrong one (first found?) when multiple are present.

In my case, it looks like, the HA integration is getting the IP-address reported from the Synology Surveillance Station IP Camera it’s RTSP Stream Path.

I have no clue how this can be changed/altered in Synology’s Surveillance Station…

For the time-being I have made a dedicated exception in my Synology NAS firewall and it is working.

Interesting, I’m getting a 401 for normal cameras as well. Used to work great before. I do see the image preview, but when I try to open the stream I get a 401. I can login to Surveilance Station and watch them just fine. Any idea what might be wrong here?

I can confirm the same error message.


Logger: libav.rtsp
Source: components/stream/worker.py:71 
First occurred: 22:28:30 (2 occurrences) 
Last logged: 22:28:30
method DESCRIBE failed: 401 Unauthorized

If you restart the integration of Synology DSM in HA, the problem is temporarily resolved and you can use the stream from the cameras. However, this doesn’t work for long and the problem occurs again. I think the problem is in HA.

1 Like

Same problem here in 0.117

Anyone found a workaround for this? It’s producing 10 errors per hour or so.

Hi - me too

Its riddled with bugs to the point its crashing my server I have now removed it as an integration. Preformatted text

Logger: homeassistant.config_entries
Source: config_entries.py:247
First occurred: 22 November 2020, 17:46:07 (2541 occurrences)
Last logged: 11:17:19

Config entry for synology_dsm not ready yet. Retrying in 5 seconds
Config entry for synology_dsm not ready yet. Retrying in 10 seconds
Config entry for synology_dsm not ready yet. Retrying in 20 seconds
Config entry for synology_dsm not ready yet. Retrying in 40 seconds
Config entry for synology_dsm not ready yet. Retrying in 80 seconds

For example my Synology log has 5 connections to the server at the same time and I mean to the second

Good News: I removed the Integration as mentioned and added it manually. Currently I just see 2 logins and will monitor it for next few hours to see what happens. I did also need to reboot the Synology first as it was almost useless.

UPDATE: Once again it lost all camera entities they come in and out as though the entire integration fails and removes all the related entities (40). Again it took out my Synology server and this was after I disabled Deep sleep and HDD hibernation time set to [none]. This made no difference. Strangely I removed the manual from configuration.yaml, restarted the server and it was still in the Integrations so I have now removed it as once again it started generating errors in both Hassio log and Synology log. In the Synology log it just has thousands of "logged in successfully via [DSM].

I manually put the deprecated Synology integration back in configuration.yaml, which still works fine. Has proved to be stable for the past year or so. Will stick to this, while it’s still working, until the official DSM integration is fixed.

Hello,
Same issues with official DSM integration.
Deprecated integration works with 118.X versions ?
With manual integration you can’t use 2 factor authentification ?

Seems 2FA is not possible with the deprecated version. On the other hand, you can use SSL and your Synology user doesn’t have to have admin rights.

I have created a separate user with admin rights in synology. Unfortunately, the error messages mentioned keep coming back. Is there no solution?

I can confirm that for me the I also often get plenty of errors in the logs when trying to view live streams of the camera’s.

Check out this issue on Github: https://github.com/home-assistant/core/issues/43080

The answer from Nick Adams works for me (https://github.com/home-assistant/core/issues/43080#issuecomment-729348912). "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."

EDIT: Also, I am using the Synology integration!

@quizzical, to be clear you are getting the same errors as shown in [Synology DSM] Camera stream not working ?

For the record, I just reloaded the Synology DSM integration from the Integrations page. For me it was not necessary to restart my whole HA instance. After ± 1 hour my streams were not working, hence I checked the log files and saw the errors/notices shown in the reaction by Maverick. When I simply reloaded the integration the streams worked again. With the “valid lifespan” fix, there have not been any errors nor have the streams stopped working. Hope this info helps.

Thank you! That makes a lot of sense and so far I’m able to replicate your results. The camera that I had set to forever yesterday is still working. I’ve set the other ones to forever as well now and have only reloaded the integration.
I does still faill sometimes, here is an error I still get:

Logger: frontend.js.latest.202012120
Source: components/system_log/__init__.py:193
First occurred: 10:00:31 (1 occurrences)
Last logged: 10:00:31

https://MYURL/frontend_latest/chunk.a01fc49cb6fa229a7d98.js:2:145490 Uncaught InvalidStateError: Failed to read the 'buffered' property from 'SourceBuffer': This SourceBuffer has been removed from the parent media source.

It can also often take 20 seconds to load the camera stream, as a result when the livestream loads it has a strong delay.

Offtopic: do you know how I can open the livestream directly, without having to click the still picture? I want to create an actionable notification for my smartphone (when I deteced motion while the house is supposed to be empty) and if I click on it, it should redirect me to the livestream.

Haven’t seen those error messages so honestly I don’t know. For movement and sound detection I’ve created separate sensors (see code below). A direct link I haven’t used and thus I have to look into it, but for me personally, if I open my HA the camera is displayed in my dashboard so that is sufficient for me.

  - platform: rest 
    resource: http://<ip>:88/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=<user>&pwd=<password>
    method: GET
    name: "Camera Sound"
    scan_interval: 3
    value_template: >
      {% set status = value | regex_findall_index('Alarm>(\d+)</sound') %}
      {% if status == "0" %}
        Disabled
      {%- elif status == "1" -%}
        None
      {%- elif status == "2" -%}
        Detected
      {% else %}
        Not Determined
      {%- endif -%}

  - platform: rest 
    resource: http://<ip>:88/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=<user>&pwd=<password>
    method: GET
    name: "Camera Motion"
    scan_interval: 3
    value_template: >
      {% set status = value | regex_findall_index('Alarm>(\d+)</motion') %}
      {% if status == "0" %}
        Disabled
      {%- elif status == "1" -%}
        None
      {%- elif status == "2" -%}
        Detected
      {% else %}
        Not Determined
      {%- endif -%}

Thank you! The motion sensor provided by the synology integration works perfect for me, so I don’t need to use the code you have for that. I was very intrigued by your code for getting audio detection. Based on some searching I have the impression that you have Foscam cameras and that my hikvision camera’s do not support audio detection…

Hi,

I had the same problem, I mean my Reolink cam doesn’t appear live in Home Assistant on my Tablet only (ok on my PC and my Pixel 3a phone). I tried many manipulations to solve it and I finally found one solution for me :

So I set this option to the lowest resolution and now it works fine even it is not the best resolution I would like have…

Sorry it is in french but I’m sure you will find the option :wink:

If it can help

1 Like

Even with your tip I get:
Error starting stream, see logs for details (Stream never started)

image

Think I get the issue:

Although I do see the picture(s) of the cam in lovelace, the stream is not working. I added the synology on the WAN IP (via DNS) but the stream is caught on the “real” IP adress of the camera and homeassistant can’t reach that…

Any thoughts?