Aller au contenu
MAM78

Surveillance Station Manager

Recommended Posts

It is not sure that my English is better than your French

Partager ce message


Lien à poster
Partager sur d’autres sites

 

....just have changed the recording from continuous to customized, and now the switch to start/stop recording works fine for both servers . Same is for switching between event detection.:74:.

Partager ce message


Lien à poster
Partager sur d’autres sites
il y a 45 minutes, MAM78 a dit :

It is not sure that my English is better than your French

Oh oui, j'en suis sûre (traduction par Google)

Partager ce message


Lien à poster
Partager sur d’autres sites
Il y a 2 heures, lodi a dit :

Anyway, I just had a look into the forums étiquette. There it is mentioned that French is mandatory. Hope my English comments are still OK. I am sure you do not want to read my comments when I try to write in French :18:.

Don't worry, it is an old rule, we are used to read/write english language, it is certainly better than an automatic google tranlation

Partager ce message


Lien à poster
Partager sur d’autres sites
Il y a 1 heure, lodi a dit :

 

.... just have changed the recording from the past to the end. Same is for switching between event detection. : 74:.

....it is not as easy as I thought. (On any server) I can only switch the recording (on/Off) when the detection source is set to "disabled". For the two other options (camera and surv. station) it is not possible to stop or start the recording (see images).

image.png.fd62980ffc6250672059f1d97bef991b.pngimage.png.fa5c0a4f73049cc76c63df2760ee7d61.png

Partager ce message


Lien à poster
Partager sur d’autres sites

If you use continuous recording in the SSS configuration, it is normal not to be able to start / stop the recording because it is SSS that manages it.

In my vision and the spirit of my development, if you want to control the recording according to external events (HC2 detectors), do not configure the continuous recording and not configure the motion detection by the camera or SS but by the external event.

This is my vision but I am open to argumentation.

 

For your information, it does not make sense to indicate on the labels of individual VDs "All Recording" or "All Active" because it is a single camera.

Partager ce message


Lien à poster
Partager sur d’autres sites

Hello  @ MAM78 ,

I agree with you and basically I just wanted to give a feedback wrt my observations. As mentioned, I use only outdoor cams and the PIR sensors are just doing fine for my own intentions. I was actually looking for a simple tool that allows me to use the parameters / variables in my HC2. Your VD is doing it right now. That's great.

 

Quote

For your information, it does not make sense to indi- vidual VDs "All Recording" or "All Active" because it is a single camera.

Yes, I was just struggling to get back to the place where I have made my little translations and did not remember that they are similar to both. looks much better now  : D.

 

Cheers

Lodi

 

image.png

Modifié par lodi

Partager ce message


Lien à poster
Partager sur d’autres sites

Ajout en deuxième post du Tuto de quelques exemples d'utilisations via des commandes GEA.

 

Partager ce message


Lien à poster
Partager sur d’autres sites

[DEBUG] 15:37:39: Error : SS_GetSID failed : API Authentication failure, Invalid login or password.
[DEBUG] 15:37:39: 2019-02-03 15:37:39.043989 [ error] timer handler failed with error: /opt/fibaro/scenes/140.lua:394: attempt to concatenate upvalue 'SID' (a nil value)
[DEBUG] 15:37:48: 03/02/2019 : Scene started manually
[DEBUG] 15:37:48: [{"VD_Text":""},{"action":"SS_Init_VG"},{"value":" "},{"VD_ID":171},{"VD_Label":""}]
[DEBUG] 15:37:48: VD_Text :
[DEBUG] 15:37:48: action : SS_Init_VG
[DEBUG] 15:37:48: value :
[DEBUG] 15:37:48: VD_ID : 171
[DEBUG] 15:37:48: VD_Label :
[DEBUG] 15:37:48: 03/02/2019 :
[DEBUG] 15:37:48: Gloabal Variable = SurvStationManager Contente : ({"pathRecord":"entry.cgi","pathAuth":"auth.cgi","SceneID":140,"pathCamera":"entry.cgi"}
[DEBUG] 15:37:48: pathAuth =auth.cgi Parameters found in "SurvStationManager" global variable
[DEBUG] 15:37:48: pathRecord =entry.cgi Parameters found in "SurvStationManager" global variable
[DEBUG] 15:37:48: pathCamera =entry.cgi Parameters found in "SurvStationManager" global variable
[DEBUG] 15:37:48: setTimeout(function() functions[SS_Init_VG]() end, 0)
[DEBUG] 15:37:48: Scene main loop finished
[DEBUG] 15:37:48: Call SS_Init_VG() function
[DEBUG] 15:37:48: getAPI() : http://192.168.179.43:5000/webapi/query.cgi?api=SYNO.API.Info&method=Query&version=1&query=SYNO.API.Auth,SYNO.SurveillanceStation.Camera,SYNO.SurveillanceStation.ExternalRecording
[DEBUG] 15:37:48: getAPI() : response success
[DEBUG] 15:37:48: getAPI() : callback function GET_Path
[DEBUG] 15:37:48: Query : Success
[DEBUG] 15:37:48: pathAuth : auth.cgi
[DEBUG] 15:37:48: pathRecord : entry.cgi
[DEBUG] 15:37:48: pathCamera : entry.cgi
[DEBUG] 15:37:48: Save pathAuth Parameters to (SurvStationManager) global variable
[DEBUG] 15:37:48: Save pathRecord Parameters to (SurvStationManager) global variable
[DEBUG] 15:37:48: Save pathCamera Parameters to (SurvStationManager) global variable
[DEBUG] 15:37:48: getAPI() : http://192.168.179.43:5000/webapi/auth.cgi?api=SYNO.API.Auth&method=Login&version=2&account=?????&passwd=?????????((&session=SurveillanceStation&format=sid
[DEBUG] 15:37:49: getAPI() : response not success
[DEBUG] 15:37:49: getAPI() : callback function GetSID
[DEBUG] 15:37:49: GetSID : Success
[DEBUG] 15:37:49: Error : SS_GetSID failed : API Authentication failure, Invalid login or password.
[DEBUG] 15:37:49: 2019-02-03 15:37:49.186950 [ error] timer handler failed with error: /opt/fibaro/scenes/140.lua:394: attempt to concatenate upvalue 'SID' (a nil value)
 
Hello can anyone help me please
 
 

 

Partager ce message


Lien à poster
Partager sur d’autres sites
It seems that you forgot to enter your login and the password of your Surveillance Station account in the user variables.

Partager ce message


Lien à poster
Partager sur d’autres sites

All is described in the configuration chapter on the first post.

Partager ce message


Lien à poster
Partager sur d’autres sites

Bonjour MAM78,

 

Sur tes conseils, je teste ton appli, et je bute sur une info.

Ci-dessous, tu demande Les ID des cams et l'ID du VD.

 

  dans le tableau (List_CAM) la liste des ID de vos CAM avec l'ID du VD correspondant et permettant le pilotage individuel de chaque caméra

  dans le tableau (List_PTZ_PRESET) la liste des ID de vos CAM avec la liste des différentes positions PTZ que vous souhaitez utiliser (4 maxi par Caméra) 

  dans le tableau (List_ExternalEvent) la liste des différents événements extérieurs que vous souhaitez utilisés dans les règles d'actions dans SS

 

Je trouve ça ou ? Sur Fibaro ou sur SS ?

Et dans les deux cas, je regarde a quel endroit pour trouver ça?

Je sais, question bête, mais essentielle pour moi. :)

 

Merci de ta réponse.

 

Partager ce message


Lien à poster
Partager sur d’autres sites

Lorsque tu installes le VD principal le VD te donnera la liste des id de tes CAMs

 

Pour les PTZ, je n'ai pas fait les tests, je n'ai pas de CAM compatibles.

 

List_ExternalEvent, c'est en fonction des événements externes que tu configures sous SS.

Partager ce message


Lien à poster
Partager sur d’autres sites

Bonjour

Bravo pour ce tuto que j'ai essayé d'implémenter mais je me heurte à l'obstacle suivant. S'agissant de l'authentification j'ai repris exactement les mêmes paramètres que ceux utilisés pour le VD de Lazer (surveillance station) et qui fonctionne d'où ma perplexité.

Merci  pour toute aide

 

[DEBUG] 15:28:49: HomeMode_State Error : API Authentication failure, ???
[DEBUG] 15:28:49: Get List_CAM
[DEBUG] 15:28:49: payload=/webapi/entry.cgi?api=SYNO.SurveillanceStation.Camera&method=List&version=1&_sid=lo.4J6YkWc0XM17A0PCN275411
[DEBUG] 15:28:49: List_CAM Error : API Authentication failure, Insufficient user privilege
[DEBUG] 15:28:59: main()...



 

Partager ce message


Lien à poster
Partager sur d’autres sites
il y a une heure, ixisman a dit :

Bonjour

Bravo pour ce tuto que j'ai essayé d'implémenter mais je me heurte à l'obstacle suivant. S'agissant de l'authentification j'ai repris exactement les mêmes paramètres que ceux utilisés pour le VD de Lazer (surveillance station) et qui fonctionne d'où ma perplexité.

Merci  pour toute aide

 


[DEBUG] 15:28:49: HomeMode_State Error : API Authentication failure, ???
[DEBUG] 15:28:49: Get List_CAM
[DEBUG] 15:28:49: payload=/webapi/entry.cgi?api=SYNO.SurveillanceStation.Camera&method=List&version=1&_sid=lo.4J6YkWc0XM17A0PCN275411
[DEBUG] 15:28:49: List_CAM Error : API Authentication failure, Insufficient user privilege
[DEBUG] 15:28:59: main()...



 

Je me réponds à moi même j'ai tout désinstallé et réinstallé et pour l'instant cet obstacle est franchi

Merci

Partager ce message


Lien à poster
Partager sur d’autres sites

Super module, merci !
Je teste actuellement avec 4 caméras.

J'ai la même question que @DoR.Technique et je ne sais pas où trouver les ID caméras.

J'ai installé le VD principal et un VD par caméra. Je m'imaginais qu'on trouve les ID dans le debug.

Voici la copie écran que je trouve dans le debug:

 

Capture d’écran 2019-03-01 à 07.28.32.png

Partager ce message


Lien à poster
Partager sur d’autres sites

Les ID sont visibles directement dans le VD Général dans la liste des CAM, valeurs ID entre parenthèses.

 

Partager ce message


Lien à poster
Partager sur d’autres sites

Il n'y a rien d'affiché sur mon VD Général, j'imagine que c'est lié au message d'erreur dans mon debug

Partager ce message


Lien à poster
Partager sur d’autres sites

pourrais-tu copier ici le code de la ligne 517

Partager ce message


Lien à poster
Partager sur d’autres sites

Voici la ligne 517 de mon code

Capture d’écran 2019-03-01 à 18.34.57.png

 

En y regardant de plus près, j'ai rajouté une ligne de DEBUG pour obtenir l'ID de la cam

 

                local Cam_Name = jsonTable.data.cameras[i].name
                local Cam_ID = jsonTable.data.cameras[i].id
                local Cam_VD_Id = ""
--- Code inséré ----
self:message("white", "Caméra ID : "..Cam_ID)
--- Fin Code inséré ---
                cameras = cameras..Cam_ID
                if i < nbcameras then 
                  cameras = cameras ..","
                end

Du coup en cliquant sur le bouton "Déboguer" de la boucle principale du VD principal, juste avant le message d'erreur de la plantée du code, j'obtiens le Cam_ID.

Je remplace le ID_CAM_xx par le Cam_ID récupéré dans le débug, je sauve et je recommence l'opération jusqu'à obtenir le Cam_ID de chacune de mes caméras.
A mon avis il faut revoir la procédure pour affecter les Cam_ID ce n'est pas viable de cette manière.

 

PS: Il y a plusieurs erreurs d'anglais dans les textes débug du code dans cette zone. Voici les textes modifiés:

                if Cam_VD_Id ~= nil and Cam_VD_Id ~= "" then
                  if debug then
                    self:message("green", "Found VD ID : "..Cam_VD_Id.." for Camera ID "..Cam_ID..', Name '..Cam_Name)
                  end
                else
                  self:message("purple", "VD ID not found for Camera ID "..Cam_ID..', Name '..Cam_Name.." in the table List_CAM in then Users parameters")
                end

 

Modifié par sumsum
EDIT trouvé comment résoudre

Partager ce message


Lien à poster
Partager sur d’autres sites

@MAM78 je propose une modif pour faciliter l'obtention des Cam_ID en une seule fois, sans bug dans la boucle principale du VD.

Dans l'entête on rajoute une variable SetupMode qui est à true lors de l'installation du VD.

Dans ce cas la boucle n'essaie pas d'exécuter la récupération de l'état des caméras, mais on exécute quelques lignes de code qui affichent dans la fenêtre de débug et dans les labels des caméras du VD, les numéros d'ID des caméras trouvées dans Surveillance Station.

Une fois les valeurs récupérées, on remplace les ID_CAM_xx par les Cam_ID récupérés dans la code de la boucle principale du VD.

On change la variable SetupMode à faux et la boucle du VD s'exécute normalement.

Voici un exemple de l'affichage des ID affichés dans les labels, ayant mis la variable SetupMode à true.

 

Capture d’écran 2019-03-02 à 22.51.30.png

 

Je peux te fournir le code modifié

Modifié par sumsum
  • Like 1

Partager ce message


Lien à poster
Partager sur d’autres sites

@MAM78 Je continue les tests

Lorsque j'actionne un bouton du VD, "Arrêt cameras" ou "Snapshot", en général la fonction s'exécute correctement pour 2 des 4 caméras.

Lorsque je regarde le débug de plus près, je constate que l'adresse IP de l'instruction API est ":0".

As-tu déjà rencontré ce cas de figure ?

 

Voici un extrait du débug:

 

Capture d’écran 2019-03-03 à 07.55.07.png

Modifié par sumsum

Partager ce message


Lien à poster
Partager sur d’autres sites

Hello. Les VD et la scène se sont mis à ne plus fonctionner. Plus d'accès aux caméras. Voici le debug.

[DEBUG] 22:00:43: VD_Label : lblCamRecord [DEBUG] 22:00:43: 14/03/2019 : Arret cameras Stop
[DEBUG] 22:00:43: 14/03/2019 : Arret cameras Stop
[DEBUG] 22:00:43: Gloabal Variable = SurvStationManager Contente : ({"pathAuth":"auth.cgi","pathCamera":"entry.cgi","SceneID":374,"HomeMode":false,"pathRecord":"entry.cgi","SID":"z9LIa7yTO7LEE16xxxxxxxxxxx","Cameras":{"1":{"Cam_VD_Id":1362,"Cam_Motion_Source":1,"Cam_Recording":false,"CameraStatus":0,"Cam_PTZ_Position_id":"","Cam_PTZ_Position_name":"","Cam_WithPTZ":false,"Cam_Name":"Caméra Piscine","Cam_Motion_Disabled":false,"Cam_Enabled":true},"2":{"Cam_VD_Id":1363,"Cam_Motion_Source":1,"Cam_Recording":false,"CameraStatus":0,"Cam_PTZ_Position_id":"","Cam_PTZ_Position_name":"","Cam_WithPTZ":false,"Cam_Name":"Caméra Avant","Cam_Motion_Disabled":false,"Cam_Enabled":true}},"CameraList":"1,2"}
[DEBUG] 22:00:43: pathAuth =auth.cgi Parameters found in "SurvStationManager" global variable
[DEBUG] 22:00:43: pathRecord =entry.cgi Parameters found in "SurvStationManager" global variable
[DEBUG] 22:00:43: pathCamera =entry.cgi Parameters found in "SurvStationManager" global variable
[DEBUG] 22:00:43: SID =z9LIa7yTO7LEE16xxxxxxxxxxx Parameters found in "SurvStationManager" global variable
[DEBUG] 22:00:43: setTimeout(function() functions[Start_Stop_Camera]() end, 0)
[DEBUG] 22:00:43: Scene main loop finished
[DEBUG] 22:00:43: Call Start_Stop_Camera() function
[DEBUG] 22:00:43: getAPI() : http://192.168.1.xx:5000/webapi/entry.cgi?api=SYNO.SurveillanceStation.Camera&version=9&method=Disable&idList=1&_sid=z9LIa7yTO7LEE16xxxxxxxxxxx
[DEBUG] 22:00:43: VD_Label : lblCamRecord
[DEBUG] 22:00:43: 14/03/2019 : Arret cameras Stop
[DEBUG] 22:00:43: getAPI() : response not success
[DEBUG] 22:00:43: getAPI() : callback function Start_Stop_Camera
[DEBUG] 22:00:43: Gloabal Variable = SurvStationManager Contente : ({"pathAuth":"auth.cgi","pathCamera":"entry.cgi","SceneID":374,"HomeMode":false,"pathRecord":"entry.cgi","SID":"z9LIa7yTO7LEE16xxxxxxxxxxx","Cameras":{"1":{"Cam_VD_Id":1362,"Cam_Motion_Source":1,"Cam_Recording":false,"CameraStatus":0,"Cam_PTZ_Position_id":"","Cam_PTZ_Position_name":"","Cam_WithPTZ":false,"Cam_Name":"Caméra Piscine","Cam_Motion_Disabled":false,"Cam_Enabled":true},"2":{"Cam_VD_Id":1363,"Cam_Motion_Source":1,"Cam_Recording":false,"CameraStatus":0,"Cam_PTZ_Position_id":"","Cam_PTZ_Position_name":"","Cam_WithPTZ":false,"Cam_Name":"Caméra Avant","Cam_Motion_Disabled":false,"Cam_Enabled":true}},"CameraList":"1,2"}
[DEBUG] 22:00:43: pathAuth =auth.cgi Parameters found in "SurvStationManager" global variable
[DEBUG] 22:00:43: Error : Start_Stop_Camera failed : API Authentication failure, Insufficient user privilege
[DEBUG] 22:00:43: pathRecord =entry.cgi Parameters found in "SurvStationManager" global variable
[DEBUG] 22:00:43: label : lblStatus value : Arret cameras Failed
[DEBUG] 22:00:43: pathCamera =entry.cgi Parameters found in "SurvStationManager" global variable
[DEBUG] 22:00:43: Update VD_ID : 1364 label : ui.lblStatus.value => Arret cameras Failed
[DEBUG] 22:00:43: SID =z9LIa7yTO7LEE16xxxxxxxxxxx Parameters found in "SurvStationManager" global variable
[DEBUG] 22:00:43: setTimeout(function() functions[Start_Stop_Camera]() end, 0)
[DEBUG] 22:00:43: Scene main loop finished
[DEBUG] 22:00:43: Call Start_Stop_Camera() function

Apparemment c'est un problème d'accès à l'API mais ça fonctionnait bien jusqu'à présent. Je n'ai rien touché.

Modifié par fredokl

Partager ce message


Lien à poster
Partager sur d’autres sites

Bonjour,

 

Avant tout, félicitations pour ce travail.

 

J'ai installé les différents VD, ( le global et 1 caméra) ainsi que la scene, mais je rencontre le problème suivant (cf. ci dessous la trace dans la main loop du VD Global).

  • Dans les paramètres Du VD, j'ai bien l'IP de mon Synology (j'ai essayé avec le port 5000 et aussi 5001)
  • j'ai paramétré mon login et pwd (j'ai utilisé le compte admin de mon NAS)
  • Dans le tableau (List_CAM), j'ai renseigné l'ID du VD de ma CAM
    • List_CAM = {
            ID_CAM_10 = {VD_ID = 91}
            },

Ai-je loupé qqchose? 

Quelles traces puis-je rajouter pour avoir un peu plus d'informations sur la cause du problème?

D'avance merci pour l'aide que certains d'entre vous m'apporteront.

 

image.png.0edac5c4da4f8023596316f46646d028.png

 

[DEBUG] 17:39:01: main()..

Partager ce message


Lien à poster
Partager sur d’autres sites

×