Skip to content

Commit

Permalink
Merge pull request #58 from jmvedrine/dogcat
Browse files Browse the repository at this point in the history
Detction Chien/Chat et colonne Etat dans onglet Commandes
  • Loading branch information
Jezza34000 authored Jun 21, 2024
2 parents 0069fcb + bb8e425 commit 44f3597
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,14 @@ Les options correspondent aux paramètres que vous avez dans : Réglages > Syst
- [ ] Planning Sensibilité (cameras AI **ET** non-AI)
- [x] Sensibilité Detection intelligente Personne **(cameras AI)**
- [x] Sensibilité Detection intelligente Véhicule **(cameras AI)**
- [x] Sensibilité Detection intelligente Chien/Chat **(cameras AI)**
- [x] Delai d'alarme Personne **(cameras AI)**
- [x] Delai d'alarme Véhicule **(cameras AI)**
- [x] Delai d'alarme Chien/Chat **(cameras AI)**
- [ ] Dimension d'objet Personne **(cameras AI)**
- [ ] Dimension d'objet Véhicule **(cameras AI)**
- [ ] Dimension d'objet Chien/Chat **(cameras AI)**

**NB :** Le detection des animaux n'est pas pris en charge par le plugin (Detection en béta actuellement)

#### OSD
- [x] Afficher/Masquer Watermark
Expand Down
4 changes: 4 additions & 0 deletions core/class/reolink.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,10 @@ public static function refreshNFO($id) {
$s1 = 'SetSdSensitivityVehicleState';
$s2 = 'SetAlarmDelayVehicleState';
break;
case "dog_cat":
$s1 = 'SetSdSensitivityDogCatState';
$s2 = 'SetAlarmDelayDogCatState';
break;
}
$camcmd->checkAndUpdateCmd($s1, $json_data['value']['AiAlarm']['sensitivity']);
$camcmd->checkAndUpdateCmd($s2, $json_data['value']['AiAlarm']['stay_time']);
Expand Down
63 changes: 63 additions & 0 deletions core/config/reolinkapicmd.json
Original file line number Diff line number Diff line change
Expand Up @@ -1846,6 +1846,37 @@
"isVisible": 1,
"logicalId": "SetSdSensitivityVehicle"
},
{
"abilityneed":"supportAiSensitivity",
"iastate":1,
"name": "Sensibilité Detection DogCat (valeur)",
"type": "info",
"subtype": "numeric",
"configuration": {
"payload": "{\"cmd\":\"GetAiAlarm\",\"action\":0,\"param\":{\"channel\":#CHANNEL#,\"ai_type\":\"dog_cat\"}}"
},
"IsHistorized": 0,
"isVisible": 0,
"logicalId": "SetSdSensitivityDogCatState"
},
{
"abilityneed":"supportAiSensitivity",
"iastate":1,
"name": "Sensibilité Detection DogCat",
"type": "action",
"subtype": "slider",
"configuration": {
"option": "slider",
"minValue": 0,
"maxValue" : 100,
"valueFrom" : "SetSdSensitivityDogCatState",
"actionapi": "SetAiAlarm",
"payload": "{\"AiAlarm\":{\"channel\":#CHANNEL#,\"sensitivity\":#OPTSLIDER#,\"ai_type\":\"dog_cat\"}}"
},
"IsHistorized": 0,
"isVisible": 1,
"logicalId": "SetSdSensitivityDogCat"
},
{
"abilityneed":"supportAiStayTime",
"iastate":1,
Expand Down Expand Up @@ -1910,6 +1941,38 @@
"isVisible": 1,
"logicalId": "SetAlarmDelayVehicle"
},
{
"abilityneed":"supportAiStayTime",
"iastate":1,
"name": "Délai Alarme DogCat (valeur)",
"type": "info",
"subtype": "numeric",
"Unite": "s",
"configuration": {
"payload": "{\"cmd\":\"GetAiAlarm\",\"action\":0,\"param\":{\"channel\":#CHANNEL#,\"ai_type\":\"dog_cat\"}}"
},
"IsHistorized": 0,
"isVisible": 0,
"logicalId": "SetAlarmDelayDogCatState"
},
{
"abilityneed":"supportAiStayTime",
"iastate":1,
"name": "Délai Alarme DogCat",
"type": "action",
"subtype": "slider",
"configuration": {
"option": "slider",
"minValue": 0,
"maxValue" : 8,
"valueFrom" : "SetAlarmDelayDogCatState",
"actionapi": "SetAiAlarm",
"payload": "{\"AiAlarm\":{\"channel\":#CHANNEL#,\"stay_time\":#OPTSLIDER#,\"ai_type\":\"dog_cat\"}}"
},
"IsHistorized": 0,
"isVisible": 1,
"logicalId": "SetAlarmDelayDogCat"
},
{
"abilityneed":"ptzPreset",
"iastate":1,
Expand Down
3 changes: 2 additions & 1 deletion core/php/jeeReolink.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@
if (isset($res[0]['value'])) {
$eqLogic->checkAndUpdateCmd('EvPeopleDetect', $res[0]['value']['people']['alarm_state']);
$eqLogic->checkAndUpdateCmd('EvVehicleDetect', $res[0]['value']['vehicle']['alarm_state']);
$eqLogic->checkAndUpdateCmd('EvDogCatDetect', $res[0]['value']['dog_cat']['alarm_state']);
}
log::add('reolink', 'debug', 'Cam AI : Evènements Motion | Personne : ' . $res[0]['value']['people']['alarm_state'] . ' / Vehicule : ' . $res[0]['value']['vehicle']['alarm_state']);
log::add('reolink', 'debug', 'Cam AI : Evènements Motion | Personne : ' . $res[0]['value']['people']['alarm_state'] . ' / Vehicule : ' . $res[0]['value']['vehicle']['alarm_state'] . ' / Chien/Chat : ' . $res[0]['value']['dog_cat']['alarm_state']);
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions desktop/js/reolink.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ function addCmdToTable(_cmd) {
tr += '<label class="checkbox-inline"><input type="checkbox" class="cmdAttr" data-l1key="isHistorized" checked/>{{Historiser}}</label>';
tr += '<label class="checkbox-inline"><input type="checkbox" class="cmdAttr" data-l1key="display" data-l2key="invertBinary"/>{{Inverser}}</label>';
tr += '</td>';
tr += '<td>';
tr += '<span class="cmdAttr" data-l1key="htmlstate"></span>';
tr += '</td>';
tr += '<td style="min-width:80px;width:200px;">';
if (is_numeric(_cmd.id)) {
tr += '<a class="btn btn-default btn-xs cmdAction" data-action="configure"><i class="fas fa-cogs"></i></a> ';
Expand Down
1 change: 1 addition & 0 deletions desktop/php/reolink.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@
<th>{{Type}}</th>
<th>{{Paramètres}}</th>
<th>{{Options}}</th>
<th>{{Etat}}</th>
<th>{{Action}}</th>
</tr>
</thead>
Expand Down

0 comments on commit 44f3597

Please sign in to comment.