I’m new to openHAB and I’d like to contribute to this great project by offering my thoughts and solutions for accessing a Synology Surveillance Station via openHAB.
I have implemented (or put together from other sources) two different ways, both using Synology API, and I would be glad to hear your suggestions and thoughts on this matter. If you’re interested, I can also give you more detailed description or upload my files on GitHub. Please be kind to me, if there already is a better solution
First and easy way for the users of HABPanel only is a creating of an Image item linked to an URL. This URL points at a php script running on Synology Web Station. The script then connects to Synology API and delivers a camera snapshot.
Advantages:
Script runs only if HABPanel is open, greatly reducing server load
Script is easy and foolproof
Disadvantages:
Limited to HABPanel, not controllable and thus not “Smart”
Second way: I’ve created a Synology Surveillance Station Binding, which binds a camera through API and as of now offers following channels: current snapshot as IMAGE, automatic refresh yes/no as SWITCH and refresh rate in seconds as DECIMAL. Fully configurable and even controllable with PaperUI.
Advantages:
using full openHAB functionality: persistence, rules etc. (e.g. trigger snapshot on alarm and so on)
potentially allowing even more control of IP camera by binding additional Surveillance Station API functions
Disadvantages:
higher server load in automatic refresh mode (24/7); without automatic refresh requires custom HABPanel widget
error prone, as I’m new to this project (I had already to find out how to uninstall a binding with Karaf console ) and have but limited time available
As I’ve said, I’d like to hear if there is still need, as well as your feedback and your thoughts on this.
Hi Nils and thank you four your answer.
I’ve also tried to implement discovery but for now I’m stuck with one Camera Thing, which has to be configured manually. In there I’m using a simple http server for connecting to API and a GSON parser to parse its answer.
Is there a way to combine our development or for me to contribute to your project, if you’re further ahead? It makes no sense for me to develop two bindings with the same goal.
With best regards
Pav
I’ve just uploaded a version I have now running on my stable installation:
Please note, that it’s a work in progress, and use it only if you know how to uninstall/update it just in case.
Having said this, I thank you for your interest. Feel free to give feedback and create new issues.
Also if you’re using HABPanel, you should also try my snapshot lazy loading widget.
I can’t reproduce this behavior and couldn’t find anything resembling this error
Could you please provide some more information:
When do you encounter this error? On copying the binding in your addons/ already? Can you see the binding though? What happens on openHAB restart? What openHAB version are you using?
2017-12-19 13:47:56.070 [ERROR] [org.apache.felix.fileinstall ] - Failed to install artifact: /usr/share/openhab2/addons/org.openhab.binding.synologysurveillancestation-2.2.0-SNAPSHOT.jar
org.osgi.framework.BundleException: A bundle is already installed with the name "org.openhab.binding.synologysurveillancestation" and version "2.2.0"
Sorry, you can’t uninstall a binding from PaperUI, this feature is not yet implemented.
For this you must open your Karaf console and execute bundles:list to list all installed bundles (bindings).
Newer bindings stand at the end of the list, their ID is the leftmost value (e.g. 222).
Now you can type bundles:uninstall xxx to uninstall a binding with its ID.
It’s possible to poll Synology API every X seconds and get the latest recording event. This is basically the same event as seen in Timeline package of the Synology surveillance station and has following payload:
Event start / stop time
Event snapshot
Path of the video recording (some path anyway)
Cause (recording on: motion, alarm or action)
Questions:
with which frequency should be polled for events? To poll every second could be too much. Polling every minute actually gives you no live but last event.
which channels should be used, for example:
– event snapshot as IMAGE
– event start and/or stop time as DATE
– some event STRING: “motion detected on blah blah”
– some SWITCH
What would you think about it? Would it suffice?
I need a clear assignment before I go on