SmartThings Community

Synology Diskstation & Cameras

project_cameras
(swanny) #132

By the way, that sounds like a good setup. I just never made the SmartApp generic as I was too lazy. :smile:

1 Like
(Amauri Viguera) #133

It’s actually a pretty useful setup, so thanks for putting all the effort into doing the hard part… :smile:

I’ve had all kinds of issues with the house changing modes and geofences, even using AutoLocation, so it’s a pretty solid setup now where I have widgets on my phone that I can switch the house mode manually or switch the camera presets manually with a single tap – that seems to have escaped the folks on the “Smart Home Monitor” thread, but I digress. :smile:

(PAT) #134

All my cameras are Foscam. Simple names Driveway, Back and Garage. They are setup as the specific camera type on the Diskstation. Driveway for example is Foscam FI8919W. Garage is Foscam FI8918W.

Thanks again.

(swanny) #135

@pmanno6 The cameras will often stop responding if the DS has been rebooted since the SmartApp was installed. If you have rebooted your DS since setting up the SmartApp, please try going through setup on the app again. Can you go into the IDE and message me the log files for the SmartApp when you try it? To debug any further, I’ll need that log file and the log when you try to move the camera or take a picture.

(PAT) #136

I reinstalled this morning and sent you the log. When I went to take a picture to get the log it was working. I had tried the reboot and reinstall previously without success but today we are good. Photoburst worked too. I really appreciate the help. Great app.

(swanny) #137

@pmanno6 Great. Happy it is working for you now.

(Matt B) #138

Great work @swanny, thank you! What is the best for motion detection, using the camera or the surveillance station? Or do they both work equally well?

(swanny) #139

@becma27 I just use the camera for motion detection setting. I think the camera doing the motion detection would reduce network usage if you aren’t continuously recording. I would imagine either would work fine though.

(Mitchell Lu) #140

Hi ! swanny

I need your help again, I used to have 2 D-link camera working on DS-211J with SurveillanceStation 6.3-3380 version, My code of Disktation (Connect) and Disktation Camera are not the same version as you put at Github. However it work anyway… Recently, the iOS version SmartThings upgrade to new version 2.0.2, It also success migrate to the new version… However, recently, My DS-211J crash, and I have to install the operating system again,and I delete all my old code at SmartThings and copy your new codes… and I also install the new SurveillanceStation 7.0-3778, and My DSM also upgrade to DSM 5.2-5592 Update 4, However, It no longer allow me to communicate to DS-211J to SmartThinsg again, Please see attachment

P.S. most of time, It sill stop at the line with Bold-Italy character, and no longer process… I have several time success connect and build the Camera, but Most of time the icon of Motion are always one,and no message at recently… I really nee help, as all my camera motion detection are no longer working

4a03cf3-47ee-4782-a314-77126a0b2262 GMT+820:58:25秒: trace Available APIs are [SYNO.SurveillanceStation.ExternalRecording:null, SYNO.API.Info:[maxVersion:1, path:query.cgi, minVersion:1], SYNO.API.Auth:[maxVersion:4, minVersion:1, path:auth.cgi], SYNO.SurveillanceStation.PTZ:null, SYNO.SurveillanceStation.Camera:null]
d4a03cf3-47ee-4782-a314-77126a0b2262 GMT+820:58:25秒: trace Unable to send to api SYNO.SurveillanceStation.Camera

d4a03cf3-47ee-4782-a314-77126a0b2262 GMT+820:58:25秒: debug getChildDevices(false), children=0

d4a03cf3-47ee-4782-a314-77126a0b2262 GMT+820:58:25秒: trace {“data”:{“sid”:“AYjMfrZh3ZzdcB2HCN09382”},“success”:true}
d4a03cf3-47ee-4782-a314-77126a0b2262 GMT+820:58:25秒: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset=“UTF-8”
d4a03cf3-47ee-4782-a314-77126a0b2262 GMT+820:58:25秒: trace Available APIs are [SYNO.SurveillanceStation.ExternalRecording:null, SYNO.API.Info:[maxVersion:1, path:query.cgi, minVersion:1], SYNO.API.Auth:[maxVersion:4, minVersion:1, path:auth.cgi], SYNO.SurveillanceStation.PTZ:null, SYNO.SurveillanceStation.Camera:null]
d4a03cf3-47ee-4782-a314-77126a0b2262 GMT+820:58:25秒: trace Unable to send to api SYNO.SurveillanceStation.Camera
d4a03cf3-47ee-4782-a314-77126a0b2262 GMT+820:58:25秒: debug getChildDevices(false), children=0
d4a03cf3-47ee-4782-a314-77126a0b2262 GMT+820:58:25秒: trace {“data”:{“sid”:“AYjMfrZh3ZzdcB2HCN09382”},“success”:true}
d4a03cf3-47ee-4782-a314-77126a0b2262 GMT+820:58:25秒: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset=“UTF-8”
d4a03cf3-47ee-4782-a314-77126a0b2262 GMT+820:58:21秒: trace Did not use {“data”:{“SYNO.SurveillanceStation.ExternalRecording”:{“maxVersion”:2,“minVersion”:1,“path”:"_______________________________________________________entry.cgi",“requestFormat”:“JSON”}},“success”:true}
d4a03cf3-47ee-4782-a314-77126a0b2262 GMT+820:58:21秒: trace {“data”:{“SYNO.SurveillanceStation.ExternalRecording”:{“maxVersion”:2,“minVersion”:1,“path”:"_______________________________________________________entry.cgi",“requestFormat”:“JSON”}},“success”:true}
d4a03cf3-47ee-4782-a314-77126a0b2262 GMT+820:58:21秒: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset=“UTF-8”
d4a03cf3-47ee-4782-a314-77126a0b2262 GMT+820:58:20秒: debug getChildDevices(false), children=0
d4a03cf3-47ee-4782-a314-77126a0b2262 GMT+820:58:20秒: trace {“data”:{“SYNO.SurveillanceStation.Camera”:{“maxVersion”:8,“minVersion”:1,“path”:"_______________________________________________________entry.cgi",“requestFormat”:“JSON”}},“success”:true}
d4a03cf3-47ee-4782-a314-77126a0b2262 GMT+820:58:20秒: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset=“UTF-8”
d4a03cf3-47ee-4782-a314-77126a0b2262 GMT+820:58:20秒: debug getChildDevices(false), children=0
d4a03cf3-47ee-4782-a314-77126a0b2262 GMT+820:58:20秒: trace {“data”:{“SYNO.SurveillanceStation.PTZ”:{“maxVersion”:3,“minVersion”:1,“path”:"_______________________________________________________entry.cgi",“requestFormat”:“JSON”}},“success”:true}
d4a03cf3-47ee-4782-a314-77126a0b2262 GMT+820:58:20秒: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset=“UTF-8”
d4a03cf3-47ee-4782-a314-77126a0b2262 GMT+820:58:17秒: debug getChildDevices(false), children=0
d4a03cf3-47ee-4782-a314-77126a0b2262 GMT+820:58:17秒: trace {“data”:{“SYNO.API.Auth”:{“maxVersion”:4,“minVersion”:1,“path”:“auth.cgi”}},“success”:true}
d4a03cf3-47ee-4782-a314-77126a0b2262 GMT+820:58:17秒: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset=“UTF-8”

(swanny) #141

@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.

(Mitchell Lu) #142

@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 !!

(swanny) #143

@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.

(Wes) #144

@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!

(swanny) #145

@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?

(Wes) #146

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

(Dean Smith) #147

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!

(swanny) #148

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

#149

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

(swanny) #150

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.

#151

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.