SmartThings Community

Synology Diskstation & Cameras

Swanny this is so great, I’m excited to get it working - when I enter my info on the mobile app to connect to my DS, it won’t connect. This is the trace I get - I can’t figure it out! Any ideas?

7:47:45 PM: trace Did not use {“error”:{“code”:401},“success”:false}
7:47:45 PM: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset="UTF-8"
7:47:44 PM: trace Did not use {“error”:{“code”:401},“success”:false}
7:47:44 PM: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset=“UTF-8"
7:47:43 PM: trace Did not use {“error”:{“code”:401},“success”:false}
7:47:43 PM: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset=“UTF-8"
7:47:40 PM: trace Did not use {“data”:{“cameras”:[{“additional”:{“device”:{“channel”:“1”,“httpPort”:8081,“model”:“Define”,“vendor”:“User”,“videoPath”:”/stream.mjpg”}},“enabled”:true,“host”:“192.168.1.22”,“id”:2,“name”:“RPi Cam”,“recStatus”:0,“status”:0}],“offset”:0,“total”:1},“success”:true}
7:47:40 PM: debug getChildDevices(false), children=0
7:47:40 PM: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset="UTF-8"
7:47:39 PM: trace Did not use {“data”:{“sid”:“d9YssMHGdR5qMCCL1N03723”},“success”:true}
7:47:39 PM: debug getChildDevices(false), children=0
7:47:39 PM: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset="UTF-8"
7:47:38 PM: trace Did not use {“data”:{“SYNO.SurveillanceStation.ExternalRecording”:{“maxVersion”:2,“minVersion”:1,“path”:“SurveillanceStation/extrecord.cgi”}},“success”:true}
7:47:38 PM: debug getChildDevices(false), children=0
7:47:38 PM: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset="UTF-8"
7:47:37 PM: trace Did not use {“data”:{“SYNO.SurveillanceStation.PTZ”:{“maxVersion”:3,“minVersion”:1,“path”:“SurveillanceStation/ptz.cgi”}},“success”:true}
7:47:37 PM: debug getChildDevices(false), children=0
7:47:37 PM: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset="UTF-8"
7:47:36 PM: trace Did not use {“data”:{“SYNO.SurveillanceStation.Camera”:{“maxVersion”:6,“minVersion”:1,“path”:“SurveillanceStation/camera.cgi”}},“success”:true}
7:47:36 PM: debug getChildDevices(false), children=0
7:47:36 PM: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset="UTF-8"
7:47:34 PM: trace Did not use {“data”:{“SYNO.API.Auth”:{“maxVersion”:3,“minVersion”:1,“path”:“auth.cgi”}},“success”:true}
7:47:34 PM: debug getChildDevices(false), children=0
7:47:34 PM: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset=“UTF-8”

Did you try it one time or did it happen multiple times? If you only tried it once, please try it again going completely back out of the app and back in. It looks like something got out of sync. Before you do, please open the log again. There should be some lines like this one that I want to see as well as what you sent there:

Executing GET /webapi/query.cgi?api=SYNO.API.Info&method=Query&version=1&query=SYNO.API.Auth HTTP/1.1 

Also, do you have just the one camera “RPi Cam”?

Thanks Swanny - I did try it multiple times now yes, including removing all the code from the site and adding back again. I had to change the location from “Safety & Security” to “My Apps” or it wouldn’t appear anywhere on my app. And yes, “RPi Cam” is the only camera - it is recognized in Surveillance Station and works well.

Here is the full trace when I try to connect to DS from the ST app - after doing this I get on the app “Error communicating with the Diskstation. Please check your settings and network connection.” … but I can see in the DS logs the user has successfully logged in.

4:32:44 PM: debug getChildDevices(false), children=0
4:32:44 PM: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset="UTF-8"
4:32:43 PM: debug Executing GET /webapi/SurveillanceStation/ptz.cgi?api=SYNO.SurveillanceStation.PTZ&method=ListPatrol&version=1&_sid=mESxbCeOHfp8ECCL1N03723&cameraId=2 HTTP/1.1
HOST: 192.168.1.100:5000

4:32:43 PM: trace sending message to SurveillanceStation/ptz.cgi
4:32:43 PM: debug getChildDevices(false), children=0
4:32:43 PM: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset="UTF-8"
4:32:42 PM: debug Executing GET /webapi/SurveillanceStation/ptz.cgi?api=SYNO.SurveillanceStation.PTZ&method=ListPreset&version=1&_sid=mESxbCeOHfp8ECCL1N03723&cameraId=2 HTTP/1.1
HOST: 192.168.1.100:5000

4:32:42 PM: trace sending message to SurveillanceStation/ptz.cgi
4:32:42 PM: debug getChildDevices(false), children=0
4:32:42 PM: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset="UTF-8"
4:32:41 PM: debug Executing GET /webapi/SurveillanceStation/camera.cgi?api=SYNO.SurveillanceStation.Camera&method=GetCapability&version=1&_sid=mESxbCeOHfp8ECCL1N03723&vendor=User&model=Define HTTP/1.1
HOST: 192.168.1.100:5000

4:32:41 PM: trace sending message to SurveillanceStation/camera.cgi
4:32:38 PM: debug getChildDevices(false), children=0
4:32:38 PM: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset="UTF-8"
4:32:36 PM: debug Executing GET /webapi/SurveillanceStation/camera.cgi?api=SYNO.SurveillanceStation.Camera&method=List&version=1&_sid=mESxbCeOHfp8ECCL1N03723&additional=device HTTP/1.1
HOST: 192.168.1.100:5000

4:32:36 PM: trace sending message to SurveillanceStation/camera.cgi
4:32:36 PM: debug getChildDevices(false), children=0
4:32:36 PM: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset="UTF-8"
4:32:35 PM: debug Executing GET /webapi/auth.cgi?api=SYNO.API.Auth&method=Login&version=2&account=admin&passwd=********&session=SurveillanceStation&format=sid HTTP/1.1
HOST: 192.168.1.100:5000

4:32:34 PM: trace sending message to auth.cgi
4:32:34 PM: debug getChildDevices(false), children=0
4:32:34 PM: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset="UTF-8"
d4:32:34 PM: debug Executing GET /webapi/query.cgi?api=SYNO.API.Info&method=Query&version=1&query=SYNO.SurveillanceStation.ExternalRecording HTTP/1.1
HOST: 192.168.1.100:5000

4:32:34 PM: trace sending message to query.cgi
4:32:34 PM: debug getChildDevices(false), children=0
4:32:34 PM: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset="UTF-8"
4:32:33 PM: debug Executing GET /webapi/query.cgi?api=SYNO.API.Info&method=Query&version=1&query=SYNO.SurveillanceStation.PTZ HTTP/1.1
HOST: 192.168.1.100:5000

4:32:33 PM: trace sending message to query.cgi
4:32:33 PM: debug getChildDevices(false), children=0
4:32:33 PM: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset="UTF-8"
4:32:32 PM: debug Executing GET /webapi/query.cgi?api=SYNO.API.Info&method=Query&version=1&query=SYNO.SurveillanceStation.Camera HTTP/1.1
HOST: 192.168.1.100:5000

4:32:32 PM: trace sending message to query.cgi
4:32:32 PM: debug getChildDevices(false), children=0
4:32:32 PM: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset="UTF-8"
4:32:30 PM: debug Executing GET /webapi/query.cgi?api=SYNO.API.Info&method=Query&version=1&query=SYNO.API.Auth HTTP/1.1
HOST: 192.168.1.100:5000

Well, I know what the issue is now. The camera type seems to be a user defined type instead of one of the standard types based on this data in the log:
“model”:“Define”,“vendor”:“User”

The code in the SmartApp requests the capability of the camera like pan, tilt, zoom based on the camera model, but that code returns an error when it’s a user defined type. Is it possible to change the camera to be a natively supported model?

No, I’m afraid my cameras are custom user defined types. Is there a way to add this type, generic?

I’ll take a look this weekend and see if I can get it working.

1 Like

Any luck? :slight_smile: Thanks in advance

Just want to say thanks to @swanny. I have been using this app since you released it and it has not failed me once.

Thanks again.

@rog Good to hear!

@greenstuff I ended up with the stomach flu last weekend. This weekend I should have some time, and I feel better. :smile:

@greenstuff I have added support for User Defined camera type. Try the latest code for the Diskstation Connect SmartApp.

It works! This is great, thank you swanny, I really appreciate it. Great work!

Swanny - really great addition to the Smartthings capability - I was able to get it working very easily with a DS1513+ and eight cameras - while locally connected inside the network. Thanks so much for working on this - it really opens up a much more relabel and promising way of integrating in camera settings and sensors into the mix.

Can you give some guidance on enabling this from outside the local network and accessing the same thing remotely? Much appreciated

Happy to help test new features too as you are inspired to extend it - just let me know.

The integration asks for your local IP address, but it uses the local hub commands so you should be able to access it fine from outside your local network. Is it not working remote?

Is it possible to connect via https? I currently setup my synology to only allow https connections.

1 Like

The integration does not support https unfortunately. The ST commands it uses only support http. It is only using http on your local network though. I don’t remember if you can set it up to use http on the local network only while using https for remote connections.

swanny,

thanks for all your hard work w/ this app–im looking forward to using it once I can get it up and running.

That being said, i’m getting a weird outcome when trying to install the device type/smartapp. When using the “DiskstationConnect.groovy – Updated to handle user defined cameras” code, the smartapp installation goes fine. However, upon attempting to save the device type using the same code I get the following error:

“groovy.lang.MissingMethodException: No signature of method: script14202387061691368325005.page() is applicable for argument types: (java.util.LinkedHashMap) values: [[name:diskstationDiscovery, title:Connect with your Diskstation!, …]]
Possible solutions: path(java.lang.Object), wait(), any(), wait(long), main(java.lang.String), main(java.util.List) @ line 28”

If I attempt to use the older “DiskstationCamera.groovy Fix capture bug” code, I am able to save the device type, but this would be a mismatch w/ the smartapp code–yes? Then, upon attempting to update the smartapp with the “DiskstationCamera.groovy Fix capture bug” code I get this error:

“groovy.lang.MissingMethodException: No signature of method: script14202388506111977106418.metadata() is applicable for argument types: (script14202388506111977106418$_run_closure1) values: [script14202388506111977106418$_run_closure1@31d6a67d]
Possible solutions: getMetadata(), getState(), setState(java.lang.Object), metaClass(groovy.lang.Closure)”

I apologize in advance if I am making some kind of simple error… I’ve only had my smartthings hub for a month and maybe I’m over looking something basic here.

I would really appreciate any input on this from anyone.

Thank you in advance.

Hi @tcz7,

The DiskstationConnect.groovy file is the SmartApp and the DiskstationCamera.groovy file is the device type. It looks like you are trying to save the SmartApp code as the Device Type. If you switch to the other file for the device type, you should be good.

Dave

Hi @swanny,

Thx for sharing the code. Silly question, but do I use the http port for Surveillance Station?.

The reason I ask is that I get an “error communicating with the Diskstation…” (the firewall has the correct port forwarding rule and I can get to Surveillance Station via the browser using the correct IP and port).

Appreciate any assist. Cheers,

Yes @NeKash, you use the http port. This is the IP on your local network though so port forwarding won’t matter. The hub will be talking over your local network to the Diskstation.

Cheers @swanny, guess I am still not doing something not quite right.

Using:
IP of diskstation: 192.168.1.90
Surveillance Station TCP Port: 9900
correct username & password

App brings up this message:

… “This can take a minute. Please wait …”

after a while I get an"Error communicating with the Disktation. …"

But on checking the Diskstation log centre, I can see that I was logged in.

Any assist when you have a moment will be appreciated. Thx.