From e402093f4bc598caf092900ec513204d9024774c Mon Sep 17 00:00:00 2001 From: sagitaz Date: Sat, 18 Apr 2026 08:21:07 +0200 Subject: [PATCH 01/12] =?UTF-8?q?Ajout=20de=20type=20g=C3=A9n=C3=A9rique?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/class/frigate.class.php | 18 +++++++++--------- plugin_info/info.json | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/core/class/frigate.class.php b/core/class/frigate.class.php index 58b76c30..054b57b0 100644 --- a/core/class/frigate.class.php +++ b/core/class/frigate.class.php @@ -2021,33 +2021,33 @@ private static function updateCommands($eqlogicId, $type, $frigateEvent) { log::add(__CLASS__, 'debug', "║ MAJ Commandes pour le type : $type"); - $update = function ($label, $subtype, $unit, $logicalId, $value) use ($eqlogicId) { - $cmd = self::createCmd($eqlogicId, $label, $subtype, $unit, $logicalId, "", 0, null, 0); + $update = function ($label, $subtype, $unit, $logicalId, $genericType, $value) use ($eqlogicId) { + $cmd = self::createCmd($eqlogicId, $label, $subtype, $unit, $logicalId, $genericType, 0, null, 0); $cmd->save(); $cmd->event($value ?? ''); $cmd->save(); }; - $update("Reconnaissance - Type", "string", "", "info_detection_type", $type); + $update("Reconnaissance - Type", "string", "", "info_detection_type", "", $type); $withNameScore = ['face', 'lpr', 'classification']; if (in_array($type, $withNameScore)) { - $update("Reconnaissance - Nom", "string", "", "info_detection_name", $frigateEvent->getRecognition_name()); - $update("Reconnaissance - Score", "numeric", "%", "info_detection_score", $frigateEvent->getRecognition_score()); + $update("Reconnaissance - Nom", "string", "", "info_detection_name", "", $frigateEvent->getRecognition_name()); + $update("Reconnaissance - Score", "numeric", "%", "info_detection_score", "", $frigateEvent->getRecognition_score()); } if ($type === 'description') { log::add(__CLASS__, 'debug', "║ Mise à jour de la description : " . $frigateEvent->getRecognition_description()); - $update("Reconnaissance - Description", "string", "", "info_description", $frigateEvent->getRecognition_description()); + $update("Reconnaissance - Description", "string", "", "info_description", "", $frigateEvent->getRecognition_description()); } if ($type === 'lpr') { - $update("Reconnaissance - Plaque d'immatriculation", "string", "", "info_plate", $frigateEvent->getRecognition_plate()); + $update("Reconnaissance - Plaque d'immatriculation", "string", "", "info_plate", "", $frigateEvent->getRecognition_plate()); } if ($type === 'classification') { - $update("Reconnaissance - Label", "string", "", "info_detection_subname", $frigateEvent->getRecognition_subname()); - $update("Reconnaissance - Attributs", "string", "", "info_detection_attributes", $frigateEvent->getRecognition_attributes()); + $update("Reconnaissance - Label", "string", "", "info_detection_subname", "", $frigateEvent->getRecognition_subname()); + $update("Reconnaissance - Attributs", "string", "", "info_detection_attributes", "", $frigateEvent->getRecognition_attributes()); } } diff --git a/plugin_info/info.json b/plugin_info/info.json index 44d8a936..9a2d38c4 100644 --- a/plugin_info/info.json +++ b/plugin_info/info.json @@ -1,7 +1,7 @@ { "id": "frigate", "name": "Frigate", - "pluginVersion": "1.5.2", + "pluginVersion": "1.5.21", "installation": "Il est nécessaire d'avoir le plugin mqtt-manager installé avec un broker MQTT sécurisé (user / mdp) pour profiter de toutes les fonctionnalités. Dans le cas contraire, le plugin Frigate sera limité. Voir la documentation pour plus d'informations.", "description": { "fr_FR": "Plugin Frigate pour Jeedom. Ne fonctionne qu'avec les versions de Frigate > 0.13.0. Le plugin n'installe pas le serveur Frigate mais permet de le controler.", From 5d2ad52a91b516a19c583a5378494de4dd041ba0 Mon Sep 17 00:00:00 2001 From: sagitaz Date: Sat, 18 Apr 2026 15:32:52 +0200 Subject: [PATCH 02/12] ajout refresh sur chaque eqLogic --- core/class/frigate.class.php | 7 ++++++- desktop/js/frigate.js | 5 +++++ desktop/php/frigate.php | 9 ++++++++- plugin_info/info.json | 2 +- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/core/class/frigate.class.php b/core/class/frigate.class.php index 054b57b0..13e69929 100644 --- a/core/class/frigate.class.php +++ b/core/class/frigate.class.php @@ -408,7 +408,12 @@ public function toHtml($_version = 'dashboard') $replace['#cameraName#'] = $this->getConfiguration("name"); $replace['#imgUrl#'] = $this->getConfiguration("img"); $replace['#enabled#'] = $this->getCmd('info', 'info_enabled') ? $this->getCmd('info', 'info_enabled')->execCmd() : 1; - $replace['#refresh#'] = (float)(config::byKey('refresh_snapshot', 'frigate')) * 1000; + + if ($this->getConfiguration('normal::refresh') != '') { + $replace['#refresh#'] = (float)$this->getConfiguration('normal::refresh') * 1000; + } else { + $replace['#refresh#'] = (float)(config::byKey('refresh_snapshot', 'frigate', 5)) * 1000; + } $replace['#actions#'] = $this->buildActions(); $replace['#iaActions#'] = $this->buildIaActions(); diff --git a/desktop/js/frigate.js b/desktop/js/frigate.js index 4d73ab36..5bae1e1c 100644 --- a/desktop/js/frigate.js +++ b/desktop/js/frigate.js @@ -528,6 +528,11 @@ function printEqLogic(_eqLogic) { observer.observe(imgElement); function startImageFetchInterval() { + const eqRefresh = $('.eqLogicAttr[data-l1key=configuration][data-l2key=normal::refresh]').val(); + if (eqRefresh && !isNaN(eqRefresh) && eqRefresh > 0) { + refresh = eqRefresh * 1000; + } + console.log('Refresh interval in milliseconds: ' + refresh); if (!intervalId) { intervalId = setInterval(refreshImage, refresh); } diff --git a/desktop/php/frigate.php b/desktop/php/frigate.php index 5f5aacd9..476735bb 100644 --- a/desktop/php/frigate.php +++ b/desktop/php/frigate.php @@ -13,7 +13,6 @@ sendVarToJS('frigateURL', $urlFrigate); $urlExterne = config::byKey('URLexterne', 'frigate'); sendVarToJS('frigateURLexterne', $urlExterne); - $refresh = (float)(config::byKey('refresh_snapshot', 'frigate')) * 1000; sendVarToJS('refresh', $refresh); ?> @@ -209,6 +208,14 @@ +
+ +
+ +
+
diff --git a/plugin_info/info.json b/plugin_info/info.json index 9a2d38c4..f7bc970e 100644 --- a/plugin_info/info.json +++ b/plugin_info/info.json @@ -1,7 +1,7 @@ { "id": "frigate", "name": "Frigate", - "pluginVersion": "1.5.21", + "pluginVersion": "1.5.22", "installation": "Il est nécessaire d'avoir le plugin mqtt-manager installé avec un broker MQTT sécurisé (user / mdp) pour profiter de toutes les fonctionnalités. Dans le cas contraire, le plugin Frigate sera limité. Voir la documentation pour plus d'informations.", "description": { "fr_FR": "Plugin Frigate pour Jeedom. Ne fonctionne qu'avec les versions de Frigate > 0.13.0. Le plugin n'installe pas le serveur Frigate mais permet de le controler.", From 4c11e0d522791d2ec3436df77f83a73688a14597 Mon Sep 17 00:00:00 2001 From: sagitaz Date: Sat, 18 Apr 2026 15:48:55 +0200 Subject: [PATCH 03/12] Add console log for debug refresh --- core/template/dashboard/widgetCamera.html | 1 + core/template/dashboard/widgetPanel.html | 3 ++- desktop/js/frigate.js | 9 +++++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/core/template/dashboard/widgetCamera.html b/core/template/dashboard/widgetCamera.html index 8489a2b0..779c2a22 100644 --- a/core/template/dashboard/widgetCamera.html +++ b/core/template/dashboard/widgetCamera.html @@ -112,6 +112,7 @@ function startImageFetchInterval() { if (!intervalId) { intervalId = setInterval(refreshImage, #refresh#); + console.log('Interval started for camera #id# with refresh rate: ' + #refresh# + ' ms'); } } diff --git a/core/template/dashboard/widgetPanel.html b/core/template/dashboard/widgetPanel.html index 35e82fed..b026c790 100644 --- a/core/template/dashboard/widgetPanel.html +++ b/core/template/dashboard/widgetPanel.html @@ -108,7 +108,8 @@ function startImageFetchInterval() { if (!intervalId) { - intervalId = setInterval(refreshImage, #refresh#); + intervalId = setInterval(refreshImage, #refresh#); + console.log('Interval started for camera #id# with refresh rate: ' + #refresh# + ' ms'); } } diff --git a/desktop/js/frigate.js b/desktop/js/frigate.js index 5bae1e1c..5629f847 100644 --- a/desktop/js/frigate.js +++ b/desktop/js/frigate.js @@ -528,10 +528,15 @@ function printEqLogic(_eqLogic) { observer.observe(imgElement); function startImageFetchInterval() { - const eqRefresh = $('.eqLogicAttr[data-l1key=configuration][data-l2key=normal::refresh]').val(); + const eqRefresh = $('.eqLogicAttr[data-l1key="configuration"]') + .filter(function () { + return $(this).attr('data-l2key') === 'normal::refresh'; + }) + .val(); + if (eqRefresh && !isNaN(eqRefresh) && eqRefresh > 0) { refresh = eqRefresh * 1000; - } + } console.log('Refresh interval in milliseconds: ' + refresh); if (!intervalId) { intervalId = setInterval(refreshImage, refresh); From 7ec26c3facc4c6dd747055fc2378012c03f24daf Mon Sep 17 00:00:00 2001 From: sagitaz Date: Sat, 18 Apr 2026 16:06:56 +0200 Subject: [PATCH 04/12] refresh interval for eqLogic --- desktop/js/frigate.js | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/desktop/js/frigate.js b/desktop/js/frigate.js index 5629f847..d643b026 100644 --- a/desktop/js/frigate.js +++ b/desktop/js/frigate.js @@ -533,14 +533,19 @@ function printEqLogic(_eqLogic) { return $(this).attr('data-l2key') === 'normal::refresh'; }) .val(); - + refreshSnap = refresh; if (eqRefresh && !isNaN(eqRefresh) && eqRefresh > 0) { - refresh = eqRefresh * 1000; + refreshSnap = eqRefresh * 1000; } - console.log('Refresh interval in milliseconds: ' + refresh); - if (!intervalId) { - intervalId = setInterval(refreshImage, refresh); + + // On arrête toujours l'intervalle existant avant d'en créer un nouveau + if (intervalId) { + clearInterval(intervalId); + intervalId = null; } + + console.log('Refresh interval in milliseconds: ' + refreshSnap); + intervalId = setInterval(refreshImage, refreshSnap); } function stopImageFetchInterval() { @@ -667,12 +672,12 @@ document.getElementById('addCmdHttp').addEventListener('click', function () { }, dataType: 'json', - error: function (error) { - jeedomUtils.showAlert({ - message: error.message, - level: 'danger' - }); - }, + error: function (error) { + jeedomUtils.showAlert({ + message: error.message, + level: 'danger' + }); + }, success: function (data) { jeedomUtils.showAlert({ message: '{{Création de la commande réussie.}}', @@ -708,12 +713,12 @@ function editHTTP(cmd) { }, dataType: 'json', - error: function (error) { - jeedomUtils.showAlert({ - message: error.message, - level: 'danger' - }); - }, + error: function (error) { + jeedomUtils.showAlert({ + message: error.message, + level: 'danger' + }); + }, success: function (data) { jeedomUtils.showAlert({ message: '{{Modification de la commande réussie.}}', From e6a56d0f5321e89bd1d96592966d7b2fb66c99a2 Mon Sep 17 00:00:00 2001 From: sagitaz Date: Sun, 19 Apr 2026 11:16:08 +0200 Subject: [PATCH 05/12] add normal::mobilerefresh --- core/class/frigate.class.php | 16 ++++++++++++++++ desktop/php/frigate.php | 7 +++++-- plugin_info/info.json | 2 +- plugin_info/install.php | 2 ++ 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/core/class/frigate.class.php b/core/class/frigate.class.php index 13e69929..a6a49820 100644 --- a/core/class/frigate.class.php +++ b/core/class/frigate.class.php @@ -84,6 +84,22 @@ private static function configSave(array $array = []): void } } } + + public static function setConfigEqlogic() { + $eqLogics = self::byType('frigate'); + foreach ($eqLogics as $eqLogic) { + $refresh = config::byKey('refresh_snapshot', 'frigate', 5); + if ($eqLogic->getConfiguration('normal::refresh') === null) { + $eqLogic->setConfiguration('normal::refresh', $refresh); + $eqLogic->save(); + } + if ($eqLogic->getConfiguration('normal::mobilerefresh') === null) { + $eqLogic->setConfiguration('normal::mobilerefresh', $refresh); + $eqLogic->save(); + } + } + } + private static function execCron($frequence) { log::add(__CLASS__, 'debug', "╔════════════════════════ :fg-success:START CRON:/fg: ════════════════════════"); diff --git a/desktop/php/frigate.php b/desktop/php/frigate.php index 476735bb..229f7da6 100644 --- a/desktop/php/frigate.php +++ b/desktop/php/frigate.php @@ -212,8 +212,11 @@ -
- +
+ +
+
+
diff --git a/plugin_info/info.json b/plugin_info/info.json index f7bc970e..126fec07 100644 --- a/plugin_info/info.json +++ b/plugin_info/info.json @@ -1,7 +1,7 @@ { "id": "frigate", "name": "Frigate", - "pluginVersion": "1.5.22", + "pluginVersion": "1.5.23", "installation": "Il est nécessaire d'avoir le plugin mqtt-manager installé avec un broker MQTT sécurisé (user / mdp) pour profiter de toutes les fonctionnalités. Dans le cas contraire, le plugin Frigate sera limité. Voir la documentation pour plus d'informations.", "description": { "fr_FR": "Plugin Frigate pour Jeedom. Ne fonctionne qu'avec les versions de Frigate > 0.13.0. Le plugin n'installe pas le serveur Frigate mais permet de le controler.", diff --git a/plugin_info/install.php b/plugin_info/install.php index 4cda66e3..de69b966 100644 --- a/plugin_info/install.php +++ b/plugin_info/install.php @@ -31,6 +31,7 @@ function frigate_install() frigate::setConfig(); frigate::setConfigCron(); + frigate::setConfigEqlogic(); frigate::addMessages(); Log::add("frigate", 'info', 'Finish Install'); } @@ -93,6 +94,7 @@ function frigate_update() } frigate::setConfig(); + frigate::setConfigEqlogic(); frigate::addMessages(); frigate::deleteLatestFile(); Log::add("frigate", 'info', 'Finish Update'); From 508397d59ce1e9d1ff6438f4be9540288544419e Mon Sep 17 00:00:00 2001 From: sagitaz Date: Sun, 19 Apr 2026 14:35:48 +0200 Subject: [PATCH 06/12] =?UTF-8?q?G=C3=A9r=C3=A9=20si=20Enabled=20est=20vid?= =?UTF-8?q?e=20ou=20=20null?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/class/frigate.class.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/class/frigate.class.php b/core/class/frigate.class.php index a6a49820..63b8a5be 100644 --- a/core/class/frigate.class.php +++ b/core/class/frigate.class.php @@ -423,8 +423,13 @@ public function toHtml($_version = 'dashboard') $replace['#cameraEqlogicId#'] = $this->getLogicalId(); $replace['#cameraName#'] = $this->getConfiguration("name"); $replace['#imgUrl#'] = $this->getConfiguration("img"); - $replace['#enabled#'] = $this->getCmd('info', 'info_enabled') ? $this->getCmd('info', 'info_enabled')->execCmd() : 1; - + $enabledCmd = $this->getCmd('info', 'info_enabled'); + if ($enabledCmd) { + $value = $enabledCmd->execCmd(); + $replace['#enabled#'] = ($value !== null && $value !== '') ? $value : 1; + } else { + $replace['#enabled#'] = 1; + } if ($this->getConfiguration('normal::refresh') != '') { $replace['#refresh#'] = (float)$this->getConfiguration('normal::refresh') * 1000; } else { From c884bc946928d8fa2e209fd788ccc98618d38103 Mon Sep 17 00:00:00 2001 From: sagitaz Date: Sun, 19 Apr 2026 22:32:49 +0200 Subject: [PATCH 07/12] Fix putCurl error --- core/class/frigate.class.php | 25 ++++++++++++++++++++----- docs/fr_FR/changelog.md | 7 +++++-- plugin_info/info.json | 2 +- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/core/class/frigate.class.php b/core/class/frigate.class.php index 63b8a5be..fcdade39 100644 --- a/core/class/frigate.class.php +++ b/core/class/frigate.class.php @@ -85,7 +85,8 @@ private static function configSave(array $array = []): void } } - public static function setConfigEqlogic() { + public static function setConfigEqlogic() + { $eqLogics = self::byType('frigate'); foreach ($eqLogics as $eqLogic) { $refresh = config::byKey('refresh_snapshot', 'frigate', 5); @@ -433,7 +434,7 @@ public function toHtml($_version = 'dashboard') if ($this->getConfiguration('normal::refresh') != '') { $replace['#refresh#'] = (float)$this->getConfiguration('normal::refresh') * 1000; } else { - $replace['#refresh#'] = (float)(config::byKey('refresh_snapshot', 'frigate', 5)) * 1000; + $replace['#refresh#'] = (float)(config::byKey('refresh_snapshot', 'frigate', 5)) * 1000; } $replace['#actions#'] = $this->buildActions(); @@ -740,8 +741,19 @@ private static function getcURL($function, $url, $params = null, $decodeJson = t curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); } + // log de la commande curl + $curl_cmd = "curl -k -X " . $method; + if ($method !== 'DELETE') { + $curl_cmd .= " -H 'Content-Type: application/json'"; + $curl_cmd .= " -d '" . json_encode($params) . "'"; + } + $curl_cmd .= " '" . $url . "'"; + log::add(__CLASS__, 'debug', "║ Commande exécutée : " . $curl_cmd); + // Fin du log + $data = curl_exec($ch); + log::add(__CLASS__, 'debug', "║ Réponse reçue : " . $data); if (curl_errno($ch)) { log::add(__CLASS__, "error", "║ Erreur getcURL (" . $method . "): " . curl_error($ch)); return null; @@ -759,6 +771,9 @@ private static function postcURL($function, $url, $params = null, $decodeJson = private static function putcURL($function, $url, $params = null, $decodeJson = true) { + if (empty($params)) { + $params = new stdClass(); + } return self::getcURL($function, $url, $params, $decodeJson, 'PUT'); } @@ -1545,8 +1560,8 @@ public static function getFolderSize() } catch (Exception $e) { return 0; } - $t1 = microtime(true); - log::add(__CLASS__, 'debug', "║ Taille du dossier calculée via PHP : " . round($size / (1024 * 1024), 2) . " Mo en " . round($t1 - $t0, 2) . "s"); + $t1 = microtime(true); + log::add(__CLASS__, 'debug', "║ Taille du dossier calculée via PHP : " . round($size / (1024 * 1024), 2) . " Mo en " . round($t1 - $t0, 2) . "s"); return round($size / (1024 * 1024), 2); } @@ -3190,7 +3205,7 @@ public static function handleMqttMessage($_message) if (version_compare($version, "0.14", "<")) { log::add("frigate_MQTT", 'info', ' => Traitement mqtt events <0.14'); log::add("frigate_MQTT", 'warning', ' => Version < 0.14, mettre à jour votre serveur frigate !'); - message::add("frigate",__("Version de Frigate détectée : " . $version . ", certaines fonctionnalités du plugin peuvent ne pas fonctionner correctement. Veuillez mettre à jour votre serveur Frigate pour une expérience optimale.", __FILE__)); + message::add("frigate", __("Version de Frigate détectée : " . $version . ", certaines fonctionnalités du plugin peuvent ne pas fonctionner correctement. Veuillez mettre à jour votre serveur Frigate pour une expérience optimale.", __FILE__)); self::getEvents(true, [$value['after']], $value['type']); event::add('frigate::events', array('message' => 'mqtt_update', 'type' => 'event')); } diff --git a/docs/fr_FR/changelog.md b/docs/fr_FR/changelog.md index 278a1a94..7e04f555 100644 --- a/docs/fr_FR/changelog.md +++ b/docs/fr_FR/changelog.md @@ -4,10 +4,13 @@ > >S'il n'y a pas d'information sur la mise à jour, c'est que celle-ci concerne uniquement de la mise à jour de documentation, de traduction ou de texte. -# 13/05/2026 Beta 1.5.2 +# 19/04/2026 Beta 1.5.4 +- Correction du put curl pour l'activation et la désactivation des caméras via API + +# 13/04/2026 Beta 1.5.2 - Correction widget dashboard -# 09/05/2026 Beta 1.5.1 +# 09/04/2026 Beta 1.5.1 - Amélioration du processus de nettoyage des évènements - Correction maj sur cron via http diff --git a/plugin_info/info.json b/plugin_info/info.json index 126fec07..9baeb4c2 100644 --- a/plugin_info/info.json +++ b/plugin_info/info.json @@ -1,7 +1,7 @@ { "id": "frigate", "name": "Frigate", - "pluginVersion": "1.5.23", + "pluginVersion": "1.5.24", "installation": "Il est nécessaire d'avoir le plugin mqtt-manager installé avec un broker MQTT sécurisé (user / mdp) pour profiter de toutes les fonctionnalités. Dans le cas contraire, le plugin Frigate sera limité. Voir la documentation pour plus d'informations.", "description": { "fr_FR": "Plugin Frigate pour Jeedom. Ne fonctionne qu'avec les versions de Frigate > 0.13.0. Le plugin n'installe pas le serveur Frigate mais permet de le controler.", From a70347b0a059e01d0336bf2abb22a8e79cb6aff5 Mon Sep 17 00:00:00 2001 From: sagitaz Date: Wed, 22 Apr 2026 10:55:20 +0200 Subject: [PATCH 08/12] Ajout title sur modal IA --- core/class/frigate.class.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/core/class/frigate.class.php b/core/class/frigate.class.php index fcdade39..fb7f36fd 100644 --- a/core/class/frigate.class.php +++ b/core/class/frigate.class.php @@ -510,7 +510,7 @@ private function buildActions(): string return $html; } - private function buildIaToggleRow(string $startLogical, string $stopLogical, string $infoLogical, string $label): string + private function buildIaToggleRow(string $startLogical, string $stopLogical, string $infoLogical, string $label, string $title = ''): string { $on = $this->getCmd('action', $startLogical); $off = $this->getCmd('action', $stopLogical); @@ -523,18 +523,19 @@ private function buildIaToggleRow(string $startLogical, string $stopLogical, str $cmdId = $isActive ? $off->getId() : $on->getId(); return '
' - . '' . $label . '' + . '' . $label . '' . '' . '
'; } private function buildIaActions(): string { - return $this->buildIaToggleRow('action_start_review_alerts', 'action_stop_review_alerts', 'info_review_alerts', '{{Review alerts}}') - . $this->buildIaToggleRow('action_start_review_detections', 'action_stop_review_detections', 'info_review_detections', '{{Review detections}}') - . $this->buildIaToggleRow('action_start_review_descriptions', 'action_stop_review_descriptions', 'info_review_descriptions', '{{Review descriptions}}') - . $this->buildIaToggleRow('action_start_object_descriptions', 'action_stop_object_descriptions', 'info_object_descriptions', '{{Object descriptions}}') - . $this->buildIaToggleRow('action_start_enabled', 'action_stop_enabled', 'info_enabled', '{{Activations}}'); + return + $this->buildIaToggleRow('action_start_enabled', 'action_stop_enabled', 'info_enabled', '{{Activer la caméra}}', '') + . $this->buildIaToggleRow('action_start_review_alerts', 'action_stop_review_alerts', 'info_review_alerts', '{{Activités : alertes}}', '{{Active ou désactive temporairement les alertes pour cette caméra jusqu\'au redémarrage de Frigate. Lorsque cette option est désactivée, aucune activité nouvelle n\'est générée.}}') + . $this->buildIaToggleRow('action_start_review_detections', 'action_stop_review_detections', 'info_review_detections', '{{Activités : détections}}', '{{Active ou désactive temporairement les alertes et les détections pour cette caméra jusqu\'au redémarrage de Frigate. Lorsque cette option est désactivée, aucune activité nouvelle n\'est générée.}}') + . $this->buildIaToggleRow('action_start_review_descriptions', 'action_stop_review_descriptions', 'info_review_descriptions', '{{Descriptions des activités}}', '{{Activez ou désactivez temporairement les descriptions d\'activités par IA générative jusqu\'au redémarrage. Si désactivé, l\'IA ne sera plus sollicitée pour décrire les activités sur cette caméra.}}') + . $this->buildIaToggleRow('action_start_object_descriptions', 'action_stop_object_descriptions', 'info_object_descriptions', '{{Descriptions d\'objets}}', '{{Activez ou désactivez temporairement les descriptions par IA générative jusqu\'au redémarrage. Si désactivé, l\'IA ne sera plus sollicitée pour décrire les objets suivis sur cette caméra.}}'); } private function buildDetectNow(): string { From 84911099e037affd4cffca71bd5f91248e17dc07 Mon Sep 17 00:00:00 2001 From: sagitaz Date: Wed, 22 Apr 2026 10:59:45 +0200 Subject: [PATCH 09/12] ajout title pour activation --- core/class/frigate.class.php | 2 +- core/template/dashboard/widgetCamera.html | 2 +- core/template/dashboard/widgetPanel.html | 2 +- plugin_info/info.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/class/frigate.class.php b/core/class/frigate.class.php index fb7f36fd..c1011ce1 100644 --- a/core/class/frigate.class.php +++ b/core/class/frigate.class.php @@ -531,7 +531,7 @@ private function buildIaToggleRow(string $startLogical, string $stopLogical, str private function buildIaActions(): string { return - $this->buildIaToggleRow('action_start_enabled', 'action_stop_enabled', 'info_enabled', '{{Activer la caméra}}', '') + $this->buildIaToggleRow('action_start_enabled', 'action_stop_enabled', 'info_enabled', '{{Activer la caméra}}', '{{Désactive temporairement la caméra jusqu\'au redémarrage de Frigate. La désactivation interrompt complètement le traitement des flux de la caméra par Frigate. La détection, l\'enregistrement et le débogage deviennent alors indisponibles.}}') . $this->buildIaToggleRow('action_start_review_alerts', 'action_stop_review_alerts', 'info_review_alerts', '{{Activités : alertes}}', '{{Active ou désactive temporairement les alertes pour cette caméra jusqu\'au redémarrage de Frigate. Lorsque cette option est désactivée, aucune activité nouvelle n\'est générée.}}') . $this->buildIaToggleRow('action_start_review_detections', 'action_stop_review_detections', 'info_review_detections', '{{Activités : détections}}', '{{Active ou désactive temporairement les alertes et les détections pour cette caméra jusqu\'au redémarrage de Frigate. Lorsque cette option est désactivée, aucune activité nouvelle n\'est générée.}}') . $this->buildIaToggleRow('action_start_review_descriptions', 'action_stop_review_descriptions', 'info_review_descriptions', '{{Descriptions des activités}}', '{{Activez ou désactivez temporairement les descriptions d\'activités par IA générative jusqu\'au redémarrage. Si désactivé, l\'IA ne sera plus sollicitée pour décrire les activités sur cette caméra.}}') diff --git a/core/template/dashboard/widgetCamera.html b/core/template/dashboard/widgetCamera.html index 779c2a22..0b4217f8 100644 --- a/core/template/dashboard/widgetCamera.html +++ b/core/template/dashboard/widgetCamera.html @@ -299,7 +299,7 @@ .frigate_widget .btn-ptz-stop { position: absolute; text-align: center; - z-index: 100; + z-index: 50; } .frigate_widget .btn-ptz-left { diff --git a/core/template/dashboard/widgetPanel.html b/core/template/dashboard/widgetPanel.html index b026c790..21b39dc3 100644 --- a/core/template/dashboard/widgetPanel.html +++ b/core/template/dashboard/widgetPanel.html @@ -297,7 +297,7 @@ .frigate_widget .btn-ptz-stop { position: absolute; text-align: center; - z-index: 100; + z-index: 0; } .frigate_widget .btn-ptz-left { diff --git a/plugin_info/info.json b/plugin_info/info.json index 9baeb4c2..1267a5a1 100644 --- a/plugin_info/info.json +++ b/plugin_info/info.json @@ -1,7 +1,7 @@ { "id": "frigate", "name": "Frigate", - "pluginVersion": "1.5.24", + "pluginVersion": "1.5.25", "installation": "Il est nécessaire d'avoir le plugin mqtt-manager installé avec un broker MQTT sécurisé (user / mdp) pour profiter de toutes les fonctionnalités. Dans le cas contraire, le plugin Frigate sera limité. Voir la documentation pour plus d'informations.", "description": { "fr_FR": "Plugin Frigate pour Jeedom. Ne fonctionne qu'avec les versions de Frigate > 0.13.0. Le plugin n'installe pas le serveur Frigate mais permet de le controler.", From 75c273e0918fe861bf7d791219c08550617b2e5e Mon Sep 17 00:00:00 2001 From: sagitaz Date: Wed, 22 Apr 2026 14:36:24 +0200 Subject: [PATCH 10/12] z-index --- core/template/dashboard/widgetCamera.html | 12 ++++++------ core/template/dashboard/widgetPanel.html | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/core/template/dashboard/widgetCamera.html b/core/template/dashboard/widgetCamera.html index 0b4217f8..46bffe86 100644 --- a/core/template/dashboard/widgetCamera.html +++ b/core/template/dashboard/widgetCamera.html @@ -231,7 +231,7 @@ position: relative !important; text-align: center; background-color: rgb(var(--defaultBkg-color)) !important; - z-index: 98; + z-index: 100; margin-top: 0px; } @@ -299,7 +299,7 @@ .frigate_widget .btn-ptz-stop { position: absolute; text-align: center; - z-index: 50; + z-index: 99; } .frigate_widget .btn-ptz-left { @@ -357,7 +357,7 @@ .frigate_widget .btn-ptz-zoom-out { position: absolute; text-align: center; - z-index: 100; + z-index: 89; width: 20px; height: 20px; background-color: rgba(0, 0, 0, 0.5); @@ -501,11 +501,11 @@ position: absolute; inset: 0; background-color: rgb(var(--defaultBkg-color)); - opacity: 0.9; + opacity: 0.95; width: 435px !important; height: 300px !important; display: none; - z-index: 20; + z-index: 90; border-radius: inherit; } @@ -560,7 +560,7 @@ justify-content: center; gap: 12px; background-color: rgb(var(--defaultBkg-color)); - z-index: 5; + z-index: 80; color: rgb(var(--defaultText-color)); } diff --git a/core/template/dashboard/widgetPanel.html b/core/template/dashboard/widgetPanel.html index 21b39dc3..a9c0e496 100644 --- a/core/template/dashboard/widgetPanel.html +++ b/core/template/dashboard/widgetPanel.html @@ -108,8 +108,8 @@ function startImageFetchInterval() { if (!intervalId) { - intervalId = setInterval(refreshImage, #refresh#); - console.log('Interval started for camera #id# with refresh rate: ' + #refresh# + ' ms'); + intervalId = setInterval(refreshImage, #refresh#); + console.log('Interval started for camera #id# with refresh rate: ' + #refresh# + ' ms'); } } @@ -229,7 +229,7 @@ position: relative !important; text-align: center; background-color: rgb(var(--defaultBkg-color)) !important; - z-index: 98; + z-index: 100; margin-top: 0px; } @@ -297,7 +297,7 @@ .frigate_widget .btn-ptz-stop { position: absolute; text-align: center; - z-index: 0; + z-index: 99; } .frigate_widget .btn-ptz-left { @@ -355,7 +355,7 @@ .frigate_widget .btn-ptz-zoom-out { position: absolute; text-align: center; - z-index: 100; + z-index: 89; width: 20px; height: 20px; background-color: rgba(0, 0, 0, 0.5); @@ -499,11 +499,11 @@ position: absolute; inset: 0; background-color: rgb(var(--defaultBkg-color)); - opacity: 0.9; + opacity: 0.95; width: 435px !important; height: 300px !important; display: none; - z-index: 20; + z-index: 90; border-radius: inherit; } @@ -558,7 +558,7 @@ justify-content: center; gap: 12px; background-color: rgb(var(--defaultBkg-color)); - z-index: 5; + z-index: 80; color: rgb(var(--defaultText-color)); } From ed15c9c9882f3214a8e6ac37328e28d2e2a20c79 Mon Sep 17 00:00:00 2001 From: sagitaz Date: Wed, 6 May 2026 10:22:39 +0200 Subject: [PATCH 11/12] Add json events btn download --- core/ajax/frigate.ajax.php | 7 +++++++ core/class/frigate.class.php | 3 ++- core/class/frigate_events.class.php | 20 ++++++++++++++++---- desktop/js/frigate.js | 25 +++++++++++++++++++++++++ desktop/php/frigate.php | 5 +++++ docs/fr_FR/changelog.md | 5 ++++- plugin_info/info.json | 2 +- 7 files changed, 60 insertions(+), 7 deletions(-) diff --git a/core/ajax/frigate.ajax.php b/core/ajax/frigate.ajax.php index 848cb94c..eb336e5a 100644 --- a/core/ajax/frigate.ajax.php +++ b/core/ajax/frigate.ajax.php @@ -173,6 +173,13 @@ ajax::success(); } + if (init('action') == 'frigateDebug') { + $data = frigate_events::all(false, true); + ajax::success(array( + "object" => $data, + "json" => json_encode($data), + )); + } throw new Exception(__('Aucune méthode correspondante à', __FILE__) . ' : ' . init('action')); /* * *********Catch exeption*************** */ diff --git a/core/class/frigate.class.php b/core/class/frigate.class.php index c1011ce1..89a6e11b 100644 --- a/core/class/frigate.class.php +++ b/core/class/frigate.class.php @@ -302,7 +302,8 @@ public function postInsert() {} public function preUpdate() {} // Fonction exécutée automatiquement après la mise à jour de l'équipement - public function postUpdate() {} + public function postUpdate() { + } // Fonction exécutée automatiquement avant la sauvegarde (création ou mise à jour) de l'équipement public function preSave() diff --git a/core/class/frigate_events.class.php b/core/class/frigate_events.class.php index 6fa972a6..b4d070c5 100644 --- a/core/class/frigate_events.class.php +++ b/core/class/frigate_events.class.php @@ -57,14 +57,26 @@ class frigate_events /** * @throws Exception */ - public static function all(bool $_onlyEnable = FALSE) + public static function all(bool $_onlyEnable = FALSE, bool $_allType = FALSE) { - $sql = 'SELECT ' . DB::buildField(__CLASS__) . ' - FROM frigate_events - WHERE type IS NOT NULL'; + $sql = 'SELECT ' . DB::buildField(__CLASS__) . ' FROM frigate_events'; + $where = []; + + if (!$_allType) { + $where[] = 'type IS NOT NULL'; + } + if ($_onlyEnable) { + $where[] = 'enabled = 1'; + } + if (!empty($where)) { + $sql .= ' WHERE ' . implode(' AND ', $where); + } + return DB::Prepare($sql, array(), DB::FETCH_TYPE_ALL, PDO::FETCH_CLASS, __CLASS__); } + + /** * @throws Exception */ diff --git a/desktop/js/frigate.js b/desktop/js/frigate.js index d643b026..61436b44 100644 --- a/desktop/js/frigate.js +++ b/desktop/js/frigate.js @@ -690,6 +690,31 @@ document.getElementById('addCmdHttp').addEventListener('click', function () { }) }); +document.getElementById('frigateDebug').addEventListener('click', function () { + domUtils.ajax({ + type: "POST", + url: "plugins/frigate/core/ajax/frigate.ajax.php", + data: { + action: "frigateDebug", + data: { function: "getAllEvents" } + }, + dataType: 'json', + error: function (error) { + jeedomUtils.showAlert({ + message: error.message, + level: 'danger' + }); + }, + success: function (data) { + var json = data.result.json; + const blob = new Blob([json], { + type: "text/plain;charset=utf-8" + }); + saveAs(blob, "getAllEvents.json.txt"); + } + }) +}); + function editHTTP(cmd) { var id = cmd.id; // Récupère l'id var data = cmd.getAttribute('data-request'); // Récupère la valeur de data-request diff --git a/desktop/php/frigate.php b/desktop/php/frigate.php index 229f7da6..9226e5ae 100644 --- a/desktop/php/frigate.php +++ b/desktop/php/frigate.php @@ -67,6 +67,11 @@
{{Logs Frigate}}
+
+ +
+ {{Json}} +
>S'il n'y a pas d'information sur la mise à jour, c'est que celle-ci concerne uniquement de la mise à jour de documentation, de traduction ou de texte. -# 19/04/2026 Beta 1.5.4 +# 06/05/2026 Beta & Stable 1.5.4 +- nouveau bouton pour télécharger la liste des évènements (utile pour le debug dev) + +# 19/04/2026 Beta 1.5.3 - Correction du put curl pour l'activation et la désactivation des caméras via API # 13/04/2026 Beta 1.5.2 diff --git a/plugin_info/info.json b/plugin_info/info.json index 1267a5a1..6e979dd2 100644 --- a/plugin_info/info.json +++ b/plugin_info/info.json @@ -1,7 +1,7 @@ { "id": "frigate", "name": "Frigate", - "pluginVersion": "1.5.25", + "pluginVersion": "1.5.4", "installation": "Il est nécessaire d'avoir le plugin mqtt-manager installé avec un broker MQTT sécurisé (user / mdp) pour profiter de toutes les fonctionnalités. Dans le cas contraire, le plugin Frigate sera limité. Voir la documentation pour plus d'informations.", "description": { "fr_FR": "Plugin Frigate pour Jeedom. Ne fonctionne qu'avec les versions de Frigate > 0.13.0. Le plugin n'installe pas le serveur Frigate mais permet de le controler.", From afb5deddfeffeae27cfbb0e4b641459a719afb17 Mon Sep 17 00:00:00 2001 From: sagitaz Date: Wed, 6 May 2026 10:45:40 +0200 Subject: [PATCH 12/12] Construction du json --- core/ajax/frigate.ajax.php | 3 +- core/class/frigate.class.php | 65 +++++++++++++++++++++--------------- 2 files changed, 40 insertions(+), 28 deletions(-) diff --git a/core/ajax/frigate.ajax.php b/core/ajax/frigate.ajax.php index eb336e5a..d256d80f 100644 --- a/core/ajax/frigate.ajax.php +++ b/core/ajax/frigate.ajax.php @@ -174,7 +174,8 @@ } if (init('action') == 'frigateDebug') { - $data = frigate_events::all(false, true); + $data = frigate::showEvents(false, true); + ajax::success(array( "object" => $data, "json" => json_encode($data), diff --git a/core/class/frigate.class.php b/core/class/frigate.class.php index 89a6e11b..92abbea2 100644 --- a/core/class/frigate.class.php +++ b/core/class/frigate.class.php @@ -1678,44 +1678,55 @@ public static function deleteEvent($id, $all = false) log::add(__CLASS__, 'debug', "╚════════════════════════════════════════════════════════"); return "OK"; } - public static function showEvents() + public static function showEvents(bool $_onlyEnable = FALSE, bool $_allType = FALSE) { $result = []; - $events = frigate_events::all(); + + $events = frigate_events::all($_onlyEnable, $_allType); foreach ($events as $event) { $date = date("d-m-Y H:i:s", $event->getStartTime()); $duree = round($event->getEndTime() - $event->getStartTime(), 0); - $box = $event->getBox(); - $boxArray = is_array($box) ? $box : json_decode($box, true); $result[] = array( - "id" => $event->getId(), - "img" => $event->getLasted(), - "camera" => $event->getCamera(), - "label" => $event->getLabel(), - "box" => $boxArray, - "date" => $date, - "duree" => $duree, - "startTime" => $event->getStartTime(), - "endTime" => $event->getEndTime(), - "snapshot" => $event->getSnapshot(), - "clip" => $event->getClip(), - "thumbnail" => $event->getThumbnail(), - "hasSnapshot" => $event->getHasSnapshot(), - "hasClip" => $event->getHasClip(), - "eventId" => $event->getEventId(), - "score" => $event->getScore(), - "top_score" => $event->getTopScore(), - "type" => $event->getType(), - "isFavorite" => $event->getIsFavorite() ?? 0, - "zones" => $event->getZones() ?? '', - "description" => $event->getRecognition_description() + "id" => $event->getId(), + "eventId" => $event->getEventId(), + "img" => $event->getLasted(), + "camera" => $event->getCamera(), + "label" => $event->getLabel(), + "subLabel" => $event->getSubLabel(), + "box" => json_decode($event->getBox(), true), + "date" => $date, + "duree" => $duree, + "startTime" => $event->getStartTime(), + "endTime" => $event->getEndTime(), + "falsePositive" => $event->getFalsePositive(), + "snapshot" => $event->getSnapshot(), + "clip" => $event->getClip(), + "thumbnail" => $event->getThumbnail(), + "hasSnapshot" => $event->getHasSnapshot(), + "hasClip" => $event->getHasClip(), + "score" => $event->getScore(), + "top_score" => $event->getTopScore(), + "plusId" => $event->getPlusId(), + "retain" => $event->getRetain(), + "type" => $event->getType(), + "isFavorite" => $event->getIsFavorite() ?? 0, + "zones" => $event->getZones() ?? '', + "data" => $event->getData(), + "recognition_type" => $event->getRecognition_type(), + "description" => $event->getRecognition_description(), + "recognition_name" => $event->getRecognition_name(), + "recognition_subname" => $event->getRecognition_subname(), + "recognition_attributes" => $event->getRecognition_attributes(), + "recognition_plate" => $event->getRecognition_plate(), + "recognition_score" => $event->getRecognition_score() ); } - usort($result, [self::class, 'orderByDate']); - + if (!empty($result)) { + usort($result, 'frigate::orderByDate'); + } return $result; }