Binding Request: Synology Surveillance Station

I have installed the latest release, but i still have the error for my PTZ camera.
My other camera’s are working fine.
I also observed that after installing the binding my openhab is very slow. I can’t even connect remotely to myopenhab.org, it gives me a gateway timeout…

  1. Please ensure that you’re running the latest release only. You can check it in your Karaf by typing bundle:list | grep Syno. There should be but one line with Running state and version a31. Any other / older revisions are to be uninstalled.

  2. In any case you should unlink the channels you’re not using. Even with the new release, linking Patrol channel with no patrols defined will spam your openhab.log with errors, which should not affect the binding functionality anymore though.

  3. Installing and updating the binding could take some time (see 1 above) but running it should not affect the overall performance of openHAB. To keep the load low you should keep your camera Thing’s timeouts reasonable: 10 seconds for snapshots and 3 seconds for events should suffice.

  4. Nothing happening in openHAB should affect the connection to myopenhab. If you’re encountering issues with it, please check the URL in a normal browser first. Sometimes myopenhab.org is just down or overloaded.

  5. As you see, all I can do is to guess wildly. I ask you to provide some corresponding logs and some more information for me to pinpoint your issues.

  6. If you’re also on GitHub I ask you to create an issue there. Otherwise you’re welcome to send me a PM. Let’s try to keep this forum tidy.

  7. Thank you for your patience :slight_smile:

  1. thank you for the binding :slight_smile:

Thanks a lot!
I will give it a try!

EDIT:
I just installed the latest version and will report back with the outcome.

However, I had issues starting the binding:

openhab> bundle:list | grep Syno
245 x Installed x  80 x 2.4.0.a31              x SynologySurveillanceStation Binding
openhab> bundle:start 245
Error executing command: Error executing command on bundles:
    Error starting bundle 245: Could not resolve module: org.openhab.binding.synologysurveillancestation [245]
  Unresolved requirement: Import-Package: org.eclipse.jdt.annotation; resolution:="optional"
  Unresolved requirement: Import-Package: org.jupnp.model.meta

and needed to install the following additional features:

openhab> feature:install openhab-transport-serial
openhab> feature:install esh-io-transport-upnp

How to ensure that these are installed persistently?

Another question in the subject.
Does SS have a stream that is supported by Chromecast.
I want to cast to my TV.

/Mike

I don’t have a Chromecast device so I can’t answer your question. Couldn’t you just test every URI this binding returns? Aside from Live feed URI (rtsp) and Live feed URI (mjpeg over http) you may also try an http URI as in post #206.

@tnemrap I’ve also updated the binding manual with an easy method to obtain transformed URI using JS transform.
@michelm_de Thanks for this idea!

Updated to M7 and was spamed with:

2018-12-09 21:00:56.285 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler SynoBridgeHandler of thing synologysurveillancestation:station:1490ltn388511 tried checking if channel homemode is linked although the handler was already disposed.
2018-12-09 21:00:59.291 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler SynoBridgeHandler of thing synologysurveillancestation:station:1490ltn388511 tried checking if channel homemode is linked although the handler was already disposed.
2018-12-09 21:01:02.295 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler SynoBridgeHandler of thing synologysurveillancestation:station:1490ltn388511 tried checking if channel homemode is linked although the handler was already disposed.
2018-12-09 21:01:05.299 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler SynoBridgeHandler of thing synologysurveillancestation:station:1490ltn388511 tried checking if channel homemode is linked although the handler was already disposed.
2018-12-09 21:01:10.535 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler SynoBridgeHandler of thing synologysurveillancestation:station:1490ltn388511 tried checking if channel homemode is linked although the handler was already disposed.
2018-12-09 21:01:13.540 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler SynoBridgeHandler of thing synologysurveillancestation:station:1490ltn388511 tried checking if channel homemode is linked although the handler was already disposed.
2018-12-09 21:01:16.545 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler SynoBridgeHandler of thing synologysurveillancestation:station:1490ltn388511 tried checking if channel homemode is linked although the handler was already disposed.

Hi NCO and sorry for having missed your message.
Unresolved requirement is a known issue. As far as I know it happens only with SNAPSHOTs and only if it’s the first binding being installed. It’s actually only esh-io-transport-upnp, which is required, and it is (afaik) pre-installed with a STABLE version and/or is installed with any other binding using UPNP (Netatmo and such).
As this binding is not integrated into openHAB, it’s not possible to force the installation of this feature. See Creating a binding with UPNP discovery for more info.
I will update the binding manual with a quick how-to: feature:install esh-io-transport-upnp.

Hi @tnemrap
Sorry, I still can’t reproduce your issue or pinpoint its source. My fresh M7 installation don’t show any warnings. Please provide more information if possible:

I restarted and now i do not get the messages.

/Mike

Hi Pavion,

don’t worry - it seems to be running well so far on M7
Thanks for responding, though.
It’s greatly appreciated!
Great Binding by the way :slight_smile:

I guess the binding doesn’t support PIR motion detection?
I have integrated the
Switch Surveillance_Event_Motion “Camera motion event” {channel=“synologysurveillancestation:camera:diskstation:1:event#motion”}

and added a rule for it.
I have noting in my log files from motion detection when Home Mode is Off.
My camera is only sending an alert when there is PIR detection, so camera motion detection is disabled, but PIR is enabled.

Is it possible to add this to the binding?

This binding can detect events coming from / through Synology Surveillance Station. If your camera has an integrated motion detection or you’re using separate hardware for this, those events are not available for this binding.

i checked my configuration and i haven’t checked the checkbox “When detects PIR, trigger motion detection events as well”.

Shouldn’t you turn it on?

It is turned on, but no event in log for this

alarm.items
Switch Camera_Hal_Motion “Beweging in hal” <alarm> {channel=“synologysurveillancestation:camera:beveiliging:5:event#motion”}

alarm.rules
rule “Beweging gedetecteerd hal”
when
Item Camera_Hal_Motion received command ON
then
sendBroadcastNotification(“Beweging hal!”)
end

I can’t test your issue as I have no PIR… Please check following:

  1. Check your Surveillance Station. In the Timeline-App you should see your PIR events. Only those shown there could be queried by the binding.
    If you see your PIR events there…
  2. Try using received update instead of received command
rule “Beweging gedetecteerd hal”
when 
Item Camera_Hal_Motion received update
then	
if (Camera_Hal_Motion.state == ON)  {
sendBroadcastNotification("Beweging hal!")
}
end
  1. For a quick testing you can adjust the sensitivity of your sensor, which would increase event frequency and length
  2. If you’re using persistence with your openHAB, you can add your item and check the database sometime later
  3. Try using Synology internal motion detection (with high sensitivity) and look whether it would generate events

On my HikVision i use an external Bosch PIR connected to Digital Input.
synology surveillance station detects digital input and start recording.
Can i have a switch for Digital Input also?
I am now using this solution to capture events

/Mike

Sorry people, I can’t implement things I can’t test myself and I still can’t quite understand your request

As shown in post #236 of @dafdegiraf, there is a switch, which should - upon turning on - relay PIR events as motion detection events. If this is the case, those events should be shown in the Timeline app and should thus be available for the binding.

That means: if you events are not shown in the Timeline app, I don’t see any way to include them in the binding. I ask for your understanding, that I’m not going to support some third party PIR provider which are not supported by the Synology Surveillance Station API itself. If this is the case, you should look for an other binding (or use Exec / JS Transform) for obtaining events and using them in your rules.

On the other hand, if your events are shown in the Timeline app, I’m depending on you to help me find out, why they are not available for the binding. In this case, some answers for my questions in previous post #293 could help.

You can also check your events directly:

  • Execute this to get your SID:
http://192.168.0.2:5000/webapi/auth.cgi?api=SYNO.API.Auth&method=Login&version=3&account=xx&passwd=yy&session=SurveillanceStation&format=sid
  • Execute this with the SID and Camera ID to get full event list of your camera
http://192.168.0.2:5000/webapi/entry.cgi?&version="4"&cameraIds="1"&api="SYNO.SurveillanceStation.Event"&method="List"&limit=10&_sid=kbpMwEAKPNzLU14A0MDN043107

You should then see last 10 events being triggered. If your PIR event is among them, please check his reason:

"reason":2  

As of now, the binding polls for reasons 2 (Motion), 3 (Alarm) and 5 (Manual). Perhaps your PIR sensor generates 6 (External), that’d be easy to implement. Other possibility would be creating an Action Rule in your Surveillance Station, which should trigger reason 9.