Skip to content

Commit

Permalink
Xiaomi sensor_86sw1/sw2 models update
Browse files Browse the repository at this point in the history
  • Loading branch information
tcharp38 committed Nov 26, 2023
1 parent 70b29de commit 8a9cf8b
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 36 deletions.
38 changes: 19 additions & 19 deletions core/class/AbeilleParser.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -5470,27 +5470,27 @@ function decode8100_8102($type, $dest, $payload, $lqi) {
// TEST END

// Xiaomi lumi.sensor_86sw1 (Wall 1 Switch sur batterie)
if (($attrId == "FF01") && ($attrSize == "001B")) {
parserLog("debug"," Xiaomi proprietary (Wall 1 Switch, Gaz Sensor)" );
parserLog("debug"," WARNING !! This support should be moved to decode8002");

// For info until activation
xiaomiDecodeTags($dest, $srcAddr, $clustId, $attrId, $Attribut);
// For info until activation

// Dans le cas du Gaz Sensor, il n'y a pas de batterie alors le decodage est probablement faux.
$voltage = hexdec(substr($payload, 24 + 2 * 2 + 2, 2).substr($payload, 24 + 2 * 2, 2));
$etat = substr($payload, 80, 2);
parserLog('debug', ' Voltage=' .$voltage.', Voltage%='.$this->volt2pourcent($voltage).', Etat=' .$etat);
$attrReportN = [
array( "name" => "0006-01-0000", "value" => $etat ),
// array( "name" => "0001-01-0020", "value" => $voltage / 1000 ),
array( "name" => "0001-01-0021", "value" => $this->volt2pourcent($voltage) ),
];
}
// if (($attrId == "FF01") && ($attrSize == "001B")) {
// parserLog("debug"," Xiaomi proprietary (Wall 1 Switch, Gaz Sensor)" );
// parserLog("debug"," WARNING !! This support should be moved to decode8002");

// // For info until activation
// xiaomiDecodeTags($dest, $srcAddr, $clustId, $attrId, $Attribut);
// // For info until activation

// // Dans le cas du Gaz Sensor, il n'y a pas de batterie alors le decodage est probablement faux.
// $voltage = hexdec(substr($payload, 24 + 2 * 2 + 2, 2).substr($payload, 24 + 2 * 2, 2));
// $etat = substr($payload, 80, 2);
// parserLog('debug', ' Voltage=' .$voltage.', Voltage%='.$this->volt2pourcent($voltage).', Etat=' .$etat);
// $attrReportN = [
// array( "name" => "0006-01-0000", "value" => $etat ),
// // array( "name" => "0001-01-0020", "value" => $voltage / 1000 ),
// array( "name" => "0001-01-0021", "value" => $this->volt2pourcent($voltage) ),
// ];
// }

// Xiaomi bouton Aqara Wireless Switch V3 #712 (https://github.com/KiwiHC16/Abeille/issues/712)
else if (($attrId == 'FF01') && ($attrSize == "0026")) {
if (($attrId == 'FF01') && ($attrSize == "0026")) {
// Assuming $dataType == "42"
parserLog('debug', ' Xiaomi proprietary (Aqara Wireless Switch V3)');
parserLog("debug"," WARNING !! This support should be moved to decode8002");
Expand Down
2 changes: 1 addition & 1 deletion core/config/commands/etatSwitchDouble_1.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"etatSwitchDouble_1": {
"comment": "OBSOLETE: Do not use",
"isVisible": 1,
"name": "etat1",
"isHistorized": "1",
"subType": "binary",
"invertBinary": "0",
"template": "",
Expand Down
22 changes: 17 additions & 5 deletions core/config/devices/sensor_86sw1/sensor_86sw1.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"sensor_86sw1": {
"manufacturer": "Xiaomi",
"model": "WXKG03LM",
"type": "Xiaomi single rocker switch",
"timeout": "60",
"configuration": {
"mainEP": "01",
Expand All @@ -10,16 +12,26 @@
"category": {
"automatism": "1"
},
"type": "Xiaomi Interrupteur Carr\u00e9 simple",
"commands": {
"etat": {
"use": "etatSwitchSimple"
"Battery-Volt": {
"use": "inf_batteryVoltAndPercent-285-300"
},
"Battery-Percent": {
"use": "inf_zbAttr-0001-BatteryPercent"
},
"SWBuildID": {
"use": "inf_zbAttr-0000-SWBuildID"
"Status": {
"use": "etatSwitchSimple"
}
},
"xiaomi": {
"fromDevice": {
"0000-FF01": {
"01-21": {
"func": "numberDiv",
"div": 1000,
"info": "0001-01-0020"
}
}
}
}
}
Expand Down
32 changes: 22 additions & 10 deletions core/config/devices/sensor_86sw2/sensor_86sw2.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"sensor_86sw2": {
"manufacturer": "Xiaomi",
"model": "WXKG02LM",
"type": "Xiaomi double rocker switch",
"alternateIds": {
"sensor_86sw2.es1": {}
},
"timeout": "60",
"comment": "Remonte le nom lumi.sensor_86sw2 apres association et lumi.sensor_86sw2Un sur un getName EP 01 donc les deux fichiers doivent \u00eatre identiques.",
"configuration": {
Expand All @@ -11,8 +16,13 @@
"category": {
"automatism": "1"
},
"type": "Xiaomi Interrupteur Mural Carr\u00e9 Double",
"commands": {
"Battery-Volt": {
"use": "inf_batteryVoltAndPercent-285-300"
},
"Battery-Percent": {
"use": "inf_zbAttr-0001-BatteryPercent"
},
"etat1": {
"use": "etatSwitchDouble_1"
},
Expand All @@ -21,15 +31,17 @@
},
"etat3": {
"use": "etatSwitchDouble_3"
},
"Battery-Volt": {
"use": "inf_zbAttr-0001-BatteryVolt"
},
"Battery-Percent": {
"use": "inf_zbAttr-0001-BatteryPercent"
},
"SWBuildID": {
"use": "inf_zbAttr-0000-SWBuildID"
}
},
"xiaomi": {
"fromDevice": {
"0000-FF01": {
"01-21": {
"func": "numberDiv",
"div": 1000,
"info": "0001-01-0020"
}
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion desktop/modal/AbeilleNetwork.modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function displayNetworks($nbOfZigates, $what="linksTable", $mode="") {
position: absolute;
}

#idLinksGraphTabSVG >svg {
#idLinksGraphTabSVG {
height: 100%;
width: 100%
}
Expand Down
2 changes: 2 additions & 0 deletions docs/fr_FR/Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ ChangeLog
- eTRV0103: Mise-à-jour du modèle.
- Legrand micromodule switch: Mise-à-jour du modèle (2663).
- Tuya double dimmer module QS-Zigbee-D02-TRIAC-2C-LN: Ajout support préliminaire (2664).
- Assistant modèle: Améliorations.
- Xiaomi wall switch sensor_86sw1 & sensor_86sw2: Support+modeles revus.

231124-BETA-2
-------------
Expand Down

0 comments on commit 8a9cf8b

Please sign in to comment.