Synology Surveillance Station IP Camera

After upgrade to version 0.32.1, Synology plugin broke again:

16-11-06 13:10:43 homeassistant.components.camera: Error while setting up platform synology
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 143, in _async_setup_platform
entity_platform.async_add_entities, discovery_info
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/camera/synology.py", line 75, in async_setup_platform
verify_ssl=config.get(CONF_VERIFY_SSL)
  File "/srv/homeassistant/lib/python3.4/site-packages/aiohttp/client.py", line 403, in get
**kwargs))
TypeError: _request() got an unexpected keyword argument 'verify_ssl'

Actual config (was working in previous version):

camera:
  - platform: synology
    url: https://192.168.2.2:5001
    username: hass
    password: XXXXXXXXX
    valid_cert: false

I experience the same issue, synology camera broken after upgraded to 0.32.1

pi@raspberrypi:~ $ more /home/hass/.homeassistant/home-assistant.log | grep synology
16-11-07 14:33:13 homeassistant.components.camera: Error while setting up platform synology
File “/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/camera/synology.py”, line 75, in async_setup_platform

Looks like some things got changed with the migration to async and aiohttp. I’ve got a fix working on my dev system and will push the new changes to HA once I do some more testing and clean up the code.

I’ve got a fix in the works. I need to do some more testing but it should be ready soon.

Thanks,

let me know if i can help with some testing !

The synology component should be working again for both valid and self-signed SSL certs in 0.32.3. Thanks to pvizeli for working on the fix.

I’ve noticed that I get full motion video if the cameras are setup as mjpeg streams and the slower 1-2FPS when they are setup as h.264 streams. I’m not sure if this is an issue with how we’re pulling the video or a synology issue. If you need full motion video try changing the cameras to mjpeg.

Thanks,
i confirm this is working perfect.
One remark, for self-signed you need to use

verify_ssl: false

not valid_cert or valid_ssl (this is in the doc)

After upgrade to 0.33, again issues:

16-11-11 10:21:24 homeassistant.components.camera.synology: Error on https://192.168.2.2:5001/webapi/query.cgi
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.4/site-packages/aiohttp/connector.py", line 601, in _create_direct_connection
    local_addr=self._local_addr)
  File "/usr/lib/python3.4/asyncio/base_events.py", line 588, in create_connection
    sock, protocol_factory, ssl, server_hostname)
  File "/usr/lib/python3.4/asyncio/base_events.py", line 610, in _create_connection_transport
    yield from waiter
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/asyncio/selector_events.py", line 727, in _on_handshake
    self._sock.do_handshake()
  File "/usr/lib/python3.4/ssl.py", line 804, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)

Hey guys, new here.
Quick question about the add-on. I’m using two-factor auth on my Syno and it’s enabled for all admin accounts (and can’t be disabled, per-account). I’ve created a Syno user specifically for this add-on, to pull in my camera feeds, but i’m unsure how to configure the Syno account to access Surveillance Station, without being in the admin group, and without two-factor auth.

If I remove the user from the admin group (disabling two-factor auth) I can’t login with the user to access Surveillance Station.

Any suggestions? How do you guys have this setup?

For me, when I go in to edit a user one of the tabs on the top is ‘Applicatinos’. I can add application access independent of the user group they are assigned to. I’m not dual DFA so I don’t know how/if that will impact anything, but for me I can allow a user in any group to access SS no problem.

Thanks for the help.
I actually just answered my own question. So if you have two-factor auth enabled…
Add a new syno user, create a password, etc. Add them to the users group (not the admin group), then under applications, disable all, then explicitly allow access to Desktop, and Surveillance Station. This will allow the new syno user to login via the web-interface, and only access Surveillance Station.

Now if I could only figure out this timeout issue:

16-12-03 13:17:34 homeassistant.components.camera.synology: Error on https://synoip:5001/webapi/entry.cgi
Traceback (most recent call last):
File “/usr/local/lib/python3.5/dist-packages/homeassistant/components/camera/synology.py”, line 250, in async_camera_image
params=image_payload
File “/usr/local/lib/python3.5/dist-packages/async_timeout/init.py”, line 44, in exit
raise asyncio.TimeoutError from None
concurrent.futures._base.TimeoutError

I’m on 33.4 and it seems to be working for me. Are you still having this issue?

Hmm. Not sure why the connection would be timing out. Are HA and the Synology in the same network or is this connecting over the internet? Do you get any video from the cameras or does it only timeout?

Yep, HA and Synology are on the same network, connected via an ethernet switch, I do get an image in HA, it looks to be about a 10sec delay. Not sure why I’m getting that error, but also getting an image. Seems like I should be getting one or the other, not both. Can the timeout be configured somewhere?

The timeout is hardcoded as 5 seconds in the synology.py file. You can go in there and change it if you want. If you’re only getting a single (or a few) instances of the error I wouldn’t worry about it. If the camera image is showing an error more often then a valid image then I’d dig into it. Is the camera you have using h.264 as the codec or mjpeg? I’ve had better success with low latency and higher FPS video with mjpeg. H.264 works but seems to have higher delay and a lower live FPS.

Thanks for the assistance, I think I figured out my problem. The camera that was giving me issues is an older Foscam camera. So i’m using this Synology Surveillance Station platform for most of my cameras, but connecting to the older foscam camera (which I’ll be replacing soon), using the foscam platform directly. This seems to work beautifully. Any chance you could explain the “whitelist” option? I’ve tried every variation I could think of for the camera name, but none of them seem to work. In most cases if the whitelist option was specified, it seemed to blacklist all cameras.

1 Like

like @xstrex I also have issues with the whitelist option, I also checked that I was using the same name…

Sorry for the late reply.
Yes it is working again for me.
Many thanks!

I cannot set up my synology.
I had set up a new intallation of All-in-one installer 3 days ago with the newest Home-Assistant Version.
The message in home-assistant.log:

16-12-31 17:03:58 homeassistant.components.camera: Error while setting up platform synology
Traceback (most recent call last):
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 145, in _async_setup_platform
    entity_platform.async_add_entities, discovery_info
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/camera/synology.py", line 107, in async_setup_platform
    syno_auth_url
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/camera/synology.py", line 180, in get_session_id
    return auth_resp['data']['sid']
KeyError: 'data'

I have a DS1815+ with Surveillance Station 7.1-4155.