Hi @Pavion ,
thanks for the ultra quick reply. To be honest, I do not know how to increase the snapshot timeouts.
Anyway, by digging deeper I discovered that the generated http requests to my Synology DiskStation do not work for the offline cameras, i.e., the following request works well for cameraId=2 but results in an error code instead of returning a picture (129.168.178.80 being the IP address of my Synology):
Sure, getting snapshot will fail if a camera is disabled / offline… But what is an offline camera?
With camera timeout I’ve meant the refresh-rate-snapshot parameter, which you may try to increase. Too small (fast) refresh rates cause higher cpu load and may produce some issues on older/slower systems.
You can also enable debug mode for this binding in Karaf with: log:set DEBUG org.openhab.binding.synologysurveillancestation
there you can see additional info and SSS responses. You can PM me some more log output then.
For those of you keen to explore the new and shiny openHAB 3.0, there is a new compatible pre-release of this binding available at the project’s page. Please feel free to share your feedback
Problem solved: Synology gave for the missing cameras an error code 401 (“Parameter invalid”). As the only parameter difference was the camera number, I tried consecutive numbers 5 and 6, which worked! Probably when I installed and deinstalled cameras, freed up numbers did not get reassinged.
Hi @Bernd_R
This binding offer an IMAGE item and an URI of this image, both can probably be used as attachment. Search this forum for more information, for example:
Note: if this is your only usage for this binding, consider using a php solution instead. With a simple script you can connect to Surveillance Station and download current snapshot into a file, which could then be sent as attachment.
I’ve been using it for front door notifications with pictures for a couple years now (since this binding came about).
rule "Front Door Camera Motion Snapshot Notification"
when
Item fdCamMotion changed from OFF to ON
then
val fdCamURL = frontDoorCamDSnap.historicState(now.minusSeconds(5)).state.toFullString
val file = now.toString.replaceAll("[:\\/ \\+]+", "_") +".jpg"
val fdCamSnapTmp = "/etc/openhab2/snap/" + file
var String curl_result = executeCommandLine("curl -m 10 -o " + fdCamSnapTmp + " " + fdCamURL, 5000)
sendPushoverMessage(pushoverBuilder("FrontDoor").withAttachment(fdCamSnapTmp))
end
Thanks Pavion and waspie,
I use the binding and the following code:
rule "SavePictureAndSendNotification"
when
Item F_Tuerklingel changed to ON
then
createTimer(now.plusSeconds(2)) [|
logDebug("Imagerule", "Save Image")
var String CameraImage = SE_CamImage.state.toFullString //Convert image item to base64 encoded string
val String Image64 = CameraImage.split(",").get(1) //Slice the string up to the delimiter ","
var byte[] data = DatatypeConverter.parseBase64Binary(Image64)
try {
var OutputStream os;
val time = new DateTime().millisOfDay().getMillis()
var File f = new File("/etc/openhab2/html/" + triggeringItem.name + "_" + time + ".jpg")
os.write(data);
os.close();
sendPushoverMessage(pushoverBuilder("Doorbell").withAttachment(f.getAbsolutePath()))
}catch (IOException e) {
e.printStackTrace();
}
]
end
So far the binding works great, RackStation RS217 running at 27% load.
For the time being I stay with the binding and I am going to expand
the setup in future.
Hi @Pavion,
another small glitch which I discovered.
When I try to change the “Event refresh rate” for “DiskStation” in Paper UI (Configuration > Things > DiskStation > Edit) I get at first a “Thing updated” message, followed by a “ERROR: 409 - Conflict”. The value did not change.
Any ideas?
thanks for the quick answer. Indeed, I am using a .things file. This probably is the reason.
Looking in your documentation on GitHub I do find a hint for the parameter (" Following options can be set for the Bridge : […] Refresh rate for DiskStation events (Home Mode)").
Unfortunately, the parameter name is missing in your .things template:
Dear all,
I have a small issue with the binding.
I have been able to install easily and I have my snapshots visible on my sitemaps.
However the stream (Video) are not showing up.
I have tested to take the url in the string and copy/paste it in both chrome and VLC, it works fine.
I have a foscam C2 and ycam bullet that are showing up nicely in my synology.
I am wandering if there should be something to declare / do on either synology side or camera side.
I am kind of stuck and not really knowing which direction to take. I would be happy to share any log / config parameters needed.
Sitemaps seem to have an issue with quotes which are part of live URI.
You can try this workaround:
items/camera.items
Channel definition with transformation.
Note: Add-ons -> Transformations -> Javascript Transformation must be installed.
String Surveillance_Snapshot_Live_Uri_Mjpeg_Http "Live feed URI (mjpeg over http)" {channel="synologysurveillancestation:camera:myid:1:common#live-uri-mjpeg-http"[profile="transform:JS", function="livefeed.js"]}
transform/livefeed.js
This small script will parse input and remove all quotes ".
I have one more question concerning the messages around ID 280 in this thread. I have similar issues with the motion detection. Surveillance station is not taking care of the motion detection, the camera does. In the timeline, I see that SS is recording continuously for a certain amount of days and record (blue line) some events detected (supposedly by motion detection from camera). However, nothing triggers the channel in openhab.
I have created a Rule of Action but it does not seem to be working. Any clue on this topic ? I would like to avoid recording 2 times the same events (through motion detection standard and rules of action)
I found out that the home mode was activated… I tested this mode a while ago and never payed attention afterwards.
Obviously this mode has its own calendar that was defined for continuous recording. This was taking over the standard calendar / schedule…Problem solved
command in my rule to disable the camera completly: InstarTerCommonEnable.sendCommand(OFF)
and the other command to activate the camera: InstarTerCommonEnable.sendCommand(ON)
Since the rule is doing what it is intended for (disabling/enabling the camera) I could just ignore this error but if there is a way to not trigger this error it would be even better
Hi @NoTechi,
Sorry, but I can’t reproduce your error. If you get this response, binding shouldn’t work at all. If it still works, there is a bug somewhere. Please check your credentials/user and whether you have but one copy of this binding running using bundle:list | grep Syno
Please note that you can just disable all errors with following command: log:set FATAL org.openhab.binding.synologysurveillancestation
If you encounter further issues, please provide some more information regarding your setup.
203 x Active x 80 x 2.5.0.201911151402 x openHAB Add-ons :: Bundles :: Synology Surveillance Station Bin
My setup:
Openhab 2.5.4 running in a docker on a Synology NAS (using different ports for openhab then the standard)
org.openhab.binding.synologysurveillancestation-2.5.0-SNAPSHOT.jar in my addon folder
The bridge configuration/credentials should be ok since I get access to my cams. However I looked up the credentials again and saw it is configured to http on port 5000. Shouldn’t it be 9900 (HTTP) or 9901 (HTTPS)?
NoTechi
Update:
After a openhab restart I got:
[WARN ] [.core.thing.binding.BaseThingHandler] - Handler SynoBridgeHandler of thing synologysurveillancestation:station:15b1mhn934300 tried updating channel sid although the handler was already disposed.