Binding Request: Synology Surveillance Station

Sure, just give me some time. I’ve recently updated the repo and have a pull request pending, gotta clean this up first. I hope this weekend…

1 Like

Looking forward to it. Is this binding added to the openHAB 2.5 release?

Please check this release:


Note: your Thing must be recreated if PaperUI was used.

As of now this binding is stand-alone and is not a part of OH distribution.

My system is running openhab 2.4.0 stable runtime.

2019-09-29 00:33:40.321 [WARN ] [org.apache.felix.fileinstall ] - Error while starting bundle: file:/C:/openhab-2.4.0/addons/org.openhab.binding.synologysurveillancestation-2.5.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.synologysurveillancestation [224]
Unresolved requirement: Import-Package: com.google.gson; version="[2.8.0,3.0.0)"

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.doProcess(DirectoryWatcher.java:520) [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]

i have added the http://central.maven.org/maven2/com/google/code/gson/gson/2.8.5/gson-2.8.5.jar in the addons directory and it seems to work

The pir motion detection doesn’t work :frowning:

{“data”:{“events”:[{“archId”:0,“archived”:false,“archived_folder”:“I added this myself for privacy”,“audioCodec”:“PCMU”,“audio_format”:“PCMU”,“camIdOnRecServer”:0,“cameraId”:I added this myself for privacy,“camera_name”:“I added this myself for privacy”,“cause”:1,“closing”:false,“comment”:"",“customLabel”:0,“defaultLabel”:0,“defaultLabelAttr”:{},“deleted”:false,“dsId”:0,“eventId”:5,“eventSize”:468,“event_size_bytes”:490733568,“fisheyeParam”:{},“fisheye_origin_view”:false,“fisheye_type”:{},“folder”:"/volume1/surveillance/I added this myself for privacy",“for_rotation_only”:false,“frameCount”:4636,“id”:5,“idOnRecServer”:0,“imgHeight”:1080,“imgWidth”:1920,“is_complete”:false,“markAsDel”:false,“mode”:0,“mountId”:0,“mountSrcDsId”:0,“mount_type”:0,“mute”:false,“name”:“20190929AM/-20190929-004859-1569710939.mp4",“path”:"20190929AM/-20190929-004859-1569710939.mp4”,“reason”:1,“recordId”:“0_5”,“recording”:true,“resoH”:1080,“resoW”:1920,“snapshot_medium”:"***************I added this myself for privacy",“startTime”:1569710939,“status”:1,“status_flags”:0,“stopTime”:1569712098,“update_time”:5,“videoCodec”:“H.264”,“video_type”:3,“volume”:50},

I have took a look at the JSON and i was wondering, shouldn’t you be checking the “eventId” instead of the reason?
In my case it is eventId:5
In the web API i have found this

i’ve used m1 m2 and now m3 without touching my jar for a few months now and it still works as well as ever. thanks @Pavion

Same for me :wink: You’re welcome!

And also same for me! Great Work and thank you for all the effort! :wink: :wave:

Hello,

I try to install the binding but get alsway the following error.

2019-10-19 19:19:10.261 [ERROR] [.binding.synologysurveillancestation] - FrameworkEvent ERROR - org.openhab.binding.synologysurveillancestation

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

  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.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1634) ~[?:?]

	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1613) ~[?:?]

	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1585) ~[?:?]

	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1528) ~[?:?]

	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) ~[?:?]

	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]

	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) [?:?]

My system is openHAB 2.4.0-1 on an Raspberry Pi with Openhabian
Release = Raspbian GNU/Linux 8 (jessie)
Kernel = Linux 4.9.35-v7+
Platform = Raspberry Pi 2 Model B Rev 1.1

Installed version V0.37 of the binding and it work fine. Thank to Pavion. Good Woork

1 Like

hey there :slight_smile: is there a way i can tell (write to) surveillancestation, that there is motion on camera_x?

I’m thinking to implement the following flow:

  1. hikvision smart events fire in camera_x (working)
  2. event is captured by openhab, ipcamera binding (working)
  3. openhab tells surveillance station, that there is an event (motion) on camera_x

No solution for (3) so far - if it’s there in the binding, i may not be seeing it. :frowning:

The “Why”: I’m using the default app of Synology or timeline view to view the streams. This is only efficient, if you have the “event” markers in the stream, so you can skip through the events. What i’m trying to achieve is, to set the events start and end through openhab rules to be the in-camera smart events the master for defining the alarms.

Hi Stefan,

if I undestood your setup right, the easiest way would be creating an openHAB rule:

If event is captured (over ipcamera), start manual record (with this binding), wait X seconds (e.g. with Thread::sleep) and stop it.

This should be displayed in your SSS-Timeline-View as a manual recording event.

You can try and simulate this behaviour using corresponding “Record” switch in PaperUI.

Note: this will probably not work if your SSS is in continuous recording.

BR Pav

Thanks! Will try that soon with my test-installation

Hi Pavion, that helped already, thanks!
After all took a slightly different approach:

  • define external events in SSS
  • trigger external events from openhab
    What that will not do is to mark this manual recording as a “motion event”. That’s a pity only for the iPhone app, which specifically allows to skip through the stream for motion events.

Hi,

Bit late to the party but I’m loving the potential of this binding…

I installed the latest release tonight, from Sept 28…all seemed to be going well, I saw the binding, installed the bridge thing, (my syno) I added in the username and password, it then found the camera thing, all great, exactly as per the read me.

However, that’s where it went a little wrong. I restarted OH as I always do after a new binding and when it came back up it said ‘offline - communication error’, went into the thing and the screen that would usually have the settings on was blank. I also noticed that the icloud binding had changed to the same error message.

I have since removed the jar, and the things / items and restarted OH again, and everything surveillance seems to have gone but it seems to still have knocked out my icloud binding…

I’m getting a whole load of errors:

2019-11-10 22:20:12.663 [WARN ] [l.handler.ICloudAccountBridgeHandler] - Unable to refresh device data
java.io.IOException: java.util.concurrent.ExecutionException: javax.net.ssl.SSLHandshakeException: General SSLEngine problem

They all seem to revolve around SSLHandshakeException…

Does / could the surveillance station modify that??? and if so how do I get it back?

Thanks in advance

Rasp Pi / Openhabian 2.4.0-1

EDIT - Seems this somehow knocked out the icloud snapshot jar in my addons folder…I’ve uninstalled and reinstalled the latest icloub binding snapshot and it’s working again…maybe happenstance, may be something in this binding but I’ll leave this message here incase others get the same issue…

Hi! I’m glad you’ve found the solution for your issue.
Just in case: this binding don’t have any special dependencies or settings regarding SSL and do not modify any unrelated services.

Hi All,

I once again love this binding. It currently shows 8 camera feeds in HABPanel on a screen in my kitchen.

Now, I wanted to explore more of the functionality.

I have one giant 20x zoom PTZ camera, where I have created 5 presets (in Surveillance station)

In Paper UI, I enabled the item “move to preset” and from the “CONTROL” I see an empty drop down. If I select a preset, the camera jumps to this preset! So far so good.

I wanted the same for my sitemap, but it doesn’t work. Nor does it work within a rule to shift preset.

Sitemap:

Switch item=Carport2_Ptz_MoveToPreset mappings=[“Terrasse”=“Terrasse”,home=“home”] label=“CAM TEST” icon=“camera”

This shows a nice selection “switch” but when I select either of the presets, the log says:

2019-11-13 10:02:44.805 [ERROR] [ncestation.handler.SynoCameraHandler] - handle command: Carport2::synologysurveillancestation:camera:c2kan01273:8ball:

Same goes for a rule. I have tried:
postUpdate
sendCommand …

All gives an ERROR in the log as above.

Only way to select preset is from Paper UI -> Control.

Any ideas?

Btw, my idea was to control the PTZ camera based on certain events (motion triggers (xiaomi) ) Or when somebody pushes the doorbell, the camera would zoom into the main door area and snap a picture :wink:

Hi Jesper!

It’s a cool idea you’re having here. Sadly as I don’t have a PTZ myself I can’t actually pinpoint your issue.
Here but some ideas:

Rule

Normally it’s a String Item, so please try to call your Item from a rule with just a quoted preset name:

Carport2_PTZ_MoveToPreset.sendCommand("Terrasse")

Sitemap

Please check whether your quotes are valid: " or remove them completely
Normally your definition should return a required string…

Advanced (using dummy Item):

.items

String TestPreset

.sitemap

Switch item=TestPreset mappings=[Terrasse=Terrasse,home=home] label="CAM TEST" icon="camera"

.rules
rule "TestPresetRule"
when 
    Item TestPreset received command
then
    // Log received value to openhab.log. In my test case values are proper
    logError("TestPresetRule", TestPreset.state.toString)
    // note usage of .state.toString here
    Carport2_PTZ_MoveToPreset.sendCommand(TestPreset.state.toString)
end

If it still doesn’t help, please provide more information :

  • binding and OH version
  • channel name and its definition in PaperUI

BR Pav

Thank you Pavion!

Neither worked.
This is the log with the dummy item.
2019-11-14 07:47:13.258 [ERROR] [marthome.model.script.TestPresetRule] - Gangsti
2019-11-14 07:47:15.228 [ERROR] [ncestation.handler.SynoCameraHandler] - handle command: Carport2::synologysurveillancestation:camera:c2kan01273:8

Openhab version:
Version: 2.4.0 (Build)

Bundle version:
openhab> bundle:list|grep -i syno
221 │ Active │ 80 │ 2.5.0.a37 │ SynologySurveillanceStation Binding
222 │ Installed │ 80 │ 2.5.0.201909280734 │ openHAB Add-ons :: Bundles :: Synology Surveillance Station Binding

Thing/Item/PaperUI:

Thanks! :slight_smile:

hi Jesper,

try it without quoting the key (“Terrasse”) in your mapping

Switch item=Carport2_Ptz_MoveToPreset mappings=[Terrasse=“Terrasse”,home=“home”] label=“CAM TEST” icon=“camera”`

Thanks, but it makes no difference.
2019-11-14 08:49:49.784 [ERROR] [ncestation.handler.SynoCameraHandler] - handle command: Carport2::synologysurveillancestation:camera:c2kan01273:8: