Binding Request: Synology Surveillance Station

Here is a screenshot of the browser console. This is on a panel with no cameras configured. There are no SS cameras used via the binding on any of my panels at the moment but as the items are being updating they show up regardless:

@waspie It seems, every item’s change event is being logged in the console, even those not present and even if no panel is configured at all. I can’t imagine why it’s done and I can’t disable it as well :frowning:
It seems, using snapshots as IMAGE is a bad idea after all

I’ll try to implement this static things tomorrow.

1 Like

Hi together,

as promised, I’ve released a new version featuring static snapshot and live feed URIs, changeable snapshot quality and an another approach to timeout handling. I’ve also updated readme to provide better examples for the text file configuration.

Please check the v.0.26 release notes for more details:

Everything is tested on openHAB 2.2.0 stable with my setup. Your feedback is as always very appreciated!

Best regards
Pav

Hi Pavion

I installed this version (a25) and still the enable/disable doesn’t seems to work.
Camera disabled on SS, switch to enable in OH and remains disabled on SS
Anything special to be done ? Or is it just a feedback switch (that gives the status, but doesn’t provide any action on SS) ?

Edit: for the rest, still seems to work like before. Just can’t find a way to use the rstp feed in basicui

Enable state is being refreshed with camera events refresh rate. If your refresh rate is set to null, Enable switch won’t show you the status but should still turn the camera on/off. I’ve actually tested it and it worked on my setup
 Could you please post again your log excerpt?

Btw there seems to be a small bug with static items not being populated on openHAB restart, I’m looking into it.

As for video: beside rtsp there is also a mjpeg over http URI available, which could be embedded in sitemaps but is very slow (0,5 fps). It’s practically the same as grabbing snapshots but I will also include this URI with the next version.

You can get all your URIs with following query, substituting _sid with your current one and idList with your camera ID:
http://192.168.0.1:5000/webapi/entry.cgi?api=SYNO.SurveillanceStation.Camera&method=GetLiveViewPath&version=9&idList=1&_sid=xxx
There are actually five different on my system, but I can use only two. Note: \" have to be removed. If you find another better stream, I can also implement it.

Hello. How can i enabled motion detection channel?

If you’re using PaperUI you’ll find this channel as usual in your Thing Configuration. If you’re using text file config, please refer to the last release’s notes.
If event refresh is enabled (as by default), motion detection channel will be triggered as soon as Surveillance Station detects motion.

i have only this.

Upd. I have old plugin.=))

Hi Pavion

Here is the log, same for both cameras

Bridge synologysurveillancestation:station:ds414j “Surveillance
Station” @ “ServerRoom”
[refresh-rate-events=10,host=“xxx”,protocol=“http”,port=“5000”,password=“xxx”,username=“xxx”]
{
Thing camera 2 “Salon” @ “Home” [
refresh-rate-events=60,refresh-rate-snapshot=0 ]
Thing camera 3 “Jardin” @ “Home” [
refresh-rate-events=60,refresh-rate-snapshot=0 ]
}

I think it might be related to my user rights, as per what I found about
error 117 (hich was not present before this version a25)

[117] = { “Need manager rights for operation”, true },

So I gave the admin right and now it works.

Maybe for a later release, try to put an error handling there ?

Thanks for your efforts, much appreciated, this is becoming a really
good binding

2018-03-04 19:41:56.579 [DEBUG] [ternal.webapi.request.SynoApiRequest] -
RESPONSE: {“error”:{“code”:117},“success”:false}
2018-03-04 19:41:56.644 [ERROR] [nal.common.AbstractInvocationHandler] -
An error occurred while calling method ‘ThingHandler.handleCommand()’ on
’org.openhab.binding.synologysurveillancestation.handler.SynoCameraHandler@17f2cf2’:
null
java.lang.NullPointerException: null
at
org.openhab.binding.synologysurveillancestation.internal.webapi.WebApiException.(WebApiException.java:41)
[230:org.openhab.binding.synologysurveillancestation:2.2.0.a25]
at
org.openhab.binding.synologysurveillancestation.internal.webapi.SynoWebApiHandler.handleSimpleResponse(SynoWebApiHandler.java:213)
[230:org.openhab.binding.synologysurveillancestation:2.2.0.a25]
at
org.openhab.binding.synologysurveillancestation.internal.webapi.SynoWebApiHandler.enable(SynoWebApiHandler.java:341)
[230:org.openhab.binding.synologysurveillancestation:2.2.0.a25]
at
org.openhab.binding.synologysurveillancestation.internal.webapi.SynoWebApiHandler.execute(SynoWebApiHandler.java:116)
[230:org.openhab.binding.synologysurveillancestation:2.2.0.a25]
at
org.openhab.binding.synologysurveillancestation.handler.SynoCameraHandler.handleCommand(SynoCameraHandler.java:101)
[230:org.openhab.binding.synologysurveillancestation:2.2.0.a25]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
~[?:?]
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
~[?:?]
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at
org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153)
[109:org.eclipse.smarthome.core:0.10.0.201801231340]
at
org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59)
[109:org.eclipse.smarthome.core:0.10.0.201801231340]
at com.sun.proxy.$Proxy133.handleCommand(Unknown Source)
[230:org.openhab.binding.synologysurveillancestation:2.2.0.a25]
at
org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:72)
[116:org.eclipse.smarthome.core.thing:0.10.0.201801231340]
at
org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49)
[116:org.eclipse.smarthome.core.thing:0.10.0.201801231340]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
~[?:?]
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
~[?:?]
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at
org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153)
[109:org.eclipse.smarthome.core:0.10.0.201801231340]
at
org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53)
[109:org.eclipse.smarthome.core:0.10.0.201801231340]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[?:?]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]

@karld
Thank you for your feedback, a meaningful error message will be provided!
I assume your issue with “Enabled” is thus resolved?

yes it is, thank you

Hi Pavion

After a restart of openHAB, I was getting error 119 from the binding

Looking at some forums, it appears this can happen when the “sid” starts
with a digit :

Same random error 119 here, when i try to read folders.

After hours, i noticed the error occured when sid starts with a number.
I just surrounded sid with " " and everything works fine for me now.

A restart of bundle did fix the problem, just maybe worth to add those
"" just in case

Thank you very much, I haven’t encountered this issue yet.
I’ve created a project issue and will look into it.

thanks, i will try this later today!

once again, having issues with the things file config
an excerpt from my things file:

Bridge synologysurveillancestation:station:diskstation "SynoNAS" @ "basement" [ protocol="http", host="192.168.1.8", port="5000", username="****", password="****" ] {
Thing synologysurveillancestation:camera:diskstation:1 "fireplaceCam" @ "fireplace room" [ refresh-rate-events=3, refresh-rate-snapshot=10, snapshot-stream-id=1 ]
Thing synologysurveillancestation:camera:diskstation:2 "nurseryCam" @ "nursery" [ refresh-rate-events=3, refresh-rate-snapshot=10, snapshot-stream-id=1 ]
Thing synologysurveillancestation:camera:diskstation:3 "livingRoomCam" @ "living room" [ refresh-rate-events=3, refresh-rate-snapshot=10, snapshot-stream-id=1 ]
Thing synologysurveillancestation:camera:diskstation:4 "drivewayCam" @ "outside" [ refresh-rate-events=3, refresh-rate-snapshot=10, snapshot-stream-id=1 ]

resulting errors in openhab.log:

2018-03-07 13:11:37.459 [INFO ] [el.core.internal.ModelRepositoryImpl] - Validation issues found in configuration model 'synology.things', using it anyway:
Provide a thing type ID and a thing ID in this format:
 <thingTypeId> <thingId>
Provide a thing type ID and a thing ID in this format:
 <thingTypeId> <thingId>
Provide a thing type ID and a thing ID in this format:
 <thingTypeId> <thingId>

i’ve tried incrementing the number in “snapshot-stream-id=” or just leaving them all as one. i’m not sure what this id is supposed to be and either way the errors exist.

Actually I’m getting this warning too and couldn’t find a solution either. As it’s just a warning, your Things should work, please check if they exist and are online.

will do
so what is stream id supposed to be? = to the camera or all set the same? (id=1 as in tied to diskstation 1?)

No, using text file configuration you should specify your camera id in the Thing ID:

synologysurveillancestation:camera:diskstation:<CameraID>

So your config with :1, :2, :3, :4 should actually work.

As for the stream ID, it’s used to choose a preconfigured stream/quality (see Synology Surveillance Station -> IP-Camera -> Edit -> Video), defaults to 1 for Stream 1

Aside of the warning you’ve posted earlier, what issues do you have with your configuration? Do you see things generated? Are they online? Is there something else in log to be seen?

I’m still at work for a short while so i only have brief moments to change things. I’ll get more time this evening around 20:00 (GMT-5)

Gonna sleep soundly then but I’ll check on you tomorrow :sleeping:

1 Like