Hi @MAM78,
I had initially some trouble to find the correct IDs for my three cams and hence the VD's did not work in the beginning. Having fixed this issue (Nos are 1, 2 and 3 ), I was able to test the VD and it works great for me. As I intent to change the "Home Mode ON/OFF" status from other scenes I have added two more buttons in addition to the "Home Mode" toggle. So, I have a better control for scenarios like " if PresentState = "Away" then fibaro:call(SSM_ID, "pressButton", "2")". See image below.
There is one further issue, which might however be caused by my SSS setup. For one of the three cameras I can create snapshots without any problems. This camera is the only one that is directly connected to this server (1). The other two cameras are connected to a second Diskstation (2) and are just linked to the first Surveillance station (1) via Synology "Central Management System (CMS)". So, when I hit the button for the snapshot for the cams on server (2) I get an authentification failure (debug messages below). For myself this is not a serious issue as I will not need the snapshot funtion at all, or can use the normal Fibaro Plugin. but amybe there is a workaround to login into more than one diskstations in one script. Credentials and privileges in my case are be the same for both Diskstations but the SID is prbably different.
What else does not work:
- I cannot stop the recording. Or better the recording starts immediately after it was interrupted. Again likely an issue with my own SSS setup, as I am using continuous recording 24/7
- in The camera VDs I cannot toggle the source for movement detection. This always remains as it was initially setup in my SSS. However, as my cameras are have a PIR sensor I will always use this one and have no need to change the source.
I have not yet tested the scene buttons.
None of my cams has PTZ. So, no way to test this functionality
Altogether a fantastic tool and I am amazed what you guys here in the forum are able to implement. As an absolute LUA Rookie I do only barely understand how these VDs are working. But they do the job and that's what counts. Many thanks for sharing your knowledge.
Cheers
Alex
Camera on Server (1)
[DEBUG] 19:04:14: 10/01/2019 : Scene started manually
[DEBUG] 19:04:14: [{"VD_Text":"Prise d'une photo"},{"action":"TakeSnapshot"},{"value":"3"},{"VD_ID":610},{"VD_Button_ID":10},{"VD_Label":"lblMotionSource"}]
[DEBUG] 19:04:14: VD_Text : Prise d'une photo
[DEBUG] 19:04:14: action : TakeSnapshot
[DEBUG] 19:04:14: value : 3
[DEBUG] 19:04:14: VD_ID : 610
[DEBUG] 19:04:14: VD_Button_ID : 10
[DEBUG] 19:04:14: VD_Label : lblMotionSource
[DEBUG] 19:04:14: 10/01/2019 : Prise d'une photo 3
[DEBUG] 19:04:14: Gloabal Variable = SurvStationManager Contente : ({"pathAuth":"auth.cgi","pathCamera":"entry.cgi","SceneID":169,"HomeMode":false,"pathRecord":"entry.cgi","SID":"w5tGURcxDd.ic1830PCN718514","Cameras":{"1":{"Cam_VD_Id":608,"Cam_WithPTZ":false,"Cam_Recording":true,"CameraStatus":0,"Cam_PTZ_Position_name":"","Cam_PTZ_Position_id":"","Cam_Motion_Source":0,"Cam_Name":"Instar_Garten","Cam_Motion_Disabled":false,"Cam_Enabled":true},"3":{"Cam_VD_Id":610,"Cam_WithPTZ":false,"Cam_Recording":true,"CameraStatus":0,"Cam_PTZ_Position_name":"","Cam_PTZ_Position_id":"","Cam_Motion_Source":0,"Cam_Name":"Instar_Terrasse","Cam_Motion_Disabled":false,"Cam_Enabled":true},"2":{"Cam_VD_Id":609,"Cam_WithPTZ":false,"Cam_Recording":true,"CameraStatus":0,"Cam_PTZ_Position_name":"","Cam_PTZ_Position_id":"","Cam_Motion_Source":0,"Cam_Name":"Instar_Front","Cam_Motion_Disabled":false,"Cam_Enabled":true}},"CameraList":"3,1,2"}
[DEBUG] 19:04:14: pathAuth =auth.cgi Parameters found in "SurvStationManager" global variable
[DEBUG] 19:04:14: pathRecord =entry.cgi Parameters found in "SurvStationManager" global variable
[DEBUG] 19:04:14: pathCamera =entry.cgi Parameters found in "SurvStationManager" global variable
[DEBUG] 19:04:14: SID =w5tGURcxDd.ic1830PCN718514 Parameters found in "SurvStationManager" global variable
[DEBUG] 19:04:14: setTimeout(function() functions[TakeSnapshot]() end, 0)
[DEBUG] 19:04:14: Scene main loop finished
[DEBUG] 19:04:14: Call TakeSnapshot() function
[DEBUG] 19:04:14: getAPI() : http://192.168.178.72:5000/webapi/entry.cgi?api=SYNO.SurveillanceStation.SnapShot&version=1&method=TakeSnapshot&blSave=true&camId=3&_sid=w5tGURcxDd.ic1830PCN718514
[DEBUG] 19:04:14: getAPI() : response success
[DEBUG] 19:04:14: getAPI() : callback function TakeSnapshot
[DEBUG] 19:04:14: TakeSnapshot : Success
[DEBUG] 19:04:14: Prise d'une photo OK
[DEBUG] 19:04:14: label : lblStatus value : Prise d'une photo OK
[DEBUG] 19:04:14: Update VD_ID : 610 label : ui.lblStatus.value => Prise d'une photo OK
Camera on Server (2)
[DEBUG] 19:06:02: 10/01/2019 : Scene started manually
[DEBUG] 19:06:02: [{"VD_Text":"Prise d'une photo"},{"action":"TakeSnapshot"},{"value":"2"},{"VD_ID":609},{"VD_Button_ID":10},{"VD_Label":"lblMotionSource"}]
[DEBUG] 19:06:02: VD_Text : Prise d'une photo
[DEBUG] 19:06:02: action : TakeSnapshot
[DEBUG] 19:06:02: value : 2
[DEBUG] 19:06:02: VD_ID : 609
[DEBUG] 19:06:02: VD_Button_ID : 10
[DEBUG] 19:06:02: VD_Label : lblMotionSource
[DEBUG] 19:06:02: 10/01/2019 : Prise d'une photo 2
[DEBUG] 19:06:02: Gloabal Variable = SurvStationManager Contente : ({"pathAuth":"auth.cgi","pathCamera":"entry.cgi","SceneID":169,"HomeMode":false,"pathRecord":"entry.cgi","SID":"w5tGURcxDd.ic1830PCN718514","Cameras":{"1":{"Cam_VD_Id":608,"Cam_WithPTZ":false,"Cam_Recording":true,"CameraStatus":0,"Cam_PTZ_Position_name":"","Cam_PTZ_Position_id":"","Cam_Motion_Source":0,"Cam_Name":"Instar_Garten","Cam_Motion_Disabled":false,"Cam_Enabled":true},"3":{"Cam_VD_Id":610,"Cam_WithPTZ":false,"Cam_Recording":true,"CameraStatus":0,"Cam_PTZ_Position_name":"","Cam_PTZ_Position_id":"","Cam_Motion_Source":0,"Cam_Name":"Instar_Terrasse","Cam_Motion_Disabled":false,"Cam_Enabled":true},"2":{"Cam_VD_Id":609,"Cam_WithPTZ":false,"Cam_Recording":true,"CameraStatus":0,"Cam_PTZ_Position_name":"","Cam_PTZ_Position_id":"","Cam_Motion_Source":0,"Cam_Name":"Instar_Front","Cam_Motion_Disabled":false,"Cam_Enabled":true}},"CameraList":"3,1,2"}
[DEBUG] 19:06:02: pathAuth =auth.cgi Parameters found in "SurvStationManager" global variable
[DEBUG] 19:06:02: pathRecord =entry.cgi Parameters found in "SurvStationManager" global variable
[DEBUG] 19:06:02: pathCamera =entry.cgi Parameters found in "SurvStationManager" global variable
[DEBUG] 19:06:02: SID =w5tGURcxDd.ic1830PCN718514 Parameters found in "SurvStationManager" global variable
[DEBUG] 19:06:02: setTimeout(function() functions[TakeSnapshot]() end, 0)
[DEBUG] 19:06:02: Scene main loop finished
[DEBUG] 19:06:02: Call TakeSnapshot() function
[DEBUG] 19:06:02: getAPI() : http://192.168.178.72:5000/webapi/entry.cgi?api=SYNO.SurveillanceStation.SnapShot&version=1&method=TakeSnapshot&blSave=true&camId=2&_sid=w5tGURcxDd.ic1830PCN718514
[DEBUG] 19:06:03: getAPI() : response not success
[DEBUG] 19:06:03: getAPI() : callback function TakeSnapshot
[DEBUG] 19:06:03: Error : TakeSnapshot failed : API Authentication failure, Invalid login or password.
[DEBUG] 19:06:03: label : lblStatus value : Prise d'une photo Failed
[DEBUG] 19:06:03: Update VD_ID : 609 label : ui.lblStatus.value => Prise d'une photo Failed