Binding Request: Synology Surveillance Station

@Pavion
I’m running into errors lately using
openHAB 3.3.0
Release Build
And the latest binding. Everything had been fine previously. This is what I’m seeing in the openhab.log:

2022-06-27 11:12:06.387 [ERROR] [tation.internal.thread.SynoApiThread] - DeviceId: 6; Thread: Event; Critical error:

java.lang.NullPointerException: null
        at org.openhab.binding.synologysurveillancestation.internal.thread.SynoApiThreadEvent.refresh(SynoApiThreadEvent.java
:75) ~[bundleFile:?]
        at org.openhab.binding.synologysurveillancestation.internal.thread.SynoApiThread.runOnce(SynoApiThread.java:135) [bun
dleFile:?]
        at org.openhab.binding.synologysurveillancestation.internal.thread.SynoApiThread$1.run(SynoApiThread.java:67) [bundle
File:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) [?:
?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:829) [?:?]

Any insight into this?

Hi @waspie!
Sorry, can’t reproduce your issue and can’t see anything wrong with the code here.
If you’ve updated your Surv.Station recently, please check your versions:
bundle: 3.3.0.202205192135
Surv.Station: 9.0.0-7660

If both are correct…

  • is this error only for a specific or any event?
  • other channels ok?
  • any other changes on your setup recently?
1 Like

I’m still using 8.2.7 (SS).
I was getting some java heap (memory errors) over the weekend while I was away (and nothing had changed for at least a couple weeks) so I restarted openhab and saw some errors related to the binding.
So I updated OH from 3.3.something testing to 3.3.0 and the SS binding and now I have these errors. I removed ALL cameras and the DS from things and re-added the DS and 1 camera and re-linked the motion event and thats when I start to see the error. I’ll keep playing with things then, see if i can figure out where this is coming from.

Event handling has been changed since (because of) SS 9.0.0 so this is probably the cause. You might need to either update your SS or use the previous version of this bundle from a jar file.

1 Like

I’ll try an earlier binding and report back, thank you.

1 Like

reset it all and put back the older binding and its fine. not sure why it went south to begin with but all is well now - sorry to bother ya :slight_smile:

1 Like

I assume you’ve used marketplace version before so you’ve got the newer version upon openHAB upgrade :slight_smile:

nah, i just grab it from your GH

would you be so kind as to do a dsm6 version for OH 3.3.0?

I’ll look into it at the weekend, can’t remember much right now :wink:

thanks and apologies for being a pain

Hello guys,

since a few days my log is full of errors regarding the synology binding:

2022-09-26 20:27:52.199 [ERROR] [ternal.webapi.request.SynoApiRequest] - RESPONSE: {"error":{"code":105},"success":false}
2022-09-26 20:27:52.203 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'synologysurveillancestation:camera:1660nzn183103:10' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Thread LiveUri
2022-09-26 20:27:52.315 [ERROR] [ternal.webapi.request.SynoApiRequest] - RESPONSE: {"error":{"code":105},"success":false}
2022-09-26 20:27:53.263 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'synologysurveillancestation:camera:1660nzn183103:10' changed from OFFLINE (COMMUNICATION_ERROR): Thread LiveUri to ONLINE
2022-09-26 20:29:40.150 [ERROR] [ternal.webapi.request.SynoApiRequest] - RESPONSE: {"error":{"code":105},"success":false}
2022-09-26 20:29:40.155 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'synologysurveillancestation:camera:1660nzn183103:10' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Thread LiveUri
2022-09-26 20:29:40.203 [ERROR] [ternal.webapi.request.SynoApiRequest] - RESPONSE: {"error":{"code":105},"success":false}
2022-09-26 20:29:40.660 [ERROR] [ternal.webapi.request.SynoApiRequest] - RESPONSE: {"error":{"code":105},"success":false}
2022-09-26 20:29:41.307 [ERROR] [ternal.webapi.request.SynoApiRequest] - RESPONSE: {"error":{"code":105},"success":false}
2022-09-26 20:29:42.465 [ERROR] [ternal.webapi.request.SynoApiRequest] - RESPONSE: {"error":{"code":105},"success":false}
2022-09-26 20:29:43.287 [ERROR] [ternal.webapi.request.SynoApiRequest] - RESPONSE: {"error":{"code":105},"success":false}
2022-09-26 20:29:43.299 [ERROR] [ternal.webapi.request.SynoApiRequest] - RESPONSE: {"error":{"code":105},"success":false}
2022-09-26 20:29:43.734 [ERROR] [ternal.webapi.request.SynoApiRequest] - RESPONSE: {"error":{"code":105},"success":false}
2022-09-26 20:29:46.384 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'synologysurveillancestation:camera:1660nzn183103:10' changed from OFFLINE (COMMUNICATION_ERROR): Thread LiveUri to ONLINE
2022-09-26 20:31:38.839 [ERROR] [ternal.webapi.request.SynoApiRequest] - RESPONSE: {"error":{"code":105},"success":false}
2022-09-26 20:31:38.842 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'synologysurveillancestation:camera:1660nzn183103:10' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Thread Event
2022-09-26 20:31:40.111 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'synologysurveillancestation:camera:1660nzn183103:10' changed from OFFLINE (COMMUNICATION_ERROR): Thread Event to ONLINE
2022-09-26 20:31:41.901 [ERROR] [ternal.webapi.request.SynoApiRequest] - RESPONSE: {"error":{"code":105},"success":false}
2022-09-26 20:31:41.905 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'synologysurveillancestation:camera:1660nzn183103:10' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Thread Event
2022-09-26 20:31:43.326 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'synologysurveillancestation:camera:1660nzn183103:10' changed from OFFLINE (COMMUNICATION_ERROR): Thread Event to ONLINE

Any idea how to fix this?
I´m using version 3.3.0.

Thank you!

Hi!
It looks like either Surveillance Station was updated recently or some user privileges went astray. Please check whether you’re using the latest release of this bundle or try to create a dedicated user.
If it still persists, gimme a short notice and I’ll look into it tomorrow.

Hi =)
im struggling with showing a live video stream on the BasicUI.

i tried several ways but always just get this:

sitemap:

Switch item=Surveillance_Station_HomeMode

Video item=Surveillance_Camera1_Live_Uri_Rtsp  url="[%s]" encoding="mjpeg"  
Video item=Surveillance_Camera1_Live_Uri_Mjpeg_Http url="[%s]" encoding="mjpeg"
Video item=Surveillance_Camera1_Live_Uri_Rtsp url="[%s]" 
Video item=Surveillance_Camera1_Live_Uri_Mjpeg_Http url="[%s]"

Text item=Surveillance_Camera1_Recording
Text item=Surveillance_Camera1_Enabled 

items:

Switch Surveillance_Station_HomeMode                        "Home Mode" {channel="synologysurveillancestation:station:diskstation:homemode"}
String Surveillance_Camera1_Live_Uri_Rtsp                   "Live feed URI (rtsp)" {channel="synologysurveillancestation:camera:diskstation:6:common#live-uri-rtsp"}
String Surveillance_Camera1_Live_Uri_Mjpeg_Http             "Live feed URI (mjpeg over http)" {channel="synologysurveillancestation:camera:diskstation:6:common#live-uri-mjpeg-http"}
Switch Surveillance_Camera1_Recording                       "Camera recording [%s]" {channel="synologysurveillancestation:camera:diskstation:6:common#record"}
Switch Surveillance_Camera1_Enabled                         "Camera enabled [%s]" {channel="synologysurveillancestation:camera:diskstation:6:common#enable"}

things:

Bridge synologysurveillancestation:station:diskstation "DiskStation DS910+" [ protocol="http", host="192.168.***.***", port="5000", username="***", password="***", acceptSsl="false" ] 
  
    {
        Thing camera 6 "test1" [ refreshRateEvents=3, refreshRateSnapshot=10, refreshRateMdParam=0, snapshotStreamId=1 ]
    }

What i am doing wrong ?

Happy new year! :christmas_tree:


I’m not sure it’s possible to display rtsp video in Basic UI at all.
Easiest solution:

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

oh … i thought so :smiley:

Hello. I have connected a HikVision doorbell to Synology Surveillance Station and I can open door through DS Cam app. Can openhab binding handle door control? In SS API I see we have “2.3.38.20 DoorControl method”.

Hi @morchee

Unfortunately, this binding does not currently support the door control API.
As I’m not able to test it myself I can offer following options:

  • if you’re into programming yourself, you’re welcome to contribute to this project
  • if you but need a single call, I can try to implement it somewhen but must ask you to test it
  • if you’re an OH pro, you can implement any fixed API call using any other Binding / Rule, which is able to send HTTP requests (e.g. by sendHttpGetRequest or with HTTP Binding. As you’ve already got an SID from this binding, you can build your request using SID and examples given in the SS API manual

BR
Pav

Hello. I am having some trouble with my initial setup. The Thing for the DiskStation is showing ONLINE, yet the one for my camera is showing COMMUNICATION_ERROR. Here is an excerpt of the log:

13:47:59.806 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'synologysurveillancestation:camera:diskstation:1' changed from UNINITIALIZED (DISABLED) to INITIALIZING
13:48:02.817 [ERROR] [ancestation.handler.SynoCameraHandler] - initialize camera: id 1 - Eingang::synologysurveillancestation:camera:diskstation:1
13:48:02.818 [ERROR] [ancestation.handler.SynoCameraHandler] - Full stack trace: 
org.openhab.binding.synologysurveillancestation.internal.webapi.WebApiException: java.net.NoRouteToHostException: No route to host
	at org.openhab.binding.synologysurveillancestation.internal.webapi.request.SynoApiRequest.callWebApi(SynoApiRequest.java:236) ~[bundleFile:?]
	at org.openhab.binding.synologysurveillancestation.internal.webapi.request.SynoApiRequest.callApi(SynoApiRequest.java:151) ~[bundleFile:?]
	at org.openhab.binding.synologysurveillancestation.internal.webapi.request.SynoApiCamera.call(SynoApiCamera.java:109) ~[bundleFile:?]
	at org.openhab.binding.synologysurveillancestation.internal.webapi.request.SynoApiCamera.getInfo(SynoApiCamera.java:221) ~[bundleFile:?]
	at org.openhab.binding.synologysurveillancestation.handler.SynoCameraHandler.initialize(SynoCameraHandler.java:228) [bundleFile:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
	at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: java.util.concurrent.ExecutionException: java.net.NoRouteToHostException: No route to host
	at org.eclipse.jetty.client.util.FutureResponseListener.getResult(FutureResponseListener.java:118) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.client.util.FutureResponseListener.get(FutureResponseListener.java:101) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:730) ~[bundleFile:9.4.46.v20220331]
	at org.openhab.binding.synologysurveillancestation.internal.webapi.request.SynoApiRequest.callWebApi(SynoApiRequest.java:207) ~[bundleFile:?]
	... 14 more
Caused by: java.net.NoRouteToHostException: No route to host
	at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[?:?]
	at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:777) ~[?:?]
	at org.eclipse.jetty.io.SelectorManager.doFinishConnect(SelectorManager.java:355) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.io.ManagedSelector.processConnect(ManagedSelector.java:347) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.io.ManagedSelector.access$1700(ManagedSelector.java:65) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.io.ManagedSelector$SelectorProducer.processSelected(ManagedSelector.java:676) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.io.ManagedSelector$SelectorProducer.produce(ManagedSelector.java:535) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produceTask(EatWhatYouKill.java:362) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:186) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:137) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) ~[bundleFile:9.4.46.v20220331]
	... 1 more
13:48:02.822 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'synologysurveillancestation:camera:diskstation:1' changed from INITIALIZING to ONLINE
13:48:05.823 [ERROR] [station.internal.thread.SynoApiThread] - DeviceId: Bridge; Thread: Camera; Handler gone offline (Surveillance Station probably disabled)
13:48:05.824 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'synologysurveillancestation:camera:diskstation:1' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Thread Camera

Any help would be greatly appreciated. Thank you!
Cheers, Eric

Hi Eric

Please check your configuration. No route to host is a global exception. Google says:

It's a broad message that means **your computer can't reach the target server** , whether a local server daemon running on your system or a remote server that you can't access for whatever reason.

If you’re quite sure everything is right, please provide some more details on your configuration per PM.

BR
Pav