Zigbee : nombre d'attributs par requête

Bonjour,

Suite à une discussion sur le module Zlinky_TIC de lixee, certains utilisateurs (dont moi) n’ont pas de remontée automatique de l’attribut PTEC.

Il semblerait qu’au delà de 7 attributs passés dans la requête POST, le derniers ne soient pas pris en compte.

Voici l’analyse :

Voici ce qui est envoyé lors de l’exécution du cron

[2021-12-13 21:18:08]DEBUG : http://127.0.0.1:8089/device/attributes type : POST
[2021-12-13 21:18:08]DEBUG : {"ieee":"00:15:8d:00:05:be:7f:8c","endpoint":1,"cluster":1794,"cluster_type":"in","attributes":[0,256,258,260,262,264,266,32],"manufacturer":null,"allowCache":0}
[2021-12-13 21:18:08]DEBUG : [Garage][ZLinky_TIC] refresh
[2021-12-13 21:18:08]DEBUG : http://127.0.0.1:8089/device/attributes type : POST
[2021-12-13 21:18:08]DEBUG : {"ieee":"00:15:8d:00:05:be:7f:8c","endpoint":1,"cluster":65382,"cluster_type":"in","attributes":[1,2,4,5,6,7,8],"manufacturer":null,"allowCache":0}
[2021-12-13 21:18:08]DEBUG : [Garage][ZLinky_TIC] refresh
[2021-12-13 21:18:08]DEBUG : {"devices":{"00:15:8d:00:05:be:7f:8c":{"1":{"1794":{"0":{"value":"0","cluster_name":"ZLinkyTICMetering"},"256":{"value":"6595373","cluster_name":"ZLinkyTICMetering"},"258":{"value":"4090002","cluster_name":"ZLinkyTICMetering"},"260":{"value":"0","cluster_name":"ZLinkyTICMetering"},"262":{"value":"0","cluster_name":"ZLinkyTICMetering"},"264":{"value":"0","cluster_name":"ZLinkyTICMetering"},"266":{"value":"0","cluster_name":"ZLinkyTICMetering"}},"2820":{"1288":{"value":"1","cluster_name":"Electrical Measurement"},"1295":{"value":"340","cluster_name":"Electrical Measurement"},"2312":{"value":"65535","cluster_name":"Electrical Measurement"},"2568":{"value":"65535","cluster_name":"Electrical Measurement"},"1290":{"value":"90","cluster_name":"Electrical Measurement"},"2314":{"value":"65535","cluster_name":"Electrical Measurement"},"2570":{"value":"65535","cluster_name":"Electrical Measurement"},"1293":{"value":"-32768","cluster_name":"Electrical Measurement"}},"65382":{"1":{"value":"","cluster_name":"Manufacturer Specific"},"2":{"value":"0","cluster_name":"Manufacturer Specific"},"4":{"value":"0","cluster_name":"Manufacturer Specific"},"5":{"value":"0","cluster_name":"Manufacturer Specific"},"6":{"value":"0","cluster_name":"Manufacturer Specific"},"7":{"value":"0","cluster_name":"Manufacturer Specific"},"8":{"value":"0","cluster_name":"Manufacturer Specific"}}}}}}
[2021-12-13 21:18:08]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::1794::0 => 0 convert to 0
[2021-12-13 21:18:08]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::1794::256 => 6595373 convert to 6595373
[2021-12-13 21:18:08]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::1794::258 => 4090002 convert to 4090002
[2021-12-13 21:18:08]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::1794::260 => 0 convert to 0
[2021-12-13 21:18:08]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::1794::262 => 0 convert to 0
[2021-12-13 21:18:08]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::1794::264 => 0 convert to 0
[2021-12-13 21:18:08]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::1794::266 => 0 convert to 0
[2021-12-13 21:18:08]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::2820::1288 => 1 convert to 1
[2021-12-13 21:18:08]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::2820::1295 => 340 convert to 340
[2021-12-13 21:18:08]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::2820::2312 => 65535 convert to 65535
[2021-12-13 21:18:08]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::2820::2568 => 65535 convert to 65535
[2021-12-13 21:18:08]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::2820::1290 => 90 convert to 90
[2021-12-13 21:18:08]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::2820::2314 => 65535 convert to 65535
[2021-12-13 21:18:08]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::2820::2570 => 65535 convert to 65535
[2021-12-13 21:18:08]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::2820::1293 => -32768 convert to -32768
[2021-12-13 21:18:08]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::65382::1 =>  convert to
[2021-12-13 21:18:08]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::65382::2 => 0 convert to 0
[2021-12-13 21:18:08]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::65382::4 => 0 convert to 0
[2021-12-13 21:18:08]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::65382::5 => 0 convert to 0
[2021-12-13 21:18:08]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::65382::6 => 0 convert to 0
[2021-12-13 21:18:08]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::65382::7 => 0 convert to 0
[2021-12-13 21:18:08]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::65382::8 => 0 convert to 0

On observe ici que l’on demande le refresh de 8 champs [0,256,258,260,262,264,266,32]
et que l’on a le retour des 7 premiers uniquement. Et que le dernier est le 32 (le PTEC, celui qui nous intéresse ici)

Si l’on fait un appel via la procédure décrite plus haut (interrogation d’un seul attribut), on voit que l’on a bien un retour sur l’attribut 32

[2021-12-13 20:43:58]DEBUG : {"ieee":"00:15:8d:00:05:be:7f:8c","endpoint":1,"cluster":1794,"cluster_type":"in","attributes":[32],"allowCache":1,"manufacturer":null}
[2021-12-13 20:43:58]DEBUG : [{"32":"HP.."},[]]

J’ai essayé de trié dans l’ordre les id des attributs et je reçoit bien le résultat pour la 32 mais plus pour la 266 (la dernière).

J’en déduis donc que l’on ne peut pas demander l’actualisation de plus de 7 attributs par requêtes.

J’ai essayé de découper en plusieurs requêtes (par lots de 7)
Voici le résultat

[2021-12-13 21:34:07]DEBUG : http://127.0.0.1:8089/device/attributes type : POST
[2021-12-13 21:34:07]DEBUG : {"ieee":"00:15:8d:00:05:be:7f:8c","endpoint":1,"cluster":1794,"cluster_type":"in","attributes":[0,256,258,260,262,264,266],"allowCache":0}
[2021-12-13 21:34:07]DEBUG : [Garage][ZLinky_TIC] refresh
[2021-12-13 21:34:07]DEBUG : http://127.0.0.1:8089/device/attributes type : POST
[2021-12-13 21:34:07]DEBUG : {"ieee":"00:15:8d:00:05:be:7f:8c","endpoint":1,"cluster":1794,"cluster_type":"in","attributes":[32],"allowCache":0}
[2021-12-13 21:34:07]DEBUG : [Garage][ZLinky_TIC] refresh
[2021-12-13 21:34:07]DEBUG : http://127.0.0.1:8089/device/attributes type : POST
[2021-12-13 21:34:07]DEBUG : {"ieee":"00:15:8d:00:05:be:7f:8c","endpoint":1,"cluster":2820,"cluster_type":"in","attributes":[1288,1295,2312,2568,1290,2314,2570],"allowCache":0}
[2021-12-13 21:34:07]DEBUG : [Garage][ZLinky_TIC] refresh
[2021-12-13 21:34:07]DEBUG : http://127.0.0.1:8089/device/attributes type : POST
[2021-12-13 21:34:07]DEBUG : {"ieee":"00:15:8d:00:05:be:7f:8c","endpoint":1,"cluster":2820,"cluster_type":"in","attributes":[1293],"allowCache":0}
[2021-12-13 21:34:07]DEBUG : [Garage][ZLinky_TIC] refresh
[2021-12-13 21:34:07]DEBUG : http://127.0.0.1:8089/device/attributes type : POST
[2021-12-13 21:34:07]DEBUG : {"ieee":"00:15:8d:00:05:be:7f:8c","endpoint":1,"cluster":65382,"cluster_type":"in","attributes":[1,2,4,5,6,7,8],"allowCache":0}
[2021-12-13 21:34:07]DEBUG : [Garage][ZLinky_TIC] refresh
[2021-12-13 21:34:07]DEBUG : {"devices":{"00:15:8d:00:05:be:7f:8c":{"1":{"1794":{"0":{"value":"0","cluster_name":"ZLinkyTICMetering"},"256":{"value":"6595373","cluster_name":"ZLinkyTICMetering"},"258":{"value":"4090059","cluster_name":"ZLinkyTICMetering"},"260":{"value":"0","cluster_name":"ZLinkyTICMetering"},"262":{"value":"0","cluster_name":"ZLinkyTICMetering"},"264":{"value":"0","cluster_name":"ZLinkyTICMetering"},"266":{"value":"0","cluster_name":"ZLinkyTICMetering"},"32":{"value":"HP..","cluster_name":"ZLinkyTICMetering"}},"2820":{"1288":{"value":"1","cluster_name":"Electrical Measurement"},"1295":{"value":"320","cluster_name":"Electrical Measurement"},"2312":{"value":"65535","cluster_name":"Electrical Measurement"},"2568":{"value":"65535","cluster_name":"Electrical Measurement"},"1290":{"value":"90","cluster_name":"Electrical Measurement"},"2314":{"value":"65535","cluster_name":"Electrical Measurement"},"2570":{"value":"65535","cluster_name":"Electrical Measurement"},"1293":{"value":"-32768","cluster_name":"Electrical Measurement"}},"65382":{"1":{"value":"","cluster_name":"Manufacturer Specific"},"2":{"value":"0","cluster_name":"Manufacturer Specific"},"4":{"value":"0","cluster_name":"Manufacturer Specific"},"5":{"value":"0","cluster_name":"Manufacturer Specific"},"6":{"value":"0","cluster_name":"Manufacturer Specific"},"7":{"value":"0","cluster_name":"Manufacturer Specific"},"8":{"value":"0","cluster_name":"Manufacturer Specific"}}}}}}
[2021-12-13 21:34:07]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::1794::0 => 0 convert to 0
[2021-12-13 21:34:07]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::1794::256 => 6595373 convert to 6595373
[2021-12-13 21:34:07]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::1794::258 => 4090059 convert to 4090059
[2021-12-13 21:34:07]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::1794::260 => 0 convert to 0
[2021-12-13 21:34:07]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::1794::262 => 0 convert to 0
[2021-12-13 21:34:07]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::1794::264 => 0 convert to 0
[2021-12-13 21:34:07]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::1794::266 => 0 convert to 0
[2021-12-13 21:34:07]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::1794::32 => HP.. convert to HP..
[2021-12-13 21:34:07]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::2820::1288 => 1 convert to 1
[2021-12-13 21:34:07]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::2820::1295 => 320 convert to 320
[2021-12-13 21:34:07]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::2820::2312 => 65535 convert to 65535
[2021-12-13 21:34:07]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::2820::2568 => 65535 convert to 65535
[2021-12-13 21:34:07]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::2820::1290 => 90 convert to 90
[2021-12-13 21:34:07]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::2820::2314 => 65535 convert to 65535
[2021-12-13 21:34:07]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::2820::2570 => 65535 convert to 65535
[2021-12-13 21:34:07]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::2820::1293 => -32768 convert to -32768
[2021-12-13 21:34:07]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::65382::1 =>  convert to
[2021-12-13 21:34:07]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::65382::2 => 0 convert to 0
[2021-12-13 21:34:07]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::65382::4 => 0 convert to 0
[2021-12-13 21:34:07]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::65382::5 => 0 convert to 0
[2021-12-13 21:34:07]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::65382::6 => 0 convert to 0
[2021-12-13 21:34:07]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::65382::7 => 0 convert to 0
[2021-12-13 21:34:07]DEBUG : Search attribut for 00:15:8d:00:05:be:7f:8c logicalId : 1::65382::8 => 0 convert to 0

Les 2 requêtes partent : une de 7 attributs et une de 1 et nous avons bien le résultat.

La modification apportée concerne le fichier zigbee.class.php
ligne 1002

    foreach ($datas as $endpoint => $data) {
      foreach ($data as $cluster => $attributes) {
        foreach (array_chunk($attributes, 7) as $key => $chunk) {  
          try {
            zigbee::request($this->getConfiguration('instance', 1), '/device/attributes', array(
              'ieee' => $ieee,
              'endpoint' => $endpoint,
              'cluster' => $cluster,
              'cluster_type' => 'in',
              'attributes' => $chunk,
              'allowCache' => 0
            ), 'POST');

            log::add('zigbee', 'debug', $this->getHumanName() . ' refresh');
          } catch (\Exception $e) {
            log::add('zigbee', 'info', $this->getHumanName() . ' ' . $e->getMessage());
          }
      	}
      }
    }

Je suis en Jeedom 4.2.5, plugin Zigbee en beta et clé Conbee2

2 « J'aime »

Bonjour,

Merci beaucoup pour la correction ca sera dans la beta de demain. Je pense qu’il y a une limitation au niveau zigbee la dessus.

1 « J'aime »

Ce sujet a été automatiquement fermé après 24 heures suivant le dernier commentaire. Aucune réponse n’est permise dorénavant.