KiwiHC16 / Abeille

Abeille pour Jeedom (Gateway ZiGate)
GNU Affero General Public License v3.0
60 stars 52 forks source link

[KiwiHC16] Integration prise Aqara Smart Plug EU : consommation ne remonte pas dans l eq. #2671

Closed KiwiHC16 closed 6 months ago

KiwiHC16 commented 6 months ago

Suite de #2670

KiwiHC16 commented 6 months ago
[2023-12-05 18:58:56] Abeille1, Type=8002/Data indication, Status=00, ProfId=0104, ClustId=FCC0, SrcEP=01, DstEP=01, SrcAddrMode=02, SrcAddr=1785, DstAddrMode=02, DstAddr=0000
[2023-12-05 18:58:56]   FCF=1C/General/Serv->Cli/ManufCode=115F, SQN=17, cmd=0A/Report attributes
[2023-12-05 18:58:56]   Model with 'private' entry
[2023-12-05 18:58:56]   clustId/attrId=FCC0/00F7 vs pKey=FCC0-00F7, len=9
[2023-12-05 18:58:56]   Private={"type":"xiaomi","64-10":{"func":"raw","info":"0006-01-0000"},"95-39":{"func":"raw","info":"0702-01-0000"}}
[2023-12-05 18:58:56]   AttrId=00F7, AttrType=41
[2023-12-05 18:58:56]     Tag=64, Type=10/bool => 1 ==> 0006-01-0000=01
[2023-12-05 18:58:56]     Tag=03, Type=28/int8 => 22 (ignored)
[2023-12-05 18:58:56]     Tag=98, Type=39/single => 16.75 (ignored)
[2023-12-05 18:58:56]     Tag=95, Type=39/single => 0.053616724908352 ==> 0702-01-0000=3D5B9D36
[2023-12-05 18:58:56]     Tag=96, Type=39/single => 2240 (ignored)
[2023-12-05 18:58:56]     Tag=97, Type=39/single => 74.776786804199 (ignored)
[2023-12-05 18:58:56]     Tag=05, Type=21/uint16 => 8 (ignored)
[2023-12-05 18:58:56]     Tag=9A, Type=20/uint8 => 16 (ignored)
[2023-12-05 18:58:56]     Tag=08, Type=21/uint16 => 299 (ignored)
[2023-12-05 18:58:56]     Tag=09, Type=21/uint16 => 256 (ignored)
[2023-12-05 18:58:56]     Tag=0B, Type=20/uint8 => 0 (ignored)
[2023-12-05 18:58:56]     Tag=9B, Type=10/bool => 1 (ignored)
[2023-12-05 18:58:56]     Tag=0A, Type=21/uint16 => 0 (ignored)
[2023-12-05 18:58:56]     Tag=0C, Type=20/uint8 => 1 (ignored)

Capture d’écran 2023-12-07 à 15 17 48

Pourquoi 0.053616724908352 devient 3kWh ?

Event log:

[2023-12-05 18:58:56][INFO] : Evènement sur la commande [Home][Xiaomi Aqara EU smart plug - 65][Consommation] valeur : 3KWh
KiwiHC16 commented 6 months ago

Capture d’écran 2023-12-07 à 15 18 32

KiwiHC16 commented 6 months ago
$valueHex = AbeilleTools::reverseHex($valueHex);
$value = AbeilleParser::decodeDataType($valueHex, $typeId, false, 0, $dataSize, $valueHex);
KiwiHC16 commented 6 months ago

case "39": // Single precision

$value = AbeilleParser::hexValueToFloat($hs);

tcharp38 commented 6 months ago

Ca c'est débile

[2023-12-05 18:58:56]     Tag=95, Type=39/single => 0.053616724908352 ==> 0702-01-0000=3D5B9D36

Je creuse

tcharp38 commented 6 months ago

Suis con.. met "number" à la place de "raw". Ca devrait le faire. "raw" ca veut dire qu'on prend la donnée brute telle qu'elle est sans chercher à l'interpreter

        "FCC0-00F7": {
            "type": "xiaomi",
            "64-10": {
                "func": "raw", => A MODIFIER
                "info": "0006-01-0000"
            },
            "95-39": {
                "func": "raw",  => A MODIFIER
                "info": "0702-01-0000"
            }
KiwiHC16 commented 6 months ago

Pushed d une correction.