Bonjour,
J’ai ajouté la prise en charge de la caméra Wanscam Q3. Comment puis-je transmettre les modifications ? (fichier json et jpeg + patch du fichier camera.class.php).
Merci
Bonjour,
J’ai ajouté la prise en charge de la caméra Wanscam Q3. Comment puis-je transmettre les modifications ? (fichier json et jpeg + patch du fichier camera.class.php).
Merci
Bonjour,
Tu peux les mettre ici, je regarderais pour les intégrer au plugin.
Bonjour,
Le fichier wanscam.q3.json
{
"wanscam.q3": {
"name" : "Wanscam q3(s)",
"configuration": {
"urlStream": "\/mjpeg/snap.cgi",
"protocole": "http"
},
"commands": [
{
"eqType": "camera",
"name": "Haut",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=ptzctrl&act=up",
"stopCmdUrl": "\/hy-cgi/ptz.cgi?cmd=ptzctrl&act=stop"
},
"display": {
"icon": "<i class=\"fa fa-arrow-up\"><\/i>",
"generic_type": "CAMERA_UP"
},
"isVisible": "1"
},
{
"eqType": "camera",
"name": "Bas",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=ptzctrl&act=down",
"stopCmdUrl": "\/hy-cgi/ptz.cgi?cmd=ptzctrl&act=stop"
},
"display": {
"icon": "<i class=\"fa fa-arrow-down\"><\/i>",
"generic_type": "CAMERA_DOWN"
},
"isVisible": "1"
},
{
"eqType": "camera",
"name": "Gauche",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=ptzctrl&act=left",
"stopCmdUrl": "\/hy-cgi/ptz.cgi?cmd=ptzctrl&act=stop"
},
"display": {
"icon": "<i class=\"fa fa-arrow-left\"><\/i>",
"generic_type": "CAMERA_LEFT"
},
"isVisible": "1"
},
{
"eqType": "camera",
"name": "Droite",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=ptzctrl&act=right",
"stopCmdUrl": "\/hy-cgi/ptz.cgi?cmd=ptzctrl&act=stop"
},
"display": {
"icon": "<i class=\"fa fa-arrow-right\"><\/i>",
"generic_type": "CAMERA_RIGHT"
},
"isVisible": "1"
},
{
"eqType": "camera",
"name": "Patrouille horizontale",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=ptzctrl&act=hscan"
},
"isVisible": "0"
},
{
"eqType": "camera",
"name": "Patrouille verticale",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=ptzctrl&act=vscan"
},
"isVisible": "0"
},
{
"eqType": "camera",
"name": "Patrouille stop",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=ptzctrl&act=stop"
},
"isVisible": "0"
},
{
"eqType": "camera",
"name": "Home",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=ptzctrl&act=home"
},
"display": {
"icon": "<i class=\"fa fa-home\"><\/i>",
"generic_type": "CAMERA_PRESET"
}
},
{
"eqType": "camera",
"name": "IR ON",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/irctrl.cgi?cmd=setircutstatus&ircutstatus=ope
n"
},
"display": {
"icon": "<i class=\"icon jeedom2-lightbulb58\"><\/i>"
},
"isVisible": "1"
},
{
"eqType": "camera",
"name": "IR OFF",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/irctrl.cgi?cmd=setircutstatus&ircutstatus=close"
},
"display": {
"icon": "<i class=\"icon jeedom2-lightbulb25\"><\/i>"
},
"isVisible": "1"
},
{
"eqType": "camera",
"name": "IR AUTO",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/irctrl.cgi?cmd=setircutctrl&ircutctrlstatus=auto"
},
"isVisible": "1"
},
{
"eqType": "camera",
"name": "IR MANU",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/irctrl.cgi?cmd=setircutctrl&ircutctrlstatus=manual"
},
"isVisible": "1"
},
{
"eqType": "camera",
"name": "Set Pos 1",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=set&number=1"
},
"isVisible": "1"
},
{
"eqType": "camera",
"name": "Pos 1",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=goto&number=1"
},
"isVisible": "1"
},
{
"eqType": "camera",
"name": "Set Pos 2",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=set&number=1"
},
"isVisible": "1"
},
{
"eqType": "camera",
"name": "Pos 2",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=goto&number=2"
},
"isVisible": "1"
},
{
"eqType": "camera",
"name": "Set Pos 3",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=set&number=3"
},
"isVisible": "0"
},
{
"eqType": "camera",
"name": "Pos 3",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=goto&number=3"
},
"isVisible": "0"
},
{
"eqType": "camera",
"name": "Set Pos 4",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=set&number=4"
},
"isVisible": "0"
},
{
"eqType": "camera",
"name": "Pos 4",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=goto&number=4"
},
"isVisible": "0"
},
{
"eqType": "camera",
"name": "Set Pos 5",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=set&number=5"
},
"isVisible": "0"
},
{
"eqType": "camera",
"name": "Pos 5",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=goto&number=5"
},
"isVisible": "0"
},
{
"eqType": "camera",
"name": "Set Pos 6",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=set&number=6"
},
"isVisible": "0"
},
{
"eqType": "camera",
"name": "Pos 6",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=goto&number=6"
},
"isVisible": "0"
},
{
"eqType": "camera",
"name": "Set Pos 7",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=set&number=7"
},
"isVisible": "0"
},
{
"eqType": "camera",
"name": "Pos 7",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=goto&number=7"
},
"isVisible": "0"
},
{
"eqType": "camera",
"name": "Set Pos 8",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=set&number=8"
},
"isVisible": "0"
},
{
"eqType": "camera",
"name": "Pos 8",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=goto&number=8"
},
"isVisible": "0"
},
{
"eqType": "camera",
"name": "C1",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/mjpeg/setchn.cgi?chn=0"
},
"isVisible": "1"
},
{
"eqType": "camera",
"name": "C2",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/mjpeg/setchn.cgi?chn=1"
},
"isVisible": "1"
}
]
}
}
La modification du fichier camera.class.php se situe à la fin de la méthode execute()
} else {
$http = new com_http($url, $eqLogic->getConfiguration('username'), $eqLogic->getConfiguration('password'));
$http->setNoReportError(true);
$result=$http->exec(2);
}
devient
} else {
$http = new com_http($url, $eqLogic->getConfiguration('username'), $eqLogic->getConfiguration('password'));
$http->setNoReportError(true);
$http->setCURLOPT_HTTPAUTH(CURLAUTH_ANY);
$headers = array(
'User-Agent: Jeedom',
);
$http->setHeader($headers);
$result=$http->exec(2);
}
L’option curl est utilisé car la caméra ne supporte que le mode digest pour l’authentification (en mettant anyauth, cela est compatible avec l’ensemble des caméras, qu’elles aient une authentification ou non).
L’entête est utilisée car sans useragent , la caméra retourne une erreur 501.
En pièces jointes l’image ainsi que la doc de l’API de la caméra.
Wansview_NCM625GB_X-CGI.pdf (1,3 Mo)
Super merci beaucoup je viens de le pousser en beta, ca sera donc dans la beta du market demain et en stable dans la prochaine version du plugin.
Merci encore.
Bonjour,
Je me suis trompé dans le nom de la caméra C’est une Wansview q3(s) et non une Wanscam.
Désolé
Bonjour,
J’ai modifié le fichier json (il y avait un problème sur la définition des positions de la caméra). J’en ai profité pour modifier le nom de la caméra Wanscam → Wansview. Il n’y a pas de modification du fichier camera.class.php par rapport à celui que j’ai posté précédemment.
wansview.q3.json
{
"wansview.q3": {
"name" : "Wansview q3(s)",
"configuration": {
"urlStream": "\/mjpeg/snap.cgi",
"protocole": "http"
},
"commands": [
{
"eqType": "camera",
"name": "Haut",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=ptzctrl&act=up",
"stopCmdUrl": "\/hy-cgi/ptz.cgi?cmd=ptzctrl&act=stop"
},
"display": {
"icon": "<i class=\"fa fa-arrow-up\"><\/i>",
"generic_type": "CAMERA_UP"
},
"isVisible": "1"
},
{
"eqType": "camera",
"name": "Bas",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=ptzctrl&act=down",
"stopCmdUrl": "\/hy-cgi/ptz.cgi?cmd=ptzctrl&act=stop"
},
"display": {
"icon": "<i class=\"fa fa-arrow-down\"><\/i>",
"generic_type": "CAMERA_DOWN"
},
"isVisible": "1"
},
{
"eqType": "camera",
"name": "Gauche",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=ptzctrl&act=left",
"stopCmdUrl": "\/hy-cgi/ptz.cgi?cmd=ptzctrl&act=stop"
},
"display": {
"icon": "<i class=\"fa fa-arrow-left\"><\/i>",
"generic_type": "CAMERA_LEFT"
},
"isVisible": "1"
},
{
"eqType": "camera",
"name": "Droite",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=ptzctrl&act=right",
"stopCmdUrl": "\/hy-cgi/ptz.cgi?cmd=ptzctrl&act=stop"
},
"display": {
"icon": "<i class=\"fa fa-arrow-right\"><\/i>",
"generic_type": "CAMERA_RIGHT"
},
"isVisible": "1"
},
{
"eqType": "camera",
"name": "Patrouille horizontale",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=ptzctrl&act=hscan"
},
"isVisible": "0"
},
{
"eqType": "camera",
"name": "Patrouille verticale",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=ptzctrl&act=vscan"
},
"isVisible": "0"
},
{
"eqType": "camera",
"name": "Patrouille stop",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=ptzctrl&act=stop"
},
"isVisible": "0"
},
{
"eqType": "camera",
"name": "Home",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=ptzctrl&act=home"
},
"display": {
"icon": "<i class=\"fa fa-home\"><\/i>",
"generic_type": "CAMERA_PRESET"
}
},
{
"eqType": "camera",
"name": "IR ON",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/irctrl.cgi?cmd=setircutstatus&ircutstatus=ope
n"
},
"display": {
"icon": "<i class=\"icon jeedom2-lightbulb58\"><\/i>"
},
"isVisible": "1"
},
{
"eqType": "camera",
"name": "IR OFF",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/irctrl.cgi?cmd=setircutstatus&ircutstatus=close"
},
"display": {
"icon": "<i class=\"icon jeedom2-lightbulb25\"><\/i>"
},
"isVisible": "1"
},
{
"eqType": "camera",
"name": "IR AUTO",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/irctrl.cgi?cmd=setircutctrl&ircutctrlstatus=auto"
},
"isVisible": "1"
},
{
"eqType": "camera",
"name": "IR MANU",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/irctrl.cgi?cmd=setircutctrl&ircutctrlstatus=manual"
},
"isVisible": "1"
},
{
"eqType": "camera",
"name": "Set Pos 1",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=set&status=1&number=1"
},
"isVisible": "1"
},
{
"eqType": "camera",
"name": "Pos 1",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=goto&number=1"
},
"isVisible": "1"
},
{
"eqType": "camera",
"name": "Set Pos 2",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=set&status=1&number=2"
},
"isVisible": "1"
},
{
"eqType": "camera",
"name": "Pos 2",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=goto&number=2"
},
"isVisible": "1"
},
{
"eqType": "camera",
"name": "Set Pos 3",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=set&status=1&number=3"
},
"isVisible": "0"
},
{
"eqType": "camera",
"name": "Pos 3",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=goto&number=3"
},
"isVisible": "0"
},
{
"eqType": "camera",
"name": "Set Pos 4",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=set&status=1&number=4"
},
"isVisible": "0"
},
{
"eqType": "camera",
"name": "Pos 4",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=goto&number=4"
},
"isVisible": "0"
},
{
"eqType": "camera",
"name": "Set Pos 5",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=set&status=1&number=5"
},
"isVisible": "0"
},
{
"eqType": "camera",
"name": "Pos 5",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=goto&number=5"
},
"isVisible": "0"
},
{
"eqType": "camera",
"name": "Set Pos 6",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=set&status=1&number=6"
},
"isVisible": "0"
},
{
"eqType": "camera",
"name": "Pos 6",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=goto&number=6"
},
"isVisible": "0"
},
{
"eqType": "camera",
"name": "Set Pos 7",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=set&status=1&number=7"
},
"isVisible": "0"
},
{
"eqType": "camera",
"name": "Pos 7",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=goto&number=7"
},
"isVisible": "0"
},
{
"eqType": "camera",
"name": "Set Pos 8",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=set&status=1&number=8"
},
"isVisible": "0"
},
{
"eqType": "camera",
"name": "Pos 8",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/hy-cgi/ptz.cgi?cmd=preset&act=goto&number=8"
},
"isVisible": "0"
},
{
"eqType": "camera",
"name": "C1",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/mjpeg/setchn.cgi?chn=0"
},
"isVisible": "1"
},
{
"eqType": "camera",
"name": "C2",
"type": "action",
"subType": "other",
"isHistorized": "0",
"configuration": {
"request": "\/mjpeg/setchn.cgi?chn=1"
},
"isVisible": "1"
}
]
}
}
wansview.q3.jpg
Merci