diff --git a/core/class/AbeilleCmdQueue.class.php b/core/class/AbeilleCmdQueue.class.php index f04d06b68..e9c4ff777 100755 --- a/core/class/AbeilleCmdQueue.class.php +++ b/core/class/AbeilleCmdQueue.class.php @@ -438,7 +438,7 @@ function processCmdQueues() { // Reminder for status: ''=unsent, 'SENT'=already sent $sentPri = $zg['sentPri']; $sentIdx = $zg['sentIdx']; - if (isset($zg['cmdQueue'][$sentPri]) && (count($zg['cmdQueue'][$sentPri]) != 0) && ($zg['cmdQueue'][$sentPri][$sentIdx]['status'] != '')) { + if (isset($zg['cmdQueue'][$sentPri]) && isset($zg['cmdQueue'][$sentPri][$sentIdx]) && ($zg['cmdQueue'][$sentPri][$sentIdx]['status'] != '')) { // There is a command under execution $cmd = $zg['cmdQueue'][$sentPri][$sentIdx]; $timeout = $cmd['timeout']; diff --git a/core/class/AbeilleParser.class.php b/core/class/AbeilleParser.class.php index f3b5ab286..f425c2775 100755 --- a/core/class/AbeilleParser.class.php +++ b/core/class/AbeilleParser.class.php @@ -3608,10 +3608,9 @@ function decode8002($dest, $payload, $lqi) { // // $pl = ''; // Full payload treated // } - // Philips Hue specific cluster - // Used by RWL021, RDM001 - // Tcharp38: Where is the source of this decoding ? - // else if ($clustId == "FC00") { + // FC00 private cluster + // Used by Philips Hue on RWL021, RDM001 + // Used by Nodon at least on SIN-4-FP-21 if ($clustId == "FC00") { $buttonEventTxt = array ( '00' => 'Short press', @@ -3622,14 +3621,16 @@ function decode8002($dest, $payload, $lqi) { $button = $attrId; // $buttonEvent = substr($payload, 24 + 2, 2); $buttonEvent = substr($pl, 0 + 2, 2); + if (isset($buttonEventTxt[$buttonEvent])) + $buttonEventTxt = $buttonEventTxt[$buttonEvent]; + else + $buttonEventTxt = "?"; // $buttonDuree = hexdec(substr($payload, 24 + 6, 2)); $buttonDuree = hexdec(substr($pl, 0 + 6, 2)); - parserLog2("debug", $srcAddr, " TOBEREVISITED: Philips Hue proprietary: Button=".$button.", Event=".$buttonEvent." (".$buttonEventTxt[$buttonEvent]."), duration=".$buttonDuree); + parserLog2("debug", $srcAddr, " TOBEREVISITED: Philips Hue proprietary: Button=".$button.", Event=".$buttonEvent."/".$buttonEventTxt."), duration=".$buttonDuree); - $attrReportN[] = [ - array( "name" => $clustId."-".$ep."-".$attrId."-Event", "value" => $buttonEvent ), - array( "name" => $clustId."-".$ep."-".$attrId."-Duree", "value" => $buttonDuree ), - ]; + $attrReportN[] = array( "name" => $clustId."-".$srcEp."-".$attrId."-Event", "value" => $buttonEvent ); + $attrReportN[] = array( "name" => $clustId."-".$srcEp."-".$attrId."-Duree", "value" => $buttonDuree ); } // End cluster FC00 // Attribute value post correction according to ZCL spec diff --git a/core/config/commands/inf_zbAttr-0702-InstantaneousDemand.json b/core/config/commands/inf_zbAttr-0702-InstantaneousDemand.json new file mode 100644 index 000000000..210e0e36b --- /dev/null +++ b/core/config/commands/inf_zbAttr-0702-InstantaneousDemand.json @@ -0,0 +1,15 @@ +{ + "inf_zbAttr-0702-InstantaneousDemand": { + "comment": "InstantaneousDemand, attribute 0400, int24 => dataType = ?", + "subType": "numeric", + "template": "badge", + "genericType": "POWER", + "configuration": { + "calculValueOffset": "#value#/#DIV#", + "historizeRound": 3 + }, + "type": "info", + "logicalId": "0702-#EP#-0400", + "unit": "KWh" + } +} \ No newline at end of file diff --git a/core/config/devices/SIN-4-FP-21_NodOn/SIN-4-FP-21_NodOn.json b/core/config/devices/SIN-4-FP-21_NodOn/SIN-4-FP-21_NodOn.json index cd6902442..5e5e975fb 100644 --- a/core/config/devices/SIN-4-FP-21_NodOn/SIN-4-FP-21_NodOn.json +++ b/core/config/devices/SIN-4-FP-21_NodOn/SIN-4-FP-21_NodOn.json @@ -26,40 +26,6 @@ "use": "act_zbCmdC-Identify", "nextLine": "after" }, - "On": { - "use": "act_zbCmdC-0006-On", - "params": "ep=01", - "isVisible": "1" - }, - "Off": { - "use": "act_zbCmdC-0006-Off", - "params": "ep=01", - "isVisible": "1" - }, - "Toggle": { - "use": "act_zbCmdC-0006-Toggle", - "params": "ep=01" - }, - "Get Status": { - "use": "act_zbReadAttribute", - "params": "ep=01&clustId=0006&attrId=0000" - }, - "Status": { - "use": "inf_zbAttr-0006-OnOff", - "params": "ep=01", - "isVisible": "1", - "nextLine": "after" - }, - "Bind 01-0006-ToZigate": { - "use": "act_zbBindToZigate", - "params": "ep=01&clustId=0006", - "execAtCreation": "yes" - }, - "SetReporting 01-0006-0000": { - "use": "act_zbConfigureReporting2", - "params": "ep=01&clustId=0006&attrId=0000&attrType=10", - "execAtCreation": "yes" - }, "Mode": { "use": "act_zbCmdC-Generic", "params": "clustId=FC00&cmd=00&manufCode=128B&data=#select#", @@ -68,14 +34,10 @@ "valueOffset": "#valueformat-%02X#", "comment": "Formatting properly data to 2 hex chars", "value": "Current", - "trigOut": { - "getCurrentMode": {} - }, "isVisible": 1 }, "Get current mode": { "use": "act_zbReadAttribute", - "logicalId": "getCurrentMode", "params": "clustId=FC00&attrId=0000&attrType=20&manufId=128B", "execAtCreation": "yes" }, @@ -94,21 +56,38 @@ "logicalId": "currentMode", "isVisible": 1, "nextLine": "after" + }, + "Bind 01-FC00-ToZigate": { + "use": "act_zbBindToZigate", + "params": "ep=01&clustId=FC00", + "execAtCreation": "yes" }, "SetReporting 01-FC00-0000": { "use": "act_zbConfigureReporting2", "params": "ep=01&clustId=FC00&attrId=0000&attrType=20&manufCode=128B", "execAtCreation": "yes" }, + "Get Total power": { + "use": "act_zbReadAttribute", + "params": "clustId=0702&attrId=0000", + "execAtCreation": "yes" + }, + "Power": { + "use": "inf_zbAttr-0702-InstantaneousDemand", + "params": "div=1000", + "unit": "KWh", + "isVisible": "1" + }, "Total power": { "use": "inf_zbAttr-0702-CurrentSummationDelivered", "params": "div=1000", "unit": "KWh", "isVisible": "1" }, - "Get Total power": { - "use": "act_zbReadAttribute", - "params": "clustId=0702&attrId=0000" + "Bind 01-0702-ToZigate": { + "use": "act_zbBindToZigate", + "params": "ep=01&clustId=0702", + "execAtCreation": "yes" } } } diff --git a/core/php/AbeilleZigbeeConst.php b/core/php/AbeilleZigbeeConst.php index 94492defb..02c1fb001 100644 --- a/core/php/AbeilleZigbeeConst.php +++ b/core/php/AbeilleZigbeeConst.php @@ -815,6 +815,9 @@ function zbGetZDPStatus($status) { "0302" => array( "name" => "Divisor", "access" => "R" ), "0303" => array( "name" => "SummationFormatting", "access" => "R", "dataType" => 0x18 ), // map8 "0306" => array( "name" => "MeteringDeviceType", "access" => "R", "dataType" => 0x18 ), // map8 + + // Historical Consumption Attribute + "0400" => array( "name" => "InstantaneousDemand", "access" => "R", "dataType" => 0x2A ), // int24 ), // Commands received: none // Commands generated diff --git a/docs/fr_FR/Changelog.md b/docs/fr_FR/Changelog.md index d0870476b..b6ea7e2e4 100644 --- a/docs/fr_FR/Changelog.md +++ b/docs/fr_FR/Changelog.md @@ -7,6 +7,7 @@ - Amélioration modèles: Ajout support '#valueFormat-XXX#' pour formatter la valeur d'une commande. - Amélioration interne: check_json - Nettoyage modèles: Suppression support '#cmdInfo*XXX*#' (remplacé par '#logicidXX#') +- Amélioration NodOn SIN-4-FP-21: Mise-à-jour du modèle. ## 241008-BETA-1