Synology Diskstation & Cameras

If you are getting base64 errors on connect, I made a change that worked for me. The issue was that Synology most likely broke backwards compatibility of “SYNO.SurveillanceStation.Camera” API. I bumped the version used in the Diskstation connect code, and changed the mapping of some fields as well. Anyhow, the code here seems to connect without any base64 errors: https://github.com/mkrapivner/smartthings

Matt_K1, that allowed DS Connect to reconnect to my NAS without timeout (and see my cameras) but I’m unable to take an image:

1c40cf04-54b1-4565-b9cb-8276b664beac 3:45:43 PM: trace Did not use

1c40cf04-54b1-4565-b9cb-8276b664beac 3:45:42 PM: trace Requesting URL /webapi/entry.cgi?api=SYNO.SurveillanceStation.Camera&method=GetSnapshot&version=1&_sid=BDK1IbvKJRk6Y1531MQN708601&cameraId=2

1c40cf04-54b1-4565-b9cb-8276b664beac 3:45:42 PM: trace resending to get real error message

1c40cf04-54b1-4565-b9cb-8276b664beac 3:45:42 PM: trace take image command returned an error

1c40cf04-54b1-4565-b9cb-8276b664beac 3:45:42 PM: debug getChildDevices(false), children=5

1c40cf04-54b1-4565-b9cb-8276b664beac 3:45:41 PM: trace Requesting URL /webapi/entry.cgi?api=SYNO.SurveillanceStation.Camera&method=GetSnapshot&version=1&_sid=BDK1IbvKJRk6Y1531MQN708601&cameraId=2

Having a hard time getting my DS413 (DSM 6.2.2-24922) to work properly. I’ve followed the instructions but can’t ever get the “success” message show up on the SmartApp. I checked the live logging but nothing came in after sending the test sms message.

Is there a certain trick to getting this to work?

Is this project still been worked on ? Or is it just stable it hasn’t been updated for some time?
keen to see if it works esp with arming motion detection on cameras.

I created a SmartApp (https://github.com/zzarbi/smartthings/blob/master/diskstation/smarter-security-camera.groovy ) that let you choose a preset (the one you set with PTZ Control in Surveillance Station).

this is unreal and exactly what i’m looking for… tho much later than you. does it still exist?

Hi,
I’ve tried to resolve some issues I have and the app sounds great but I cannot even get it to connect.
It’ll be something daft I’m doing but when I try to setup the appI keep getting
‘Network Timeout. Check you ip address and port…’
I am using the local IP 192.168.1.129 and have tried ports 80, 5000 and 9900 with no joy.
Interestingly when I use 9900 and if I put the wrong password in then it tells me it failed authentication which sort of tells me 9900 is the right port?
Any ideas please?
ps the username and password exactly as I put it in to the Synology login screen.

Sorry, I just fixed the API version in the app, that was a rather simple change. Snapshots never worked for me from the get-go, and I don’t think the original author maintains the SmartApp any longer. I Just use this to turn on outdoor lights on motion detected from the camera, getting snapshots delivered to my phone by Synology itself. Just out of curiosity, what’s the use case for having snapshots appear in the SmartThings app, if there’s an easy way to get them using Synology apps?

Sorry, I just fixed the API version in the app, that was a rather simple change. Snapshots never worked for me from the get-go, and I don’t think the original author maintains the SmartApp any longer. I Just use this to turn on outdoor lights on motion detected from the camera, getting snapshots delivered to my phone by Synology itself. Just out of curiosity, what’s the use case for having snapshots appear in the SmartThings app, if there’s an easy way to get them using Synology apps?

My camera’s motion detection is unreliable. I rely on my zigbee contact sensors instead so being able to trigger a snapshot from a camera in the ST app and get that pushed to my phone when a gate is open is how I used it before and it worked well until a few months ago.

@glc650 Take a look here: https://github.com/mkrapivner/smartthings/tree/master/DiskStation
I updated the image-capturing code a bit, and can now take the snapshots from the ST device handler.
I haven’t tested auto-capturing of images, just the manual press of the “Take” button (although, it should trigger the same code path but would be great if someone could double-check that it works).

Also, it seems to work on one camera out of 2 for me, but that’s probably a different setup issue on my end.

After playing around a bit, it now doesn’t work on any of my cameras :frowning: Hopefully it will work for someone though? From what I could tell, the way these images are captured is undocumented so it might not work reliably? Also, Samsung uses Amazon S3 apparently to store images temporarily so that may also be a problem. Anyway, eager to hear if it works for somebody.

The snapshot capturing does appear to work intermittently, so from what I can tell it’s most likely a SmartThings-Amazon issue, not the app. Perhaps lowering the resolution setting would help, as others mentioned in this thread.

@Matt_K1 It is inconsistent for me. If I press the button enough times it will eventually grab a snapshot. I also noticed that it mixes up snapshots. I’ve got two cameras setup in ST with DS Connect and sometimes the snapshots for one camera show up under the other on the Things page.

Unfortunately there’s not much to be done about the inconsistency. The mixup is most likely a bug in the SmartApp, but given that the image capturing doesn’t work smoothly to begin with (that’s NOT the app but rather whatever Samsung does with the Amazon cloud in the background), I don’t see much value in fixing the mixup either (I also don’t understand that code 100%)…

There’s probably a timing issue between Samsung and Amazon, but that implementation is obscured by the Samsung API.

Seems to function properly and consistently with Photoburst taking the snapshots (so just testing with the capture button seems to be “off”).

Glad to hear it’s working for you. If you are technically inclined, I updated the code to include a “man in the middle” web server that needs to be run on the same Synology as the DS Cam runs on. It captures the snapshots directly from Surveillance Station and sends them over directly to SmartThings, bypassing the Samsung-Amazon synchronization altogether. Works much more reliably for me than the previous version. Instructions are also updated accordingly:

Don’t want to complicate things or make changes while it is working. Unless I can run this outside of my Synology (on my linux server or as a docker container on my linux server)?

I thought about that, but figured that if you have a NAS, might as well run a node.js server on there. It’s trivial though, but need to update the SmartApp to supply IP address of the web server (and yet another preference screen), whereas now I just grab the Synology IP address and use that in the SmartApp

Hi,
I am trying to install the server app at my sinology but seems some errors appear:

/$ sudo npm install express
Password:
npm WARN saveError ENOENT: no such file or directory, open ‘/package.json’
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open ‘/package.json’
npm WARN !invalid#1 No description
npm WARN !invalid#1 No repository field.
npm WARN !invalid#1 No README data
npm WARN !invalid#1 No license field.

  • express@4.17.1
    added 50 packages in 25.199s
    ********:/$ sudo npm install request
    npm WARN saveError ENOENT: no such file or directory, open ‘/package.json’
    npm WARN enoent ENOENT: no such file or directory, open ‘/package.json’
    npm WARN !invalid#1 No description
    npm WARN !invalid#1 No repository field.
    npm WARN !invalid#1 No README data
    npm WARN !invalid#1 No license field.

  • request@2.88.0
    added 44 packages in 55.222s
    *******:/$ sudo npm install base64-img
    npm WARN saveError ENOENT: no such file or directory, open ‘/package.json’
    npm WARN enoent ENOENT: no such file or directory, open ‘/package.json’
    npm WARN !invalid#1 No description
    npm WARN !invalid#1 No repository field.
    npm WARN !invalid#1 No README data
    npm WARN !invalid#1 No license field.

  • base64-img@1.0.4
    added 5 packages in 13.647s

I have 2 HDDs on the Synology but I cant see the map dscam.
Any ideas what am I missing?

Thanks

I’m no node expert, but these are warnings, not errors. Are you able to start the node.js server itself?

The Node JS is running on the NAS (I am using the package provided by synology). I was not able to start snapshot server manually because I can’t find the directory where it is installed. Actually I am not sure it is installed.
Tried listing volume 1 and 2 but no trace of it.