Synology Surveillance Station IP Camera

Any word on this component getting updated? The github issues seem to have gone quiet. Happy to help test anything that needs testing. I’m running the SS beta version

Hi @pergola.fabio ,

What is the method to use the custom_component of synology camera that permit use the home mode?

I mean, in the custom_component folder, what folder i need to create? “camera” folder? “synology” folder?

And what exacly *.py file with the init.py empty file?

thanks

not sure, i dont use the custom component anymore for home mode
stuff changed in latest releases of HA? but if you scroll like 5 posts above, he got it working by

/config/custom_components/synology

so probably , its camera.py , so you also need a manifest.json file now

So if you don’t use home mode by custom_component, do you mean that you don’t use home mode option of synology?

i use home_mode, but just in another way, i call a python script

this one :

Thanks for this. Might get it going when I get node red setup done.

I use the same script, but it doesn’t always work: I have timeout:

requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='mySynoHost', port=5001): Read timed out. (read timeout=15)

I ran this script directly from the Docker instance

time /usr/local/bin/python3 syno.py status
real	0m 16.77s
user	0m 3.05s
sys	0m 0.20s

The real time varies from 15 to 28 sec.

Anyone encountered the same ?

1 Like

Yes, I got exactly the same “problem” since weeks. I can’t even view my camera in HA anymore because of timeouts.

This is a custom component that can be added to home assistant, it provides a switch that can be used to control the home mode state of Synology Surveillance Station. Check it out here : https://github.com/RaysceneNS/SurveillanceStationHomeModeSwitch

2 Likes

Hello @RaysceneNS,
I tried your custom component to replace my complex integration from HA to SS Home Mode (which is working and based on this thread (https://community.synology.com/enu/forum/17/post/109034 where I use the SS Web API ).
Link to Syno Surveillance Station Web API v 3.3: https://global.download.synology.com/download/Document/Software/DeveloperGuide/Package/SurveillanceStation/All/enu/Surveillance_Station_Web_API.pdf
Unfortunately it seems this custom component is calling a not existing attribute “set_home_mode”
I am using SS latest version.

What would you suggest ?
Thanks!

Hello @RaysceneNS,
I tried your custom component to replace my complex integration from HA to SS Home Mode (which is working and based on this thread (https://community.synology.com/enu/forum/17/post/109034 where I use the SS Web API ).
Link to Syno Surveillance Station Web API v 3.3: https://global.download.synology.com/download/Document/Software/DeveloperGuide/Package/SurveillanceStation/All/enu/Surveillance_Station_Web_API.pdf
Unfortunately it seems this custom component is calling a not existing attribute “set_home_mode”
I am using Syno SS latest version.

What would you suggest ?
Thanks!

Hi @gerosaf,

That issue is due to a dependency conflict, the synology integration included with HA links to an older version of [email protected], this doesn’t have the required methods to set the home mode. I’ve updated my custom component on github to remove this dependency, until home assistant is updated to use [email protected].

2 Likes

Great job @RaysceneNS,
I am testing it and it seems to work great!
Thanks a lot.

Hi @RaysceneNS,
recently your custom component fails to load after a HA restart. I restarted more times and the issue persist. Few days ago it happened sometime and I solved deleting the pycache folder. Now no more.

This is the reason, I guess, for failing:
“requests.exceptions.ReadTimeout: HTTPSConnectionPool(host=‘192.168.1.2’, port=5001): Read timed out. (read timeout=5)”
Obviously I didn’t changed the IP or port.
Could you please help? THANKS!

The entire log is:

"2020-01-23 14:18:19 ERROR (MainThread) [homeassistant.components.switch] Error while setting up platform synologysurveillance
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py”, line 421, in _make_request
six.raise_from(e, None)
File “”, line 3, in raise_from
File “/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py”, line 416, in _make_request
httplib_response = conn.getresponse()
File “/usr/local/lib/python3.7/http/client.py”, line 1344, in getresponse
response.begin()
File “/usr/local/lib/python3.7/http/client.py”, line 306, in begin
version, status, reason = self._read_status()
File “/usr/local/lib/python3.7/http/client.py”, line 267, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), “iso-8859-1”)
File “/usr/local/lib/python3.7/socket.py”, line 589, in readinto
return self._sock.recv_into(b)
File “/usr/local/lib/python3.7/site-packages/urllib3/contrib/pyopenssl.py”, line 326, in recv_into
raise timeout(“The read operation timed out”)
socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/requests/adapters.py”, line 449, in send
timeout=timeout
File “/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py”, line 720, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File “/usr/local/lib/python3.7/site-packages/urllib3/util/retry.py”, line 400, in increment
raise six.reraise(type(error), error, _stacktrace)
File “/usr/local/lib/python3.7/site-packages/urllib3/packages/six.py”, line 735, in reraise
raise value
File “/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py”, line 672, in urlopen
chunked=chunked,
File “/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py”, line 423, in _make_request
self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
File “/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py”, line 331, in _raise_timeout
self, url, “Read timed out. (read timeout=%s)” % timeout_value
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host=‘192.168.1.2’, port=5001): Read timed out. (read timeout=5)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/config/custom_components/synologysurveillance/switch.py”, line 73, in setup_platform
timeout=timeout
File “/config/custom_components/synologysurveillance/switch.py”, line 146, in init
self._initialize_api_sid()
File “/config/custom_components/synologysurveillance/switch.py”, line 172, in _initialize_api_sid
response = self._get_json_with_retry(api[‘url’], payload)
File “/config/custom_components/synologysurveillance/switch.py”, line 204, in _get_json_with_retry
return self._get_json(url, payload)
File “/config/custom_components/synologysurveillance/switch.py”, line 210, in _get_json
response = requests.get(url, payload, timeout=self._timeout, verify=self._verify_ssl)
File “/usr/local/lib/python3.7/site-packages/requests/api.py”, line 75, in get
return request(‘get’, url, params=params, **kwargs)
File “/usr/local/lib/python3.7/site-packages/requests/api.py”, line 60, in request
return session.request(method=method, url=url, **kwargs)
File “/usr/local/lib/python3.7/site-packages/requests/sessions.py”, line 533, in request
resp = self.send(prep, **send_kwargs)
File “/usr/local/lib/python3.7/site-packages/requests/sessions.py”, line 646, in send
r = adapter.send(request, **kwargs)
File “/usr/local/lib/python3.7/site-packages/requests/adapters.py”, line 529, in send
raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host=‘192.168.1.2’, port=5001): Read timed out. (read timeout=5)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 158, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File “/usr/local/lib/python3.7/asyncio/tasks.py”, line 442, in wait_for
return fut.result()
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/synologysurveillance/switch.py”, line 76, in setup_platform
_LOGGER.exception(“Error when initializing api”)
NameError: name ‘_LOGGER’ is not defined"

Hi @RaysceneNS,
hoping everything is fine!

I was running your Home Mode switch for Synology Surveillance Station for months, but recently there is no way to have it working anymore.
Are you aware of any change that may have impacted it? Any chance to fix it?
Let me know which info you need from me for helping you.

Thanks!

Hey @gerosaf,

I’m not aware of any breaking changes in the switch, I have it running here fine on HA v108.9.
Maybe you can track down an error in the logs? Also might help to know which version of HA you have there too.

cheers

Thanks @RaysceneNS, I am running 0.110.3, but had issues also with previous versions.
I have a ERROR in the log, may I post it here, would you have a look at it ?
It’s a Read Timeout. Few time it’s working after a reboot, most is not.

I have also another integration (Synology DSM) connecting at same IP/port during startup. Might it be the issue?

Cheers

I would try setting an explicit timeout in seconds for the switch, as it sounds like the default value of 5 seconds isn’t quite long enough for your synology to respond, this will be at the same level as the url is set in the config file, I suggest doubling the timeout to say 10 seconds, like so:

`

  • platform: synologysurveillance
    timeout: 10
    …etc…
    `

Very good suggestion, it seems to be working now!
Thanks again!

@gerosaf and @RaysceneNS can you share you config?
Thanks