Synology Diskstation & Cameras

So which device handler you use now?
I have issues installing the snapshot server from @Matt_K1 locally on my NAS as described above.

Just cannot get mine to conect at all, returns zero children constantly. Disabled all cameras then enabed one at a time. Several have simple ONVIF configs yet they will just not pick up. To be honest I am a little confused as to why this should be an issue anyway after all the whole recording process happens on the DiskStation and we are simply just viewing via HTML. It would be great if someone looked at the App and DH but it is way beyond my capabilities.

Maybe I am missing something here!

I have not made any changes on the DS or SS. What is the Node JS and does anyone have detailed instructons as to exactly what I need to on the DS side PLEASE?

Thanks!

Hi @Matt_K1 I use your code published on Sep 8. It did solve the ‘time out’ problem. I still have issue with the motion detection setup. Following the in-app instructions and type 123-4567890 and click save on the page(just a ‘blank’ in first drop down). Then ‘send a text SMS message’, no success got back or screen updated in the app. I live in the US and will this be the case? Or do I need to put a +1 in the first drop down before phone number? But my SurveillanceStation client does not have that option, just ‘blank’ or a ‘+’. Thanks.

Hi @Biubiubiubiubu. 123-4567890 appears correct, that part of the application did not change. What is important though, is to make sure that the SMS notification text has the string “Motion in %CAMERA%” . When you follow the instructions to set up motion detection in the DiskStation Connect app, it prompts you to:

…
Now click on the Settings tab in the Nofications window
Go to the Camera section of this pane and then check SMS for Motion Detected"
With the Motion Detected row highlighted, choose Edit and then Edit Notification from the top left of this pane
Put the following text into the Subject line and choose Save
Motion in %CAMERA%

This is super-important because the app works by parsing the text in the SMS notification. If the SMS notification from Synology does not have this text, then the motion detection notification will not be processed by the DiskStation SmartApp on the Smartthings side. Hopefully this made sense :slight_smile:

I got this working myself. @chippie, it is important to follow the instructions for the SMS setup. The newer SS UI forces you to save changes first before you can send test message. Just because the test SMS message works doesn’t mean the motion SMS messages will work because they depend on the exact text as per instructions. Also make sure you do not enable any type of SMS rate limiting. I should report I am on the latest software version, and had to use port 5000, while I typically use 5001 that did not seem to work.

I plan to make updates and get the video working on this if others are interested? I had mostly Foscam devices and have a Foscam DH, however I decided to get Amcrest cam and found out after the fact that firmware no longer supports mjpeg streaming without a 2 step process, which makes it close to useless on it’s own. So I thought why not hook into SS API as standard interface and use whatever cams are supported thru SS, without custom apps/software for each kind.

I’ve already updated the DH to show motion as it’s primary status.

2 Likes

Thank you for taking the time to reply.

Unfortuantely, I cannot even get that far. Simply searching for cameras fails once I enter the details in Smartthings. It goes no further, it just comes back with a TimeOut error.

Is there anything I need to do/install on the Synology itself or anything I need to make sure is enabled/disbalbed there please?

EDIT: Also which app and DH are the best ones to use please?

Do you use https to login by any chance?
https doesn’t work, you need to use http.

Also double authentication doesn’t work

No and no… :frowning:

It just will not get past the login as per the logs attached above.

I am not a coder, but if you look in the code, you see the error appears when it reaches the camera preset.
Maybe the issue is with the PTZ presets/patrols in case you have them configured?
I do not have PTZ cameras at home so I can’t be sure.

I use the version of @Matt_K1 from September 8th that doesn’t use the local file server since I couldn’t install the local fire server on my NAS

I use the Classic SmartThings app, and am using the latest from @Matt_K1 repo. I have not setup the local file server, that doesn’t need to be done to detect/configure cameras and motion detection.

@chippie Looking at your logs, it looks to be failing on your camera with cameraId=9. What is the actual camera name? I wonder if you have bad chars in one or your camera names? The logs have it truncated. I think there were bugs that were fixed related to this that maybe only some run into. I would try using the latest code from the @Matt_K1 repo. I rather not have to setup a local server for taking snapshots, and I have another DH for Foscam that has the native stuff working, so I should be able to figure it out over time, just will take me a bit to get to it. I want to make the code work with both based on config.

Hi folks. Migrated to the new app yesterday, and the image capturing functionality totally broke (the UI for the device handler looks completely borked). Unfortunately I haven’t been able to find any developer documentation yet on how exactly this is supposed to work now. Does anyone have any idea?

Just learned from the forums that the image functionality is broken/not available in the new app. I’ll be digging around at some point, but just a warning if you’re using my code – it won’t work in the new SmartThings app.

I’ve been trying to get this to work.

I get stuck at: Login Error. Login Failed. Check your login credentials.

I am positive that the credentials are correct.

Am I missing something?

Trace:
a0af12e8-7b54-49a0-a200-6fe6a9ca91e8 18.36.29: trace trying to handle error [code:400]
a0af12e8-7b54-49a0-a200-6fe6a9ca91e8 18.36.29: trace {“error”:{“code”:400},“success”:false}
a0af12e8-7b54-49a0-a200-6fe6a9ca91e8 18.36.29: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset=“UTF-8”
a0af12e8-7b54-49a0-a200-6fe6a9ca91e8 18.36.29: trace Sending hub action: GET path_to_webapiauth_cgi?api=SYNO.API.Auth&method=Login&version=2&account=Surveillance&passwd=%21kodetilcam&session=SurveillanceStation&format=sid HTTP/1.1
Accept: /
User-Agent: Linux UPnP/1.0 SmartThings
HOST: 192.168.1.15:5000

a0af12e8-7b54-49a0-a200-6fe6a9ca91e8 18.36.29: trace Requesting URL path_to_webapiauth_cgi?api=SYNO.API.Auth&method=Login&version=2&account=Surveillance&passwd=%21kodetilcam&session=SurveillanceStation&format=sid, options: [:]
a0af12e8-7b54-49a0-a200-6fe6a9ca91e8 18.36.29: debug getChildDevices(false), children=0
a0af12e8-7b54-49a0-a200-6fe6a9ca91e8 18.36.29: trace {“data”:{“SYNO.SurveillanceStation.ExternalRecording”:{“maxVersion”:3,“minVersion”:1,“path”:“entry_cgi”,“requestFormat”:“JSON”}},“success”:true}
a0af12e8-7b54-49a0-a200-6fe6a9ca91e8 18.36.29: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset=“UTF-8”
a0af12e8-7b54-49a0-a200-6fe6a9ca91e8 18.36.29: trace Sending hub action: GET path_to_webapiquery_cgi?api=SYNO.API.Info&method=Query&version=1&query=SYNO.SurveillanceStation.ExternalRecording HTTP/1.1
Accept: /
User-Agent: Linux UPnP/1.0 SmartThings
HOST: 192.168.1.15:5000

a0af12e8-7b54-49a0-a200-6fe6a9ca91e8 18.36.29: trace Requesting URL path_to_webapiquery_cgi?api=SYNO.API.Info&method=Query&version=1&query=SYNO.SurveillanceStation.ExternalRecording, options: [:]
a0af12e8-7b54-49a0-a200-6fe6a9ca91e8 18.36.29: debug getChildDevices(false), children=0
a0af12e8-7b54-49a0-a200-6fe6a9ca91e8 18.36.29: trace {“data”:{“SYNO.SurveillanceStation.PTZ”:{“maxVersion”:6,“minVersion”:1,“path”:“entry_cgi”,“requestFormat”:“JSON”}},“success”:true}
a0af12e8-7b54-49a0-a200-6fe6a9ca91e8 18.36.29: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset=“UTF-8”
a0af12e8-7b54-49a0-a200-6fe6a9ca91e8 18.36.28: trace Sending hub action: GET path_to_webapiquery_cgi?api=SYNO.API.Info&method=Query&version=1&query=SYNO.SurveillanceStation.PTZ HTTP/1.1
Accept: /
User-Agent: Linux UPnP/1.0 SmartThings
HOST: 192.168.1.15:5000

a0af12e8-7b54-49a0-a200-6fe6a9ca91e8 18.36.28: trace Requesting URL path_to_webapiquery_cgi?api=SYNO.API.Info&method=Query&version=1&query=SYNO.SurveillanceStation.PTZ, options: [:]
a0af12e8-7b54-49a0-a200-6fe6a9ca91e8 18.36.28: debug getChildDevices(false), children=0
a0af12e8-7b54-49a0-a200-6fe6a9ca91e8 18.36.28: trace {“data”:{“SYNO.SurveillanceStation.Camera”:{“maxVersion”:9,“minVersion”:1,“path”:“entry_cgi”,“requestFormat”:“JSON”}},“success”:true}
a0af12e8-7b54-49a0-a200-6fe6a9ca91e8 18.36.28: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset=“UTF-8”
a0af12e8-7b54-49a0-a200-6fe6a9ca91e8 18.36.28: trace Sending hub action: GET path_to_webapiquery_cgi?api=SYNO.API.Info&method=Query&version=1&query=SYNO.SurveillanceStation.Camera HTTP/1.1
Accept: /
User-Agent: Linux UPnP/1.0 SmartThings
HOST: 192.168.1.15:5000

a0af12e8-7b54-49a0-a200-6fe6a9ca91e8 18.36.28: trace Requesting URL path_to_webapiquery_cgi?api=SYNO.API.Info&method=Query&version=1&query=SYNO.SurveillanceStation.Camera, options: [:]
a0af12e8-7b54-49a0-a200-6fe6a9ca91e8 18.36.28: debug getChildDevices(false), children=0
a0af12e8-7b54-49a0-a200-6fe6a9ca91e8 18.36.28: trace {“data”:{“SYNO.API.Auth”:{“maxVersion”:6,“minVersion”:1,“path”:“auth_cgi”}},“success”:true}
a0af12e8-7b54-49a0-a200-6fe6a9ca91e8 18.36.28: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset=“UTF-8”
a0af12e8-7b54-49a0-a200-6fe6a9ca91e8 18.36.28: trace Sending hub action: GET path_to_webapiquery_cgi?api=SYNO.API.Info&method=Query&version=1&query=SYNO.API.Auth HTTP/1.1
Accept: /
User-Agent: Linux UPnP/1.0 SmartThings
HOST: 192.168.1.15:5000

a0af12e8-7b54-49a0-a200-6fe6a9ca91e8 18.36.28: trace Requesting URL path_to_webapiquery_cgi?api=SYNO.API.Info&method=Query&version=1&query=SYNO.API.Auth, options: [:]
a0af12e8-7b54-49a0-a200-6fe6a9ca91e8 18.36.28: trace force refresh of DS info
a0af12e8-7b54-49a0-a200-6fe6a9ca91e8 18.36.20: trace subscribe to location
a0af12e8-7b54-49a0-a200-6fe6a9ca91e8 18.36.20: trace subscribe to location

Before wasting time in vain, can you confirm if this integration still works? I would like to share a camera on ST. Thanks

The app stopped working for me after the upgrade to the new Surveillance Station and I don’t have time to figure it out. Got motion detection to work via an IFTTT webhook though, if anyone is interested. You basically:

  • create a virtual switch in ST
  • create an applet in IFTTT to trigger that virtual switch on receipt of a webhook request
  • in Surveillance Station, use the webhook URL in the SMS notifications fields
  • create a Webcore piston to do whatever action you want to do in ST based on the status of the virtual switch

Caveat though is that with a free version of IFTTT you can not parse the fields on the webhook request (filtering is a feature they charge for), so that means you can get it to work if you only care about motion detection from a single camera.

Actually I just discovered that you can trigger Webcore pistons with a webhook as well, so no need for IFTTT or a virtual switch. And you can filter the events as needed in Webcore, which allows for more than 1 camera, etc. Just set the piston url as the url in the SMS Notifications in Surveillance Station.