Synology Diskstation & Cameras

@mitchell_lu66 When the setup process for the SmartApp runs, it needs to get some specific links from Surveillance Station to call other commands. The message “Unable to send to api” says what command couldn’t be found.

Usually if something like this happens, you can try to setup the app again until the errors do not occur. Note that I am running the same versions of the software you are.

@swanny I will try and see if it work, recently, My DS-211J really unstable after 1 x 3TB insert with existing 2TB( original is 2TB x2) . though I have re-install the DSM, It is still slow, Do not know if that is the problem, Do you mention you have run the same versions of the software, Is that SmartThings IOS version, or DSM or SurveillanceStation, please be advise !!

@mitchell_lu66 We have the same SmartThings app version, DSM, and SurveillanceStation versions.

Looking at the errors again, I think that the SurveillanceStation is not being communicated with through the API. The SmartApp gets the DSM connection and logs in, but then does not get the SurveillanceStation connection information. It may be some kind of DSM/SurveillanceStation install problem as you mentioned if it doesn’t work when you try it again.

@swanny First off, thanks so much for contributing your time and effort to the community.
I just downloaded and installed your project, but I’m having some issues during setup.

I go through setup, and it does discover my 5 cameras. However, when I go to add the cameras, I get the following screens, then the last error.

Error - bad state. Unable to complete page configuration.

Here are the logs:

aa986b3a-3508-4f4c-af47-9b5f8568d06a 22:06:01: trace Did not use {“data”:{“offset”:0,“presets”:[{“id”:2,“name”:“home”,“type”:1}],“total”:1},“success”:true}
aa986b3a-3508-4f4c-af47-9b5f8568d06a 22:06:01: trace {“data”:{“offset”:0,“presets”:[{“id”:2,“name”:“home”,“type”:1}],“total”:1},“success”:true}
aa986b3a-3508-4f4c-af47-9b5f8568d06a 22:06:01: trace DISKSTATION REPONSE TYPE: Content-Type: application/json; charset=“UTF-8”
aa986b3a-3508-4f4c-af47-9b5f8568d06a 22:06:00: trace Did not use {“data”:{“audioOut”:false,“fisheyeType”:{},“ptzContinuous”:false,“ptzHome”:true,“ptzPan”:true,“ptzPresetNumber”:16,“ptzTilt”:true,“ptzZoom”:false},“success”:true}
aa986b3a-3508-4f4c-af47-9b5f8568d06a 22:06:00: trace {“data”:{“audioOut”:false,“fisheyeType”:{},“ptzContinuous”:false,“ptzHome”:true,“ptzPan”:true,“ptzPresetNumber”:16,“ptzTilt”:true,“ptzZoom”:false},“success”:true}
aa986b3a-3508-4f4c-af47-9b5f8568d06a 22:06:00: trace DISKSTATION REPONSE TYPE: Content-Type: application/json; charset=“UTF-8”
aa986b3a-3508-4f4c-af47-9b5f8568d06a 22:05:58: trace Did not use {“data”:{“audioOut”:false,“fisheyeType”:{},“ptzContinuous”:false,“ptzHome”:true,“ptzPan”:true,“ptzPresetNumber”:8,“ptzTilt”:true,“ptzZoom”:false},“success”:true}
aa986b3a-3508-4f4c-af47-9b5f8568d06a 22:05:58: trace {“data”:{“audioOut”:false,“fisheyeType”:{},“ptzContinuous”:false,“ptzHome”:true,“ptzPan”:true,“ptzPresetNumber”:8,“ptzTilt”:true,“ptzZoom”:false},“success”:true}
aa986b3a-3508-4f4c-af47-9b5f8568d06a 22:05:58: trace DISKSTATION REPONSE TYPE: Content-Type: application/json; charset=“UTF-8”
aa986b3a-3508-4f4c-af47-9b5f8568d06a 22:05:55: trace Did not use {“data”:{“offset”:0,“total”:0},“success”:true}
aa986b3a-3508-4f4c-af47-9b5f8568d06a 22:05:55: trace {“data”:{“offset”:0,“total”:0},“success”:true}
aa986b3a-3508-4f4c-af47-9b5f8568d06a 22:05:55: trace DISKSTATION REPONSE TYPE: Content-Type: application/json; charset=“UTF-8”
aa986b3a-3508-4f4c-af47-9b5f8568d06a 22:05:48: trace Did not use {“data”:{“SYNO.SurveillanceStation.Camera”:{“maxVersion”:8,“minVersion”:1,“path”:"_______________________________________________________entry.cgi",“requestFormat”:“JSON”}},“success”:true}
aa986b3a-3508-4f4c-af47-9b5f8568d06a 22:05:48: trace {“data”:{“SYNO.SurveillanceStation.Camera”:{“maxVersion”:8,“minVersion”:1,“path”:"_______________________________________________________entry.cgi",“requestFormat”:“JSON”}},“success”:true}
aa986b3a-3508-4f4c-af47-9b5f8568d06a 22:05:48: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset=“UTF-8”

Any suggestions?

Thanks!

@wesleyjw Hmm. I was able to install mine from scratch, but I did notice that the logging was not as verbose as it was before. It may be a backend changes that has limited that part, but it shouldn’t affect the actual performance of the system.

Did you use the plus sign on the 3rd screen to choose which cameras to add to the system? Maybe just try one to start and add more if that works.

You should also see a large wall of text about setting up motion on the 4th screen where you currently show blank. Not sure why that would be happening. Can you try again and PM me more logs?

@swanny Thanks for helping me fix this swanny! You are indeed a superstar!

Hi All,

Just wondering, does anyone know if this will work with the QNAP NAS surveillance station? Got one of those and this seems very interesting!

I don’t believe it will. A number of the commands are Synology specific. Sorry!

Thanks again for writing this code.
I can’t seem to be able to add my camera through the app. It crashes at the last screen (connects to diskstation, finds the camera, I select it. But when I hit connect it crashes the smarthings app and no device added…
Any suggestions? Thanks and see log below

The last line is an error…

2e953fca-586d-46d2-8223-51678522380e 10:48:47 AM: error org.springframework.security.oauth2.provider.NoSuchClientException: No client with requested id: null @ line 52
2e953fca-586d-46d2-8223-51678522380e 10:48:33 AM: debug getChildDevices(false), children=0
2e953fca-586d-46d2-8223-51678522380e 10:48:33 AM: trace {“error”:{“code”:400,“errors”:{“param1”:"",“param2”:""}},“success”:false}
2e953fca-586d-46d2-8223-51678522380e 10:48:33 AM: trace DISKSTATION REPONSE TYPE: Content-Type: application/json; charset=“UTF-8"
2e953fca-586d-46d2-8223-51678522380e 10:48:33 AM: debug getChildDevices(false), children=0
2e953fca-586d-46d2-8223-51678522380e 10:48:33 AM: trace {“error”:{“code”:400,“errors”:{“param1”:”",“param2”:""}},“success”:false}
2e953fca-586d-46d2-8223-51678522380e 10:48:33 AM: trace DISKSTATION REPONSE TYPE: Content-Type: application/json; charset=“UTF-8"
2e953fca-586d-46d2-8223-51678522380e 10:48:32 AM: debug getChildDevices(false), children=0
2e953fca-586d-46d2-8223-51678522380e 10:48:32 AM: trace {“data”:{“audioOut”:false,“fisheyeType”:{},“ptzContinuous”:false,“ptzHome”:false,“ptzPan”:false,“ptzPresetNumber”:0,“ptzTilt”:false,“ptzZoom”:false},“success”:true}
2e953fca-586d-46d2-8223-51678522380e 10:48:32 AM: trace DISKSTATION REPONSE TYPE: Content-Type: application/json; charset=“UTF-8"
2e953fca-586d-46d2-8223-51678522380e 10:48:32 AM: trace {“data”:{“cameras”:[{“ADCap”:0,“DINum”:0,“DONum”:0,“MDCap”:1,“TDCap”:0,“additional”:{“device”:{“channel”:“1”,“httpPort”:80,“model”:“DCS-932L”,“vendor”:“D-Link”}},“audioCap”:false,“audioOut”:false,“audioType”:0,“autoFocus”:false,“autoPan”:0,“blAudioDisableRec”:false,“blAudioPriv”:true,“blDisableRec”:false,“blLiveviewPriv”:true,“blPresetSpeed”:false,“blReceivePocZero”:false,“camIdOnRecServer”:0,“camLiveMode”:0,“camMountType”:0,“camPath”:“aHR0cDovL2FkbWluOnBvaXV5dHJlQDE5Mi4xNjguMS45Nzo4MC9tanBlZy5jZ2k=”,“camRotOption”:0,“camStatus”:1,“channel_id”:“1”,“daybegin”:8,“dayend”:18,“deleted”:false,“detailInfo”:{“blAudioDisableRec”:false,“blDisableRec”:false,“camAudioType”:0,“camChannel”:“1”,“camFolder”:“Dlink DCS 932L”,“camFov”:””,“camFps”:7,“camIP”:“192.168.1.97”,“camIsRotByDate”:true,“camIsRotBySpace”:true,“camIsSetEvtPrefix”:false,“camIsSetRecFolder”:false,“camLiveBitrateCtrl”:1,“camLiveCbrBitrate”:0,“camLiveFps”:7,“camLiveMode”:0,“camLiveQuality”:“5”,“camLiveResolution”:“640x480”,“camLiveStreamNo”:0,“camMobileBitrateCtrl”:…[TRUNCATED]
2e953fca-586d-46d2-8223-51678522380e 10:48:32 AM: debug getChildDevices(false), children=0
2e953fca-586d-46d2-8223-51678522380e 10:48:32 AM: trace DISKSTATION REPONSE TYPE: Content-Type: application/json; charset=“UTF-8"
2e953fca-586d-46d2-8223-51678522380e 10:48:30 AM: debug getChildDevices(false), children=0
2e953fca-586d-46d2-8223-51678522380e 10:48:30 AM: trace {“data”:{“sid”:“X69cu5HQRgUcgCBL8N00871”},“success”:true}
2e953fca-586d-46d2-8223-51678522380e 10:48:30 AM: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset=“UTF-8"
2e953fca-586d-46d2-8223-51678522380e 10:48:29 AM: debug getChildDevices(false), children=0
2e953fca-586d-46d2-8223-51678522380e 10:48:29 AM: trace {“data”:{“SYNO.SurveillanceStation.ExternalRecording”:{“maxVersion”:2,“minVersion”:1,“path”:”_______________________________________________________entry.cgi”,“requestFormat”:“JSON”}},“success”:true}
2e953fca-586d-46d2-8223-51678522380e 10:48:29 AM: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset=“UTF-8"
2e953fca-586d-46d2-8223-51678522380e 10:48:29 AM: debug getChildDevices(false), children=0
2e953fca-586d-46d2-8223-51678522380e 10:48:29 AM: trace {“data”:{“SYNO.SurveillanceStation.PTZ”:{“maxVersion”:4,“minVersion”:1,“path”:”_______________________________________________________entry.cgi",“requestFormat”:“JSON”}},“success”:true}
2e953fca-586d-46d2-8223-51678522380e 10:48:29 AM: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset=“UTF-8"
2e953fca-586d-46d2-8223-51678522380e 10:48:28 AM: debug getChildDevices(false), children=0
2e953fca-586d-46d2-8223-51678522380e 10:48:28 AM: trace {“data”:{“SYNO.SurveillanceStation.Camera”:{“maxVersion”:8,“minVersion”:1,“path”:”_______________________________________________________entry.cgi",“requestFormat”:“JSON”}},“success”:true}
2e953fca-586d-46d2-8223-51678522380e 10:48:28 AM: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset="UTF-8"
2e953fca-586d-46d2-8223-51678522380e 10:48:27 AM: debug getChildDevices(false), children=0
2e953fca-586d-46d2-8223-51678522380e 10:48:27 AM: trace {“data”:{“SYNO.API.Auth”:{“maxVersion”:4,“minVersion”:1,“path”:“auth.cgi”}},“success”:true}
2e953fca-586d-46d2-8223-51678522380e 10:48:27 AM: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset="UTF-8"
2e953fca-586d-46d2-8223-51678522380e 10:48:27 AM: trace force refresh of DS info
2e953fca-586d-46d2-8223-51678522380e 10:47:47 AM: trace subscribe to location

I think you need to turn on OAuth. Open up the Diskstation (Connect) SmartApp. Click on App Settings. Scroll down to where it says OAuth and click on it. Enable OAuth there. Let me know if that doesn’t fix it.

Thanks. I thought it was on but I guess not. It worked. I was able to finish the install.
Now the devices did go through. I can use the arrow to turn the camera but it won’t display any image. Any suggestion? Thanks for your help.

If you click on the “Take” button, does anything happen? For me it usually takes about 5 seconds and then a new image appears. If it doesn’t work, feel free to send me the logs and I’ll check it out.

Live video is not supported at this time. Maybe at some point if ST opens up this capability to developers.

It works thanks. I must have missed that part. I guess I will try to enable motion now. Thanks a lot!

Once you have motion setup, you can use the attack “Take” button in the bottom right to make it take a picture every time motion occurs. I find that handy for a quick view of what was likely recorded by the Diskstation itself.

Hi, I’m stuck at the SMS notification step where I have to enter an API ID, i have no clue what this is. Help please?

Where do you see something about an API ID? I’m not aware of anything like that in the steps.

I am using surveillance station 7.1. It is in the same sms notifications tab. It is right under username and password.

Hmm. It shows up for a second for me and then goes away, but I already have my other values set up. I don’t think that value should matter. Try just leaving it as the default or putting a small number in it.

I get “SMS test failed” when I tried a test message. Does that matter?

BTW swanny, thanks for creating the app and helping out!