Binding Request: Synology Surveillance Station

@david, I’ve had the same issue on my long running setup. Restarting the binding fixed the issue for me. Could you please check it? Fastest way is to link manual event channel and trigger manual record in Surveillance Station Live View. If it helps, there might be an issue with a thread gone dead unnoticed.

I restarted OpenHab and now the motion event channel seems to be working. I’ll keep an eye on it to see if it was related to the initial linking of the item or something else.

I guess I spoke too soon. It worked once, and then doesn’t seem to be working.

i use pushover, works great.

@david Mine works still… Could you please check your events.log for any motion events?
Please note, that for any motion events shorter as the refresh rate the channel is toggled on and off again immediately, thus being effectively invisible for an end user.

Ah, I didn’t realize it was polling for motion events. This is for my doorbell camera, and the motion detection area is quite small, so I can see how it would be missed in polling. They walk up to the door, push the doorbell, then stand there… I changed the refresh rate to 1 second, but with the small motion detection area, this could all happen in a second.

got another question for you. is motion detection set to by camera or by ss?

Motion detection is by SS

Hi, is someone got video in iOS app?
I can see only

Image item=Surveillance_Snapshot_Uri_Static url="[%s]" refresh=5000

not

Video item=Surveillance_Snapshot_Live_Uri_Mjpeg_Http url="[%s]" encoding="mjpeg" 

Is it correct that the Motion event only works when the Recording Schedule in Surveillance Station is set to Motion Detection? I would like to use Continuos recording, but also get motions detected in Openhab.

Any ideas to make this work?

I assume so. The binding only sees events generated by Surveillance Station.

1 Like

Is it possible to add Surveillance Station with 2FA enabled?

2018-09-21 23:50:01.107 [hingStatusInfoChangedEvent] - ‘synologysurveillancestation:station:survsta’ changed from OFFLINE (COMMUNICATION_ERROR): Errorcode: 403 to OFFLINE (COMMUNICATION_ERROR): Errorcode: 0

It seems to be possible to implement 2FA, however your Thing will be disconnected again as soon as Surveillance Station requests a new login (SID) or is restarted. Why don’t just create an 1FA user with surveillance access only?

you are completely right. I’ve the bad habit to logon with my own user which is admin…
Gonna check it out.

@Pavion - thank you very much for your nice binding. really helpful one observation and one question:

  1. can you tell, in which directory of the openhab installation your binding is storing the snapshot images?
    Im interested to use these jogs for a python script, which analyses these automatically, when a new image emerges. Using your binding would be handy, as the image is “in the system” and any other inquiry at synology or the IP cam could be avoided.
    I understand, that openhab builds all html pages on the fly, but “somewhere” there should be the image as jpg. - maybe there is another approach. Thanks for a hint.

  2. the current jar of the surevilance station binding doesnt install automatically on my fresh Openhabian installation. The log shows following ERROR, which can be easily resolved with the installation of two features, as described here: [BTicino/OpenWebNet] New openHAB2 binding ready for testing

2018-10-16 20:40:38.114 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.synologysurveillancestation-2.4.0-SNAPSHOT.jar

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

  Unresolved requirement: Import-Package: org.eclipse.jdt.annotation; resolution:="optional"

  Unresolved requirement: Import-Package: org.jupnp.model.meta

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

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

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

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

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

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

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

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

Hi Martin and thank you for your feedback!

The snapshots are not stored, why should they normally? The Image item is always being populated with the latest snapshot, discarding older one. You might need to use some rule to save this image if needed (it’s basically a Base64 string). You might also skip openHAB and use a simple PHP script from inside your Python directly. See this forum post for more details (second script):
https://www.synology-forum.de/showthread.html?84259-Mjpeg-stream-und-jpeg-Snapshot-über-web-API-abfragen

The second issue is a known one while using the latest openHAB snapshot instead of stable version. With snapshot, some dependencies are deactivated by default, which can cause different problems and exceptions. Only registered bindings (with installation from within PaperUI) are allowed to install additional features. As this binding is not (yet?) integrated, no automatic installation is possible. On the other hand, supplying the same dependencies with the binding would but swell the jar size and overall installation overhead and could cause version conflict.

Please contact me, if you have further questions.
Best regards
Pav

1 Like

Hello,
Trying to configure, i think i got all parameter right but it doesn’t work

http://diskstation:5000/webapi/query.cgi?api=SYNO.API.Info&method=Query&version=1&query=SYNO.SurveillanceStation.Camera

Gives me succes:true

http://diskstation:5000/webapi/auth.cgi?api=SYNO.API.Auth&method=Login&version=6&account=YOUR-USER&passwd=YOUR-PASSWORD&ession=SurveillanceStation&format=sid

gives me false ( of course i replace user and pass…)

Thanks

Does this binding work with QNAP version of Surveillance Station?

Can’t prove it, but I assume no. It’s a completely different application, which just happens to have a similar name.

Hi,

I installed the binding ( v0.29-alpha ) today for my OpenHAB 2.3. Configuration works fine and also the Snapshot works. For Video it’s not working so far… I tested manually getting the URL from REST API and got the following stream URL :

http://diskstation.local:5000/webapi/entry.cgi?api=SYNO.SurveillanceStation.Stream.VideoStreaming&version=1&method=Stream&format=mjpeg&cameraId=4&StmKey=\"aa08174f67a8f2da67ec4289efd44ff4\"

When putting this URL into the browser I also get an error code 105. If I manually remove the escaped quotes from StmKey it’s working in the browser and also in OpenHAB (looks like ...&StmKey=aa08174f67a8f2da67ec4289efd44ff4 ). Is this somehow configurable or someone knows why openhab can’t deal with the escaped quotes?

I just found that there is already an issue for: https://github.com/nibi79/synologysurveillancestation/issues/26

Regards,
Michel