Synology Diskstation & Cameras

I cannot find a log for the smartapp.

I got this to load. Just had copied the wrong code for the device. I do appreciate your initial reply. I have a DS214+ and 3 cameras. So far my cameras aren’t responding but trying to work through it. App has loaded and all the devices are created. Photo burst is setup. I will cycle everything on and off and see what that does.

Thanks again for sharing your app.

No problem. Glad you got it to install and see the cameras at least. If you didn’t get them to respond yet, what type of cameras do you have and are they set up as the specific brand of camera in the Diskstation or as a generic camera? What are they named? I did have some old bugs based on camera naming.

I just moved and reconnected everything, and even the “motion alert via fake sms” works as expected, which is great.

The only catch is that the presets don’t seem to work for any of my FI8910Ws or FI8904Ws for some reason. Pressing “Home” on the device created by Diskstation Connect does actually make the camera patrol back to Home, but if I press preset up / down the camera doesn’t move – and there’s no entry in the log for any activity.

Any ideas?

– edit –

Actually I take that back… it seems like the Synology presets are independent of the on-camera presets, so I had to go back and create new presets for the cameras. Then I had to re-run the Diskstation Connect app to re-discover the cameras and now when I press the preset up / down button I see the logs show “ps up” and “ps down”

But the cameras still don’t move… :smile:

Did you then hit the button between the preset up and preset down buttons with the name of the preset to trigger the camera to move?

AHA!!! :smile:

Seriously though, the button originally had “N/A” on it so I just ignored it, but after reconnecting everything (after I created the presets) now I see that it actually has the preset names from the Diskstation, and when I press the button it actually makes the camera go to that preset, so it’s working.

Maybe a bit of an interface tweak to make the buttons stand out more?

A quick question about some functionality that might be available, but I can’t find it…

Is it possible to activate the presets based on home mode or other ST triggers? For example, can I “talk” to the device and tell it to go to preset x when the house switches to “away” mode?

I know there are other Foscam device types / SmartApps that might make this possible, but since I already have the cameras created as part of the DiskStation Connect app, I’d rather use that instead.

The Diskstation Camera devices do have that capability but the challenge is triggering it as it uses custom device commands.

There are custom commands for:
command "home"
command “presetGoName”, [“string”]
command “patrolGoName”, [“string”]
as well as less useful ones for zooming and moving.

Here is an example I use to make our living room camera point away from the room when an adult is home. It uses camera.home() to go to the home position and camera.presetGoName(“middle”) to go to a specific preset position.

That’s precisely the sort of thing that I’m looking for, but I can understand the challenge.

I guess what you could do is tell people to create two custom presets with specific names, like “home” (pointing up) and “away” (pointing at the room) and just hardcode the presets into that code.

I made some changes to the code to use the hardcoded preset names and it’s actually a good approach, since you can tie this in with @joshua_lyon’s Tasker integration.

I created two new presets in the Surveillance Station app just for this – so it wouldn’t interfere with anything else – called “monitor” and “ignore” – you have to re-run the app and re-connect the cameras, probably so that it discovers the new preset names?

Either way, I then changed the camera.home() call to camera.presetGoName(“ignore”) (which is my preset to point the camera up and ignore people) and the camera.presetGoName(“middle”) to camera.presetGoName(“monitor”).

This also helps with the Tasker / SharpTools integration, since I can create a tasker scene that puts all the cameras into monitoring mode by using the presetGoName command with the “monitor” argument.

1 Like

Yeah, if you rerun setup, it will discover the new preset names.

1 Like

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

1 Like

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:

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.

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

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.

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

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?

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

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”

© 2019 SmartThings, Inc. All Rights Reserved. Terms of Use | Privacy Policy

SmartThings; SmartApps®; Physical Graph; Hello, Home; and Hello, Smart Home are all trademarks of the SmartThings, Inc.