Synology Diskstation & Cameras

The SmartApp has been working great for me but for the past couple of days, I’ve noticed that it no longer seems to be able to capture any images automatically or manually. The motion detection still works and I can see the motion alert come on, but just not with the pictures.

Anyone else facing this issue?

@Ray_Edwards I’m not sure how the smarttiles images work, so I’m not sure what the issue is. Can you see them in the device when you look in the SmartThings app?

@mitchell_lu66 It looks like the cameras are from two different SmartApps as they look to have 2 separate login keys. The first one has one key and the last two have a different key. Is just the first one working? If so, I would try running the SmartApp again for the last 2 cameras.

@jononthelam I would suggest just running through the SmartApp setup process again. You don’t have to remove your cameras or anything, just run through the existing SmartApp that you have with the same settings. The SmartApp is probably having issues logging back in after an upgrade, and doing it manually should fix the issue.

Thanks for the suggestion @swanny. I tried it but it didn’t seem to work. I then tried removing the camera and rerunning the setup which completed fine. Still couldn’t take any pictures though :disappointed:

So I then tried to copy your latest code and republished them, set up the camera again… still no joy. It seems to be communicating fine with the DiskStation but it’s just not taking or uploading the pictures.

I’m really confused as to why this isn’t working anymore. I just deleted both the SmartApp and Device Handler, recreated them, and went through the setup. Still stuck with the same problem.

I can’t tell if it’s not getting the stream from my camera, or if it’s not able to upload the picture. My issue seems similar to @mitchell_lu66, where he can’t seem to take any snapshots with two cameras (though it works for one of them).

‎4‎:‎19‎:‎54‎ ‎PM: debug take command is: GET /webapi/entry.cgi?api=SYNO.SurveillanceStation.Camera&method=GetSnapshot&version=1&_sid=J1laGYBzuoUV.1440M7N003606&cameraId=3 HTTP/1.1
4‎:‎19‎:‎54‎ ‎PM: trace sending GetSnapshot
4‎:‎19‎:‎54‎ ‎PM: trace take picture from camera 3 default stream

I have exactly same issue, everything works:
motion detection - OK
force recording from mobile app - OK
moving camera UP/DOWN from mobile app - OK

only one thing did not work is taking snapshot

0273bb7d-1ee3-428c-8c82-31ada7221032 2:29:12 PM: debug take command is: GET /webapi/entry.cgi?api=SYNO.SurveillanceStation.Camera&method=GetSnapshot&version=1&_sid=PZB.bIeHS8Gg.13A0LNN000485&cameraId=1 HTTP/1.1
HOST: 192.168.105.22:5000
Accept: image/jpeg
0273bb7d-1ee3-428c-8c82-31ada7221032 2:29:12 PM: trace sending GetSnapshot
0273bb7d-1ee3-428c-8c82-31ada7221032 2:29:12 PM: trace take picture from camera 1 default stream

FYI
When I try this url in Chrome browser, I DO have the snapshot picture
http://192.168.105.22:5000/webapi/entry.cgi?api=SYNO.SurveillanceStation.Camera&method=GetSnapshot&version=4&_sid=PZB.bIeHS8Gg.13A0LNN000485&cameraId=1

Ok. I feel a little better that I’m not the only one facing the issue, so that at least rules out problems with my set up. Still bummed that it’s not working though.

I sent a ticket to SmartThings support and they basically just came back and said they do not support image captures from video streams.

Yeah, I have had this problem from the beginning! I don’t know why.

I can also view the pictures from the browser. However I also have issues connecting the smartapp, most of the time it gives me a timeout error or something else. Completely unrelated though.

Cheers.

Just started magically working for me again, without any action from my end. Pretty sure there was a platform issue that ST as usual doesn’t own up to.

Thanks swanny, I worked out how to do it with smarttiles using the stop motion function in ST, it works great and you can remotely acess it easily

There seems to be challenges with the way the snapshots go through the Amazon cloud using the SmartThings interface. There are other threads that talk about similar issues with different SmartApps and DeviceTypes. I wish I could help you guys more, but I’ve tried several times and can’t get it more reliable.

@swanny
Don’t be disappointed!

Your work is very helpful to me, even I could not get snapshot from “TAKE” yet.
Other functions work very well:

  • Motion detection from your code, my Foscam + Synology even better than my Aeontec multi sensor
  • Trigger to record video to Synology when motion detected works OK
  • Trigger to record video to Synology when pushing the button on your app works great
  • Moving camera UP/DOWN also works correctly

For the issue with taking snapshot, not a big problem since I can check this in Smarttiles when I receive motion notification from your app

Thanks for your great work!

FYI: I’ve tried many other device types for my foscam camera with Smartthings, but never could get any snapshot for Smartthings mobile app.
Only get it on Smarttiles

I’ve noticed something. If I set camera stream 1 to 640x480 my snapshots work. If I set it higher they don’t. I think there is a limit that ST puts on the size of images, like less than 1 megabyte or something. I’ve tried to play with stream 2 which on my cameras 640x480 is the only choice…but haven’t found success yet. If you try it, let me know so I can learn something new. :wink:

I’ve tried even lower resolution
stream 1 640x480,
stream 2 320x240
no success!

The image goes from your camera device up through to the Amazon cloud using ST commands. There seems to be some kind of issue where the communication takes too long and never actually gets to the other end. Sometimes using a smaller image will get around the problem, and sometimes it won’t. It seems to be different for different people and may have to do with network speed for sending the image from your home to the Amazon cloud location where the images are stored.

Nuts I’d been using this for awhile. Stopped working, not sure why. So I removed it from ST, removed the code from my IDE, updated it with your latest, and now just get a “Network Timeout” when I try to connect the app again. Not sure where to go next to try to restore function

@Arlo_Miller Did the IP address of the Diskstation change? I would check that first. You could also open up the log in the dev tools and see if any errors appear. If you want to PM me the logs, I can take a look too.

Swanny,
i think that this is great but am having a issue. I am able to find my cam and i selected it but when i click done i get a error saying to contact the dev.

here the log

96551681-e050-415a-9919-c59518fe5e44 7:49:35 PM CDT: error java.lang.NullPointerException: Cannot get property ‘authorities’ on null object
96551681-e050-415a-9919-c59518fe5e44 7:49:27 PM CDT: debug getChildDevices(false), children=0
96551681-e050-415a-9919-c59518fe5e44 7:49:27 PM CDT: trace {“error”:{“code”:400,“errors”:{“param1”:"",“param2”:""}},“success”:false}
96551681-e050-415a-9919-c59518fe5e44 7:49:27 PM CDT: trace DISKSTATION REPONSE TYPE: Content-Type: application/json; charset=“UTF-8"
96551681-e050-415a-9919-c59518fe5e44 7:49:27 PM CDT: debug getChildDevices(false), children=0
96551681-e050-415a-9919-c59518fe5e44 7:49:27 PM CDT: trace {“error”:{“code”:400,“errors”:{“param1”:”",“param2”:""}},“success”:false}
96551681-e050-415a-9919-c59518fe5e44 7:49:27 PM CDT: trace DISKSTATION REPONSE TYPE: Content-Type: application/json; charset=“UTF-8"
96551681-e050-415a-9919-c59518fe5e44 7:49:27 PM CDT: debug getChildDevices(false), children=0
96551681-e050-415a-9919-c59518fe5e44 7:49:27 PM CDT: trace {“data”:{“audioOut”:false,“fisheyeType”:{},“ptzContinuous”:false,“ptzHome”:false,“ptzPan”:false,“ptzPresetNumber”:0,“ptzTilt”:false,“ptzZoom”:false},“success”:true}
96551681-e050-415a-9919-c59518fe5e44 7:49:27 PM CDT: trace DISKSTATION REPONSE TYPE: Content-Type: application/json; charset=“UTF-8"
96551681-e050-415a-9919-c59518fe5e44 7:49:26 PM CDT: debug getChildDevices(false), children=0
96551681-e050-415a-9919-c59518fe5e44 7:49:26 PM CDT: trace {“data”:{“cameras”:[{“ADCap”:0,“DINum”:0,“DONum”:0,“MDCap”:4,“TDCap”:0,“additional”:{“device”:{“channel”:“1”,“httpPort”:88,“model”:“FI9803P V2”,“vendor”:“FOSCAM”}},“audioCap”:true,“audioOut”:false,“audioType”:2,“autoFocus”:false,“autoPan”:0,“blAudioDisableRec”:false,“blAudioPriv”:true,“blDisableRec”:false,“blEnableExtDI”:false,“blLiveviewPriv”:true,“blPresetSpeed”:false,“blPtzShowIcon”:false,“blReceivePocZero”:false,“camIdOnRecServer”:0,“camLiveMode”:0,“camMobileLiveMode”:0,“camMountType”:0,“camPath”:“cnRzcDovL2FkbWluOlJtRzk5MjUwNCMhQDE3Mi4xNi41LjIwOjU1NC92aWRlb01haW4=”,“camRecShare”:“surveillance”,“camRecStorageStatus”:0,“camRecVolume”:“volume1”,“camRotOption”:0,“camStatus”:1,“channel_id”:“1”,“daybegin”:8,“dayend”:18,“deleted”:false,“detailInfo”:{“blAudioDisableRec”:false,“blDisableRec”:false,“blEnableExtDI”:false,“camApplyCodecOptimization”:false,“camApplyKeyFrameInterval”:false,“camAudioType”:2,“camChannel”:“1”,“camCodecOptimization”:0,“camDynamicGop”:false,“camFolder”:“Patio”,“camFov”:””,“camFps”:10,“camIP”:"172…[TRUNCATED]
96551681-e050-415a-9919-c59518fe5e44 7:49:26 PM CDT: trace DISKSTATION REPONSE TYPE: Content-Type: application/json; charset="UTF-8"
96551681-e050-415a-9919-c59518fe5e44 7:49:25 PM CDT: debug getChildDevices(false), children=0
96551681-e050-415a-9919-c59518fe5e44 7:49:25 PM CDT: trace {“data”:{“sid”:“wADMgs6WrNkxE1610MCN021600”},“success”:true}
96551681-e050-415a-9919-c59518fe5e44 7:49:25 PM CDT: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset="UTF-8"
96551681-e050-415a-9919-c59518fe5e44 7:49:25 PM CDT: debug getChildDevices(false), children=0
96551681-e050-415a-9919-c59518fe5e44 7:49:25 PM CDT: trace {“data”:{“SYNO.SurveillanceStation.ExternalRecording”:{“maxVersion”:2,“minVersion”:1,“path”:“entry.cgi”,“requestFormat”:“JSON”}},“success”:true}
96551681-e050-415a-9919-c59518fe5e44 7:49:25 PM CDT: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset="UTF-8"
96551681-e050-415a-9919-c59518fe5e44 7:49:24 PM CDT: debug getChildDevices(false), children=0
96551681-e050-415a-9919-c59518fe5e44 7:49:24 PM CDT: trace {“data”:{“SYNO.SurveillanceStation.PTZ”:{“maxVersion”:4,“minVersion”:1,“path”:“entry.cgi”,“requestFormat”:“JSON”}},“success”:true}
96551681-e050-415a-9919-c59518fe5e44 7:49:24 PM CDT: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset="UTF-8"
96551681-e050-415a-9919-c59518fe5e44 7:49:24 PM CDT: debug getChildDevices(false), children=0
96551681-e050-415a-9919-c59518fe5e44 7:49:24 PM CDT: trace {“data”:{“SYNO.SurveillanceStation.Camera”:{“maxVersion”:8,“minVersion”:1,“path”:“entry.cgi”,“requestFormat”:“JSON”}},“success”:true}
96551681-e050-415a-9919-c59518fe5e44 7:49:24 PM CDT: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset="UTF-8"
96551681-e050-415a-9919-c59518fe5e44 7:49:23 PM CDT: debug getChildDevices(false), children=0
96551681-e050-415a-9919-c59518fe5e44 7:49:23 PM CDT: trace {“data”:{“SYNO.API.Auth”:{“maxVersion”:6,“minVersion”:1,“path”:“auth.cgi”}},“success”:true}
96551681-e050-415a-9919-c59518fe5e44 7:49:23 PM CDT: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset="UTF-8"
96551681-e050-415a-9919-c59518fe5e44 7:49:20 PM CDT: trace subscribe to location
96551681-e050-415a-9919-c59518fe5e44 7:48:57 PM CDT: trace subscribe to location

This is so cool!! I got it setup and working. I had a question that concerns having the ST trigger recording and snapshots. How can this be done so that the recording/snapshot saves itself to the Diskstation and, more specifically, to instruct the recording/snapshot to trigger only when I am in certain modes.

I used the ST app and snapshots are simply saved locally to the app (in addition there is a notification requirement that is really silly IMO due to a plethora of false alarms which I think I can work out on my own) but what I would really like is to have ST triggers force the camera to send snapshots to the disk station.

Also, I have yet to receive notifications from the disk station itself but this may be my newbie-ness at the disk station unit.

Any help from a more seasoned veteran would be appreciated.

Great work swanny!!! Love this app and driver! The only thing that would make it perfect is if we had a way to activate / deactivate the cams based on prescience or hub mode.

Klent