Binding Request: Synology Surveillance Station

Hi @Pavion,

thanks for your reply. I have the same settings in Surveillance Station. I can get a URL command within Surveillance Station (http://my-ip:15000/webapi/entry.cgi?api=SYNO.SurveillanceStation.ExternalEvent&method=“Trigger”&version=1&eventId=1&eventName=“This is external event1”&account="{account}"&password="{password}") and if I open this link in a browser (with same username/password as in OH) the event is triggered and the cameras are recording for 10 seconds.

How exactly do you send 1 in PaperUI? I’m using config files and my .items looks like this:
Number:Dimensionless Surveillance_Event_Trigger “External event trigger” {channel=“synologysurveillancestation:station:diskstation:eventtrigger”}

And I send 1 to the even channel by “smarthome:update Surveillance_Event_Trigger 1” in openhanded-cli. But nothing happens then. The item stays in state 1.0

Thanks
Rob

I think, smarthome:send is to use instead.
In PaperUI (2.x at least) you should see your Thing in your “Control” tab and be able to edit the corresponding Item.

That’s it! Thanks a lot! (needed to clean cache first and restarted OH, since I guess from testing there have been some “old” pieces). However, smarthome:send instead of update triggered your binding and the surveillance station to start recording.

Wish you a nice Christmas!
Robert

1 Like

Hi I just switched from OH 2.5.11 to 3.0.0 and I get following logfile error:

[WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/openhab/addons/org.openhab.binding.synologysurveillancestation-3.0.0-SNAPSHOT.jar

org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.synologysurveillancestation [230]

  Unresolved requirement: Import-Package: org.apache.commons.io; version="[2.2.0,3.0.0)"

    at org.eclipse.osgi.container.Module.start(Module.java:444) ~[org.eclipse.osgi-3.12.100.jar:?]

    at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[org.eclipse.osgi-3.12.100.jar:?]

    at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [bundleFile:3.6.4]

    at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [bundleFile:3.6.4]

    at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) [bundleFile:3.6.4]

    at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) [bundleFile:3.6.4]

    at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [bundleFile:3.6.4]

    at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [bundleFile:3.6.4]

I am using a OH docker installation. Any ideas what I could do?

NoTechi

I’m also finally moving in the direction of 3.0

2020-12-30 07:55:05.156 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/openhab/addons/org.openhab.binding.synologysurveillancestation-2.5.6-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.synologysurveillancestation [260]
  Unresolved requirement: Import-Package: org.eclipse.smarthome.config.core

        at org.eclipse.osgi.container.Module.start(Module.java:444) ~[org.eclipse.osgi-3.12.100.jar:?]
        at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[org.eclipse.osgi-3.12.100.jar:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [bundleFile:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [bundleFile:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) [bundleFile:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [bundleFile:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [bundleFile:3.6.4]

@NoTechi: weird, on a clean installation the required library (openhab.tp-commons-net) is already enabled… Anyway it looks like this dependency is not needed so I’ve made a new release without. Please install the latest 3.0 version from my release page.

@waspie: please install the latest 3.0 version too, OH2 and OH3 are not compatible.

@Pavion oh, is there a 3.0 version?? ooooooops sorry my bad
Your binding works so well for me I never need to update it or even bother looking :smiley:

It was kinda a “clean” install by getting the 3.0.0 docker image. The only folders which I kept are “addons”, “conf” and “userdata”. I just made a quick test with your new 3.0 version but I still get an errors.

2020-12-31 14:44:39.159 [ERROR] [ternal.webapi.request.SynoApiRequest] - RESPONSE: {“error”:{“code”:119},“success”:false}

2020-12-31 14:44:39.163 [ERROR] [tation.internal.thread.SynoApiThread] - DeviceId: Bridge; Thread: HomeMode; Attempt to reconnect failed

It’s actually spamming my log.

I also got other strange behaviour like when I ignore things in my Inbox they appear aghain after a openhab restart. So it looks like some of my textual config files are messing with my setup.
So it could be I have a more general problem even though everything else looks fine.

I will make a deeper investigation dive next year :wink:

NoTechi

The entirety of openhab exists in those 3 folders :joy:

Well yes but for sure I am not going to start from scratch :stuck_out_tongue: Actually the update to 3.0.0 was kinda smooth with just some adjustments needed like replacing the pushover action with the pushover binding and changing some influxdb items. Just Surveillance Station missing now but I am sure I will figure it out once I have some time to have a closer look :slight_smile:

NoTechi

I ended up ditching all of my text configs. It has taken me 5? days but i think I have all my items now. The rules will stay in files - i don’t see that changing anytime soon. this has been quite a lot of work to upgrade.

@Pavion

Hey Buddy, I’m using the 3.0 binding and the bridge doesn’t save the username or password.
it retains it briefly - enough to discover the devices but it seems to dump it soon after.
I’ve shut down OH and manually edited org.openhab.core.thing.Thing.json to put the u/p in but after starting it the “thing” still shows a “comm failure” and shows no user/pass.

1 Like

Hey @waspie!

Sorry, but I can’t confirm your issue. It looks like you’re still struggling with your migration, which I can’t confirm either. I’ve upgraded using internal routine:

./runtime/bin/update 3.0.0

and haven’t encountered any difficulties neither with my 10 text files nor with my json-configured ZWave devices. As for this binding: it’s running on my hot system and I’ve just now tested it on a clean 3.0 installation too - both without any issues.

Could you perhaps check whether you have but one latest version installed using:

bundle:list | grep Syno

my response:

214 │ Active │  80 │ 3.0.0.202012301626      │ openHAB Add-ons :: Bundles :: Synology Surveillance Station Binding

If still not working, please delete your Things and then ensure your configuration files are not containing any references anymore. In the past I’ve encountered stale Things in json, which could only be deleted manually.

Please also check your log for any unusual entries or errors. You can also enable debug for this binding to delve deeper

log:set DEBUG org.openhab.binding.synologysurveillancestation

Hope to have helped!
BR Pav

With the binding in debug shortly after saving the username/password the binding shows online and this in the event log:
Thing ‘synologysurveillancestation:station:13b0lnn0084’ changed from OFFLINE (COMMUNICATION_ERROR): Errorcode: 100 to ONLINE

It logs a massive amount of stuff to openhab.log and for a time regularly logs:

VPiZCfQnKWP6fSyA7o--GujF3wKTOQJS1zj28QfnFNFpUse0lHYVghyFgXknc&reason=5%2C1%2C3%2C9%2C2%2C6&blIncludeSnapshot=false&fromTime=1609946386&limit=25&cameraIds=6
2021-01-06 10:20:19.352 [DEBUG] [ternal.webapi.request.SynoApiRequest] - RESPONSE: {"data":{"events":[],"offset":0,"timestamp":"1609946419","total":0},"success":true}
2021-01-06 10:20:21.735 [DEBUG] [tation.internal.thread.SynoApiThread] - Thread Snapshot tick
2021-01-06 10:20:22.352 [DEBUG] [tation.internal.thread.SynoApiThread] - Thread Event tick
2021-01-06 10:20:22.353 [DEBUG] [ternal.webapi.request.SynoApiRequest] - URI: http://192.168.1.7:5000/webapi/entry.cgi?api=SYNO.SurveillanceStation.Event&version=5&method=List&_sid=_pDQSt4-HJIEcn-iSr_GLlAbR
VPiZCfQnKWP6fSyA7o--GujF3wKTOQJS1zj28QfnFNFpUse0lHYVghyFgXknc&reason=5%2C1%2C3%2C9%2C2%2C6&blIncludeSnapshot=false&fromTime=1609946389&limit=25&cameraIds=6
2021-01-06 10:20:22.426 [DEBUG] [ternal.webapi.request.SynoApiRequest] - RESPONSE: {"data":{"events":[],"offset":0,"timestamp":"1609946422","total":0},"success":true}
2021-01-06 10:20:25.427 [DEBUG] [tation.internal.thread.SynoApiThread] - Thread Event tick
2021-01-06 10:20:25.427 [DEBUG] [ternal.webapi.request.SynoApiRequest] - URI: http://192.168.1.7:5000/webapi/entry.cgi?api=SYNO.SurveillanceStation.Event&version=5&method=List&_sid=_pDQSt4-HJIEcn-iSr_GLlAbR
VPiZCfQnKWP6fSyA7o--GujF3wKTOQJS1zj28QfnFNFpUse0lHYVghyFgXknc&reason=5%2C1%2C3%2C9%2C2%2C6&blIncludeSnapshot=false&fromTime=1609946392&limit=25&cameraIds=6
2021-01-06 10:20:25.489 [DEBUG] [ternal.webapi.request.SynoApiRequest] - RESPONSE: {"data":{"events":[],"offset":0,"timestamp":"1609946425","total":0},"success":true}
2021-01-06 10:20:28.490 [DEBUG] [tation.internal.thread.SynoApiThread] - Thread Event tick
2021-01-06 10:20:28.490 [DEBUG] [ternal.webapi.request.SynoApiRequest] - URI: http://192.168.1.7:5000/webapi/entry.cgi?api=SYNO.SurveillanceStation.Event&version=5&method=List&_sid=_pDQSt4-HJIEcn-iSr_GLlAbR
VPiZCfQnKWP6fSyA7o--GujF3wKTOQJS1zj28QfnFNFpUse0lHYVghyFgXknc&reason=5%2C1%2C3%2C9%2C2%2C6&blIncludeSnapshot=false&fromTime=1609946395&limit=25&cameraIds=6
2021-01-06 10:20:28.525 [DEBUG] [ternal.webapi.request.SynoApiRequest] - RESPONSE: {"data":{"events":[],"offset":0,"timestamp":"1609946428","total":0},"success":true}
2021-01-06 10:20:29.488 [DEBUG] [ncestation.handler.SynoBridgeHandler] - Initialize thing: hive (DS918+)::synologysurveillancestation:station:13b0lnn000084
2021-01-06 10:20:31.525 [DEBUG] [tation.internal.thread.SynoApiThread] - Thread Event tick
2021-01-06 10:20:31.526 [DEBUG] [ternal.webapi.request.SynoApiRequest] - URI: http://192.168.2.2:5000/webapi/entry.cgi?api=SYNO.SurveillanceStation.Event&version=5&method=List&_sid=_pDQSt4-HJIEcn-iSr_GLlAbR
VPiZCfQnKWP6fSyA7o--GujF3wKTOQJS1zj28QfnFNFpUse0lHYVghyFgXknc&reason=5%2C1%2C3%2C9%2C2%2C6&blIncludeSnapshot=false&fromTime=1609946398&limit=25&cameraIds=6
2021-01-06 10:20:31.569 [DEBUG] [ternal.webapi.request.SynoApiRequest] - RESPONSE: {"data":{"events":[],"offset":0,"timestamp":"1609946431","total":0},"success":true}
2021-01-06 10:20:31.735 [DEBUG] [tation.internal.thread.SynoApiThread] - Thread Snapshot tick
2021-01-06 10:20:34.569 [DEBUG] [tation.internal.thread.SynoApiThread] - Thread Event tick
2021-01-06 10:20:34.570 [DEBUG] [ternal.webapi.request.SynoApiRequest] - URI: http://192.168.2.2:5000/webapi/entry.cgi?api=SYNO.SurveillanceStation.Event&version=5&method=List&_sid=_pDQSt4-HJIEcn-iSr_GLlAbR
VPiZCfQnKWP6fSyA7o--GujF3wKTOQJS1zj28QfnFNFpUse0lHYVghyFgXknc&reason=5%2C1%2C3%2C9%2C2%2C6&blIncludeSnapshot=false&fromTime=1609946401&limit=25&cameraIds=6
2021-01-06 10:20:34.733 [DEBUG] [ternal.webapi.request.SynoApiRequest] - RESPONSE: {"data":{"events":[],"offset":0,"timestamp":"1609946434","total":0},"success":true}

and then stops. then this follows in the events.log

Thing 'synologysurveillancestation:station:13b0lnn0084' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Errorcode: 100

I’ve removed the binding. Removed the thing. Checked over the thing file in JSONDB to be sure details were removed and re-added everything. I am not using any .things files at all - ALL UI.

264 x Active x 80 x 3.0.0.202012301626 x openHAB Add-ons :: Bundles :: Synology Surveillance Station Binding

Maybe I should be using a .thing file…

creating a .thing file seems to have resolved it already - sorry to have bothered you.

I just installed the binding on the actual OH3 3.1.0 Build #2119.
Very nice work. SurveillanceStation (DSM 6.2) and the two cameras got detected automatically and I could integrate them without any problems over the MainUI.
Thank you, BR

I have the same issue as @waspie with login and password being lost after reboot every time. After saving login and password again, it goes online until next reboot where these fields are lost again. This is openHABian 3.0 with December 30 snapshot and configured through the UI.

Experienced the same with missing username and password after a reboot.

Also the motion event switch item from the camera is not updating.
Anyone got this working?

I’ll check it asap, at the first glance it looks like autodiscovery is overwriting the credentials. Using non-default thing name may help.

Not a big issue for me, now migrated to file-based configuration to work-around it, but was planning to do this anyway. Just wanted you to know this, since probably it needs to be fixed before integrating the binding into official openHAB releases.