Skip to content

Commit

Permalink
SIN-4-FP-21 + zigbee 0702-0400 + some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tcharp38 committed Oct 10, 2024
1 parent cfe14fd commit b75aa89
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 51 deletions.
2 changes: 1 addition & 1 deletion core/class/AbeilleCmdQueue.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down
19 changes: 10 additions & 9 deletions core/class/AbeilleParser.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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
Expand Down
15 changes: 15 additions & 0 deletions core/config/commands/inf_zbAttr-0702-InstantaneousDemand.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
61 changes: 20 additions & 41 deletions core/config/devices/SIN-4-FP-21_NodOn/SIN-4-FP-21_NodOn.json
Original file line number Diff line number Diff line change
Expand Up @@ -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#",
Expand All @@ -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"
},
Expand All @@ -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"
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions core/php/AbeilleZigbeeConst.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions docs/fr_FR/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b75aa89

Please sign in to comment.