Skip to content

Commit

Permalink
Info 0201-EP-0000 predivided by 100 following ZCL spec
Browse files Browse the repository at this point in the history
  • Loading branch information
tcharp38 committed Dec 1, 2023
1 parent bb4ff3c commit d445335
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/class/AbeilleParser.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1920,6 +1920,10 @@ function decode8002_ZCLCorrectAttrValue($ep, $clustId, $eq, &$attr) {
} else if ($attrId == "0021") {
$newVal = $newVal / 2; // Battery percent
}
} else if ($clustId == "0201") { // Thermostat
if ($attrId == "0000") {
$newVal /= 100; // Temperature
}
} else if ($clustId == "0300") {
if ($attrId == "0007") {
// Color temperature in kelvins = 1,000,000 / ColorTemperatureMireds
Expand Down Expand Up @@ -3358,7 +3362,7 @@ function decode8002($dest, $payload, $lqi) {
break; // Stop decode there

// Attribute value post correction according to ZCL spec
$correct = ['0001-0020', '0001-0021', '0300-0007', '0400-0000', '0402-0000', '0403-0000', '0405-0000'];
$correct = ['0001-0020', '0001-0021', '0201-0000', '0300-0007', '0400-0000', '0402-0000', '0403-0000', '0405-0000'];
if (in_array($clustId.'-'.$attr['id'], $correct))
$this->decode8002_ZCLCorrectAttrValue($srcEp, $clustId, $eq, $attr);

Expand Down Expand Up @@ -3579,7 +3583,7 @@ function decode8002($dest, $payload, $lqi) {
break;

// Attribute value post correction according to ZCL spec
$correct = ['0001-0020', '0001-0021', '0300-0007', '0400-0000', '0402-0000', '0403-0000', '0405-0000'];
$correct = ['0001-0020', '0001-0021', '0201-0000', '0300-0007', '0400-0000', '0402-0000', '0403-0000', '0405-0000'];
if (in_array($clustId.'-'.$attr['id'], $correct))
$this->decode8002_ZCLCorrectAttrValue($srcEp, $clustId, $eq, $attr);

Expand Down
1 change: 1 addition & 0 deletions docs/fr_FR/Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ChangeLog
- Page EQ/avancé: Traductions US.
- Modèles: Nettoyage 'poll=0'
- Modèles: Amélioration 'trigOut' pour support multiples actions.
- Attribut 0000/LocalTemp du cluster 0201 divisé par 100 par défaut.

231130-BETA-2
-------------
Expand Down
5 changes: 5 additions & 0 deletions plugin_info/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,11 @@ function updateConfigDB() {
log::add('Abeille', 'debug', " ${cmdHName}: Added 'repeatEventManagement'='always'");
$saveCmd = true;
}
// '0201-#EP#-0000': Removing 'calculValueOffset'
} else if (preg_match("/^0201-[0-9A-F]*-0000/", $cmdLogicId)) {
$cmdLogic->setConfiguration('calculValueOffset', null);
log::add('Abeille', 'debug', " ${cmdHName}: Removed 'calculValueOffset'");
$saveCmd = true;
} else if ($topic == 'OnOff') {
$request = $cmdLogic->getConfiguration('request', '');
$request = str_replace("Action=Off", "cmd=00", $request);
Expand Down

0 comments on commit d445335

Please sign in to comment.