Binding Request: Synology Surveillance Station

Perhaps you should use both: oversensible motion detection of SS and parallel recording (and reporting) through this binding according to your event: if SS is recording already (in most cases), you’ll have your timewarp, otherwise you’ll trigger a new record with no timewarp. SS will then record often, but it’s just some more data in your RAID, which will be purged automatically.

Hopefully someone can help me here…
Since i went from 2.5.0 M1 (where it worked) to 2.5.0 M2 i can’t get this binding to work anymore

my setup:
Synology DS1517+
running openhab in docker
mapped addons/userdata/conf to folders on the Syno

what i have done so far:

-logging:
org.eclipse.smarthome = DEBUG
org.openhab = DEBUG

copied the JAR file from my windows system to the addons folder -> no log entries, nothing shown in “bundle:list” on karaf
copied the JAR file in a putty session with docker cp -> no log entries, nothing shown in “bundle:list” on karaf
checked rights with ls -l, saw that the file is owned by root:root and has no rights assigned at all, so i did a
chown openhab:openhab org.openhab.[...]
chmod 777 org.openhab.[...]
result was the same, no log entries, nothing in bundle:list
Also activated legacy bindings in Paper UI -> Configuration -> System -> Add-On Management, also nothing

Has anyone another idea or can point me in the right direction? Or is the binding just not working anymmore in M2?

Regards,
Raven

Hi Raven!
I’ve just tried fresh 2.5.0.M2 on Windows and it worked “out of the box”…
You don’t need to enable legacy support anyway and you should see the binding in your Karaf with:
bundle:list | grep Syno
If you don’t, there is perhaps something wrong with your Docker configuration.
You may try to install any other binding from /addons and see whether it works.
BR Pav

Just created a new, clean container and still i am not getting any log entries.
bundle:list | grep Syno
gives me nothing

i just don’t understand why it has been working and now is not on a fresh container.
I would have expected that - at least - i see something in the log-files but it seems OH doesn’t even “know” there is a .jar-File in the addons folder

guess i have to do some more research regarding my docker container…

ok, i resolved the issue and have your binding working again…

i removed the mount path to /openhab/addons from my docker config and started the container.
After that i did a
sudo docker cp org.openhab.binding.synologysurveillancestation-2.5.0-.jar SNAPSHOT openhab-openhab1:/openhab/addons
the file still had root as owner so i did a restart of the container and the file was now owned by openhab:openhab but without any rights.
i then did a chmod 777 org.openhab.binding.synonlogysurveillancestation-2.5.0-SNAPSHOT.jar
and the binding was installed flawlessly…

so it seems it has something to do with the configuration / mount path of docker

Glad you’ve got it working and thanks for reporting your solution!
It looks like an old docker issue and might help other people:

Hi,

today I switched from 2.5.0-M1 to -M2. Doing this I’ve update the binding to latest version 2.5.0-SNAPSHOT.jar, have been using version 2.4.0-SNAPSHOT.jar before. After deleting and adding the binding through PaperGUI the bridge is up and running showing status “online” as well as I’m able to parse for the channels.

Yet as soon as I enable any of the channels the bridge stops with status “communication error”:

2019-09-03 11:27:10.576 [.ItemChannelLinkAddedEvent] - Link ‘HomeMode-synologysurveillancestation:station:9a8e2514:homemode’ has been added.
2019-09-03 11:27:10.596 [hingStatusInfoChangedEvent] - ‘synologysurveillancestation:station:9a8e2514’ changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Thread HomeMode

There is not any error message to find in the logs. Any advise appreciated!

Thanks & best regards

Hi Thomas,

could you please check your running version and whether the binding is unique.
Executing this command in your Karaf:

bundle:list | grep Syno

should produce following output:

999 x Active x  80 x 2.5.0.a37             x SynologySurveillanceStation Binding

If you have two different versions, you have to uninstall the old one using

bundle:uninstall XXX

where XXX is the number of the old version (first number in the line above).

BR Pav

Hi Pav,

I can confirm only new version is active:

openhab> bundle:list | grep Syno                                                                                               
202 │ Active │  80 │ 2.5.0.a37             │ SynologySurveillanceStation Binding                                               
openhab>                                                                                                                       

I’ve also cleaned (deleted) cache and tmp folder.

I’m using Docker container on Synology NAS (amd64).

Thanks!

Hm… Have you tried to add your camera first and enable its channels? Perhaps it is some home mode related error… If nothing helps, please enable debug logging for more information:

log:set DEBUG org.openhab.binding.synologysurveillancestation

Hi Pav,

I did quite some debug, but I don’t get it to work. I even uninstalled the bundle and re-installed it. Situation is unchanged. Here some debug info:

Adding the thing from the binding works fine, linking channel “sid” workd too, yet “sid” stays empty?!? Linking channel “homemode” leads to the communication error.

openhab.log:

2019-09-03 18:01:15.550 [DEBUG] [ternal.webapi.request.SynoApiRequest] - https://192.168.178.62:5001/webapi/auth.cgi?api=SYNO.API.Auth&version=2&method=Login&_sid=&passwd=
PssWrd&session=SurveillanceStation&format=sid&account=account
2019-09-03 18:01:15.589 [DEBUG] [.binding.synologysurveillancestation] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.discovery.DiscoveryService}={service.id=48
9, service.bundleid=202, service.scope=singleton} - org.openhab.binding.synologysurveillancestation
2019-09-03 18:01:15.618 [DEBUG] [ncestation.handler.SynoBridgeHandler] - Initialize thing: Bridge für die Synology API::synologysurveillancestation:station:DS416p
2019-09-03 18:01:15.625 [DEBUG] [ternal.webapi.request.SynoApiRequest] - https://192.168.178.62:5001/webapi/entry.cgi?api=SYNO.SurveillanceStation.Camera&version=8&method=
List&_sid=&blIncludeDeletedCam=false&blPrivilege=false&privCamType=true&blFromCamList=true&streamInfo=true&basic=true&cameraIds=
2019-09-03 18:04:42.938 [DEBUG] [tation.internal.thread.SynoApiThread] - Thread: HomeMode tick
2019-09-03 18:04:42.940 [DEBUG] [ternal.webapi.request.SynoApiRequest] - https://192.168.178.62:5001/webapi/entry.cgi?api=SYNO.SurveillanceStation.HomeMode&version=1&metho
d=GetInfo&_sid=
2019-09-03 18:04:45.634 [DEBUG] [tation.internal.thread.SynoApiThread] - Thread: HomeMode tick
2019-09-03 18:04:45.636 [DEBUG] [ternal.webapi.request.SynoApiRequest] - https://192.168.178.62:5001/webapi/entry.cgi?api=SYNO.SurveillanceStation.HomeMode&version=1&metho
d=GetInfo&_sid=
2019-09-03 18:04:48.660 [DEBUG] [tation.internal.thread.SynoApiThread] - Thread: HomeMode tick
2019-09-03 18:04:48.660 [DEBUG] [ternal.webapi.request.SynoApiRequest] - https://192.168.178.62:5001/webapi/entry.cgi?api=SYNO.SurveillanceStation.HomeMode&version=1&metho
d=GetInfo&_sid=

events.log:

2019-09-03 18:01:15.602 [hingStatusInfoChangedEvent] - 'synologysurveillancestation:station:DS416p' changed from UNINITIALIZED to INITIALIZING
2019-09-03 18:01:15.623 [hingStatusInfoChangedEvent] - 'synologysurveillancestation:station:DS416p' changed from INITIALIZING to ONLINE
2019-09-03 18:01:42.093 [.ItemChannelLinkAddedEvent] - Link 'synologysurveillancestation_station_DS416p_sid-synologysurveillancestation:station:DS416p:sid' has been added.
2019-09-03 18:01:42.096 [vent.ItemStateChangedEvent] - synologysurveillancestation_station_DS416p_sid changed from NULL to
2019-09-03 18:04:42.939 [.ItemChannelLinkAddedEvent] - Link 'synologysurveillancestation_station_DS416p_homemode-synologysurveillancestation:station:DS416p:homemode' has been added.
2019-09-03 18:04:42.966 [hingStatusInfoChangedEvent] - 'synologysurveillancestation:station:DS416p' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Thread HomeMode

Executing the HTTP request in a browser works fine - getting messages with “success”:true.

Adding Camera also leads to communication error. I only need/want the HomeMode switch. Any idea what to try next?

Thanks!

Don’t see any incoming communication… are you sure your docker configuration allows usage of ports 5000 / 5001 and can access DS?

Hi Pav,

thanks for pointing me in the right direction - I got it fixed. Problem was with the SSL certificate on the Synology which is not matching the IP used but the host name only. Switching to nonSSL fixed the problem, see now inbound traffic as well as can enable the HomeMode channel. For some reason using the host name does not work - have to investigate…

Thanks for your help! I’m happy with your binding on OH!

Best regards, Thomas

1 Like

Hey Pavion,

thanks for your work. Do you think the binding is now in a state where it would make sence to get it merged to reach a broader audience? I’d be happy to get updates directly with new snapshots :grinning:

Best Björn

Hi Björn! The binding itself is stable almost since the beginning :slight_smile:
The project is being kept low though as I don’t have much time nowadays to deal with a broader audience, feature requests or issues. However it’s a nice thought…
BR Pav

I updated to 0.37: Introduce motion detection parameter

I am getting tons of messages in my logfile, any ideas?

2019-09-24 23:16:36.952 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler SynoBridgeHandler of thing synologysurveillancestation:station:1680o1n893301 tried checking if channel homemode is linked although the handler was already disposed.

2019-09-24 23:16:39.953 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler SynoBridgeHandler of thing synologysurveillancestation:station:1680o1n893301 tried checking if channel homemode is linked although the handler was already disposed.

2019-09-24 23:16:42.956 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler SynoBridgeHandler of thing synologysurveillancestation:station:1680o1n893301 tried checking if channel homemode is linked although the handler was already disposed.

2019-09-24 23:16:45.962 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler SynoBridgeHandler of thing synologysurveillancestation:station:1680o1n893301 tried checking if channel homemode is linked although the handler was already disposed.

2019-09-24 23:16:48.967 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler SynoBridgeHandler of thing synologysurveillancestation:station:1680o1n893301 tried checking if channel homemode is linked although the handler was already disposed.

2019-09-24 23:16:51.969 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler SynoBridgeHandler of thing synologysurveillancestation:station:1680o1n893301 tried checking if channel homemode is linked although the handler was already disposed.

2019-09-24 23:16:54.972 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler SynoBridgeHandler of thing synologysurveillancestation:station:1680o1n893301 tried checking if channel homemode is linked although the handler was already disposed.

2019-09-24 23:16:57.975 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler SynoBridgeHandler of thing synologysurveillancestation:station:1680o1n893301 tried checking if channel homemode is linked although the handler was already disposed.

2019-09-24 23:17:00.980 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler SynoBridgeHandler of thing synologysurveillancestation:station:1680o1n893301 tried checking if channel homemode is linked although the handler was already disposed.

2019-09-24 23:17:03.984 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler SynoBridgeHandler of thing synologysurveillancestation:station:1680o1n893301 tried checking if channel homemode is linked although the handler was already disposed.

2019-09-24 23:17:06.988 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler SynoBridgeHandler of thing synologysurveillancestation:station:1680o1n893301 tried checking if channel homemode is linked although the handler was already disposed.

Here some ideas:

  • if you’ve updated from an 2.4.0 snapshot, please check if the old JAR is deleted
  • check that you have only one binding running (see Binding Request: Synology Surveillance Station)
  • restart openHAB (if not already)
  • if you’ve created your Things using PaperUI, please try to recreate them
  • try to disable HomeMode channel
  • at last, if everything else works, you can also just disable WARN with
log:set ERROR org.openhab.binding.synologysurveillancestation

BR Pav

Sorry for my late response.
I have checked the camera and i am getting reason:“1”
{“archId”:0,“archived”:false,“archived_folder”:“Hal”,“audioCodec”:“PCMU”,“audio_format”:“PCMU”,“camIdOnRecServer”:0,“cameraId”:5,“camera_name”:“Hal”,“cause”:1,“closing”:false,“comment”:"",“customLabel”:0,“defaultLabel”:0,“defaultLabelAttr”:{},“deleted”:false,“dsId”:0,“eventId”:299830,“eventSize”:156,“event_size_bytes”:163577856,“fisheyeParam”:{},“fisheye_origin_view”:false,“fisheye_type”:{},“folder”:"/volume1/surveillance/Hal",“for_rotation_only”:false,“frameCount”:7501,“id”:299830,“idOnRecServer”:0,“imgHeight”:1080,“imgWidth”:1920,“is_complete”:true,“markAsDel”:false,“mode”:0,“mountId”:0,“mountSrcDsId”:0,“mount_type”:0,“mute”:false,“name”:“20190925PM/Hal-20190925-225510-1569444910.mp4”,“path”:“20190925PM/Hal-20190925-225510-1569444910.mp4”,“reason”:1,“recordId”:“0_299830”,“recording”:false,“resoH”:1080,“resoW”:1920,“snapshot_medium”

Reason 1 is -->
1: Continuous Recording
 2: Motion Detection Recording
 3: Alarm Recording
 4: Custom Recording
 5: Manual Recording
 6: External Recording
 7: Analytics Recording
 8: Edge Recording
 9: Action Rule Recording

Aha i see, my camera’s are always recording.
But when there is a motion detection synology just saves the movie and puts a reason of 1.
Is it possible to add reason 1 to the binding?

Thnx

My settings are the following in surveillance station

I still can’t quite reproduce your issue but I sure can add another reason (1) if you think it works (i.e. fires properly at the right time) and are willing to test it.

1 Like

I will test and report!