Synology Diskstation & Cameras

I added a fork to asmut’s to include linking a presence sensor to directly control HomeMode

It’s relatively straight forward, but does not report that status back. Maybe someone smarter than me can manage that one.

Now just to find a reliable presence sensor… I’m thinking about tapping into my Unifi to read the mac addresses for my wife and I’s phones

If you’ve already got a disk station, you can schedule a script to lookup their Mac addresses as a Presence sensor

https://community.smartthings.com/t/virtual-presence-device/1306/9

1 Like

Hi,

Would this allow a Smartthings contact sensor to trigger a screen cap from a DiskStation camera?

Thanks,

->g.

Anyone try this yet with SS 8.2? Doesnt appear to work anymore. Wondering if Synology changed the streaming CGI?

It’s broken for me too. Diskstation (Connect) just times out now. I’m not sure if it was SS 8.2.1 or the latest DSM (6.2.1-23824-1). Both were released about the same time (mid Oct). SS 8.2.0 was definitely working fine for me though.

Man, so annoyed I only just found out about this app!
Doesn’t work here either. :frowning:

Just found it now too!. What a shame. Any idea if this can me made work in the latest DSM?.

I’m also seeing this same timeout issue. Strangely, everything was working great for me until yesterday. I got a third camera to add to my system, so I had to run the Diskstation(Connect) app again. Now, I see the same timeout issue as others in the app, I can’t add my third camera to ST, and I’m not receiving motion events on either of my original cameras in ST.

In Live Logging, I get this error:
[266a5c99-ef28-4000-92be-84270d7dae13](https://graph.api.smartthings.com/ide/logs#266a5c99-ef28-4000-92be-84270d7dae13) 1:13:12 PM: error java.lang.RuntimeException: bad character in base64 value @line 427 (locationHandler)

@swanny @asmuts are y’all still around these parts? I’ve tried @swanny’s original version, and also the forks from @asmuts. I don’t know enough about what that decodeBase64() function is doing.

Getting the same error as NorCalLighs. This is about the fourth time I have gotten timeout errors (not sure if the logged error was the same as I didn’t check the log before) when trying to re-run the connect app to get my cameras working again with ST. Seems like it will work fine for weeks, if not months, then stop working (no more image caps from cameras) out of the blue. Once that happens I will then go into the connect app to refresh things and that is when I get hit with the timeout. The other times it seem to resolve itself after a few days of trying the connect app every day. But this time is been broken for over a week for me.

Hi

I just started using Synology SS and haven’t used this app.

i’m not a programmer but was trying to solve this problem.

Looking at this it seems to me that there is a problem with SS response to the list request.
Live logging truncates the response so i cant see the entire message.

This is what is received but is truncated

{“data”:{“cameras”:[{“ADCap”:0,“AppList”:,“DINum”:0,“DONum”:0,“MDCap”:5,“MDModeList”:[0,1],“PDCap”:0,“PDDepend”:0,“TDCap”:5,“additional”:{“device”:{“channel”:“1”,“firmware”:"",“httpPort”:80,“model”:“Generic_ONVIF”,“vendor”:“ONVIF”,“video_mode”:""}},“advLiveMinDuration”:10,“advLiveProfile”:1,“advLiveTrigAuto”:true,“advLiveTrigEvt”:0,“advLiveTrigSingle”:false,“analyticsType”:0,“application”:false,“audioCap”:false,“audioOut”:false,“audioType”:0,“autoFocus”:false,“autoPan”:0,“auto_restart_interval”:0,“blAudioDisableRec”:false,“blAudioPriv”:true,“blDisableRec”:false,“blEnableExtDI”:false,“blEnableLiveBuffering”:false,“blG726LE”:false,“blLiveviewPriv”:true,“blPresetSpeed”:false,“blPtzShowIcon”:false,“blReceivePocZero”:false,“blThirdStream”:true,“calling_notify_ado_src_id”:0,“calling_notify_duration”:0,“camIdOnRecServer”:0,“camLiveMode”:0,“camMobileLiveMode”:0,“camMountType”:0,“camRecShare”:“surveillance”,“camRecShareMountType”:0,“camRecSharePath”:"/volume1/surveillance",“camRecStorageStatus”:0,“camRecVolume”:"/volume1",“camRotOption”:0,“camStatus”:1,"cSECB1

There is an example in the SS API documentation of what this should look like.

if i could get the entire message i could compare it to the example documentation and then possibly contact Synology for help.

Example: Get camera information response.
{
“camera”: [
{
“audioOut”: true,
“mute”: false,
“recStatus”: 0,
“analyticsType”: 0,
“ptzCap”: 111,
“audioType”: 4,
“ptzContinuous”: 39,
“is_rotated_by_date”: false,
“ADCap”: 5,
“blLiveviewPriv”: true,
“videoCapList”: [
{
“stList”: [
“RTSP”
],
“vt”: “H.264”
},
{
“stList”: [
“HTTP”
],
“vt”: “MJPEG”
}
],
“isStatusUnrecognized”: false,
“is_rotated_by_space”: true,
“osd_position”: 6,
“fisheyeType”: 0,
“recBitrateCtrl”: 1,
“video_mirror”: true,
“vendor”: “AXIS”,
“video_rotation”: 0,
“stmFisheyeType”: 0,
“dsPort”: 5000,
“TDCap”: 0,
“camMountType”: 0,
“exposure_control”: 6,
“name”: “P5415-E-0011”,
“ownerDsId”: 0,
“osd_status”: true,
“fisheyeDispMode”: “”,
“channel_id”: “1”,
“setDICap”: false,
“param_chklist”: 0,
“analyticsBeep”: false,
“status_flags”: 32,
“feRegionList”: ,
“objTrack”: false,
“port”: 80,
“video_flip”: true,
“osd_format”: 0,
“autoPan”: 0,
“deleted”: false,
“deviceType”: 4,
“hasCamParam”: true,
“DINum”: 2,
“snapshot_path”:
“/webapi/_______________________________________________________entry.cgi?
api=SYNO.SurveillanceStation.Camera&method=GetSnapshot&version=1&cameraId=70×tamp=142491912
9&preview=true”,
“dsIp”: “”,
“host”: “10.13.12.165”,
“rotation_by_date”: 30,
“autoFocus”: true,
“volume_space”: “9.617”,
“analyticsHeight”: 0,
“MDCap”: 5,
“rotation_by_space”: “10”,
“analyticsVirtualFence”: false,
“analyticsObjSize”: 0,
“analyticsDirection”: 1,
“analyticsRegion”: “”,
“quality”: “5”,
“multiDI”: false,
“type”: 3,
“stm_info”: [
{
“resolution”: “800x450”,
“quality”: “5”,
“fps”: 10,
“type”: 0
},
{
“resolution”: “800x450”,
“quality”: “5”,
“fps”: 10,
“type”: 1
},
{
“resolution”: “800x450”,
“quality”: “5”,
“fps”: 10,
“type”: 2
}
],
“camLiveMode”: 0,
“volume”: 50,
“ptzDirection”: 32,
“dayend”: 18,
“folder”: “/var/services/surveillance/P5415-E-001”,
“tvStandard”: 0,
“singleStream”: false,
“imageEnhancement”: {
“saturation”: 0,
“sharpness”: 0,
“contrast”: 0,
“brightness”: 0
},
“audioCap”: true,
“camIdOnRecServer”: 0,
“detailInfo”: {
“camRecTime”: 30,
“edgeStgEnabled”: false,
“camIsRotByDate”: false,
“camRecStreamNo”: 0,
“camRotByDate”: 30,
“camTvStandard”: 0,
“camMountType”: 0,
“camRecCbrBitrate”: 1000,
“camIsRotBySpace”: true,
“camLiveResolution”: “800x450”,
“camRecBitrateCtrl”: 1,
“camMobileStreamNo”: 0,
“camLiveQuality”: “5”,
“edgeStgRecStopTime”: “23:59”,
“camLiveStreamNo”: 0,
“camResolution”: “800x450”,
“camMobileQuality”: “5”,
“camLiveMode”: 0,
“camPreRecTime”: 5,
“camIP”: “10.13.12.165”,
“camLiveBitrateCtrl”: 1,
“camModel”: “P5415-E”,
“edgeStgRecStartTime”: “00:00”,
“camPostRecTime”: 5,
“camLiveCbrBitrate”: 1000,
“camMobileResolution”: “800x450”,
“camUserName”: “root”,
“camFps”: 10,
“camVendor”: “AXIS”,
“camMobileFps”: 10,
“camFov”: “”,
“camMobileCbrBitrate”: 1000,
“camRotBySpace”: 10,
“edgeStgDownloadSch”:
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
“customAlarmDetect”: 3,
“camLiveFps”: 10,
“camChannel”: “1”,
“camRotOption”: 0,
“camQuality”: “5”,
“camPrefix”: “P5415-E-001”,
“edgeStgRetrieveAction”: 2,
“camSchedule”:
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1],
“edgeStgRecMode”: 2,
“customDetect”: 5,
“camPassWord”: “%EF%BC%83%EF%BC%83%EF%BC%83%EF%BC%83%EF%BC%83%EF%BC
%83%EF%BC%83%EF%BC%83”,
“camVideoType”: “H.264”,
“camMobileBitrateCtrl”: 1,
“MdDetSrc”: 0,
“camServer”: 0,
“camFolder”: “P5415-E-001”,
“edgeStgRecDays”: 127,
“camPort”: 80,
“camRtspProtocol”: 4,
“camName”: “P5415-E-0011”,
“camAudioType”: 4
},
“enabled”: true,
“analyticsSens”: 1,
“analyticsWidth”: 0,
“recCbrBitrate”: 1000,
“blPresetSpeed”: false,
“DONum”: 0,
“id”: 70,
“setDOCap”: false,
“analyticsFrame”: true,
“analyticsLine”: false,
“daybegin”: 8,
“fps”: 10,
“status”: 1,
“update_time”: 1424919129,
“exposure_mode”: 4,
“time_server”: “”,
“rotation_option”: 0,
“presetNum”: 32,
“camStatus”: 9,
“analyticsDwellTime”: 5,
“camPath”:
“cnRzcDovL3Jvb3Q6bmF0bWFzdGVyQDEwLjEzLjEyLjE2NTo1NTQvYXhpcy1tZWRpYS9tZWRpYS5hbXA/Y2FtZ
XJhPTEmdmlkZW9jb2RlYz1oMjY0JnJlc29sdXRpb249ODAweDQ1MCZmcHM9MTAmdmlkZW9rZXlmcmFtZWl
udGVydmFsPTEwJmNvbXByZXNzaW9uPTIw”,
“model”: “P5415-E”,
“resolution”: “800x450”
}
]
}

Has anyone with the timeout problem downgraded SS to the 06-Nov-2018 12:21 8.2.2-5766 or earlier?

Did it help?

Is this work now ?

Hi, I just installed Diskstation and getting following error. Can anybody help me troubleshoot that?
I have a user only for camera, it has all the permissions needed. I dont know what I am doing wrong.

Thanks

10:22:26 PM: error java.lang.RuntimeException: bad character in base64 value @line 416 (locationHandler)

10:22:25 PM: debug getChildDevices(false), children=0
10:22:25 PM: trace {“data”:{“sid”:“fQALpmL3T2B2Y1730NNN915709”},“success”:true}
10:22:25 PM: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset=“UTF-8”
10:22:24 PM: debug getChildDevices(false), children=0
10:22:24 PM: trace {“data”:{“SYNO.SurveillanceStation.ExternalRecording”:{“maxVersion”:3,“minVersion”:1,“path”:“entry.cgi”,“requestFormat”:“JSON”}},“success”:true}

10:22:24 PM: trace DISKSTATION REPONSE TYPE: Content-Type: text/plain; charset=“UTF-8”
10:22:23 PM: debug getChildDevices(false), children=0

Hi, did you resolve your problem with that base64() ?

No. :frowning: I’ve given up.

Did you find an alternate way to access images once you stopped Synology disk connect?

If you are getting base64 errors on connect, I made a change that worked for me. The issue was that Synology most likely broke backwards compatibility of “SYNO.SurveillanceStation.Camera” API. I bumped the version used in the Diskstation connect code, and changed the mapping of some fields as well. Anyhow, the code here seems to connect without any base64 errors: https://github.com/mkrapivner/smartthings

Matt_K1, that allowed DS Connect to reconnect to my NAS without timeout (and see my cameras) but I’m unable to take an image:

1c40cf04-54b1-4565-b9cb-8276b664beac 3:45:43 PM: trace Did not use

1c40cf04-54b1-4565-b9cb-8276b664beac 3:45:42 PM: trace Requesting URL /webapi/entry.cgi?api=SYNO.SurveillanceStation.Camera&method=GetSnapshot&version=1&_sid=BDK1IbvKJRk6Y1531MQN708601&cameraId=2

1c40cf04-54b1-4565-b9cb-8276b664beac 3:45:42 PM: trace resending to get real error message

1c40cf04-54b1-4565-b9cb-8276b664beac 3:45:42 PM: trace take image command returned an error

1c40cf04-54b1-4565-b9cb-8276b664beac 3:45:42 PM: debug getChildDevices(false), children=5

1c40cf04-54b1-4565-b9cb-8276b664beac 3:45:41 PM: trace Requesting URL /webapi/entry.cgi?api=SYNO.SurveillanceStation.Camera&method=GetSnapshot&version=1&_sid=BDK1IbvKJRk6Y1531MQN708601&cameraId=2

Having a hard time getting my DS413 (DSM 6.2.2-24922) to work properly. I’ve followed the instructions but can’t ever get the “success” message show up on the SmartApp. I checked the live logging but nothing came in after sending the test sms message.

Is there a certain trick to getting this to work?