jeedom-zigate / jeedom-plugin-zigate

Plugin Jeedom for ZiGate key.
MIT License
29 stars 12 forks source link

lumi.sensor_switch.aq2 : aucun évènement déclenché #165

Open hexfred opened 5 years ago

hexfred commented 5 years ago

Description du bug J'ai inclus sur ma zigate un bouton Xiaomi lumi.sensor_switch.aq2. L'ensemble des commandes a bien été créé :

Lorsque je presse le bouton physique, l'état des commandes onoff et multiclick ne change pas de valeur (il reste vide en cliquant sur le bouton test, et rien n'apparait sur le graphique dans Analyse / Historique). En comparant avec un capteur d'ouverture de porte de cette même marque, l'état onoff passe de 0 à 1 et vice versa en fonction de l'ouverture de la porte. Si je crée donc un scénario déclenché par l'évènement onoff ou multiclick de ce bouton, rien ne se passe.

Fonctionnement attendu Changement de la valeur onoff ou multiclick des commandes de cet objet.

Screenshots Voici le log zigate en mode debug qui apparait lorsque je presse sur le bouton physique :

[2019-03-09 17:50:49][DEBUG][zigate](ZiGate-Listen) : Raw packet received, b"\x01\x81\x02\x12\x02\x10#4\x1d\xde4\x02\x11\x02\x10\x02\x10\x02\x10\x02\x15\x02\x10B\x02\x10\x16lumi.sensor_switch.aq2W\x03\x01\x81\x02\x12\x02\x10'\xbb\x1d\xde4\x02\x11\x02\x10\x02\x10\xff\x02\x11\x02\x10B\x02\x10\x1a\x02\x11!\xc7\x02\x1b\x02\x13(\x1d\x02\x14!\xa8\x13\x02\x15!q\x02\x10\x02\x16$\x02\x10\x02\x10\x02\x10\x02\x10\x02\x10\x02\x1a!\x02\x10\x02\x10W\x03"
[2019-03-09 17:50:49][DEBUG][zigate](ZiGate-Event Loop) : Dispatch ZIGATE_PACKET_RECEIVED
[2019-03-09 17:50:49][DEBUG][zigate](ZiGate-Decode data) : Received response 0x8102: b'1dde340100000005004200166c756d692e73656e736f725f7377697463682e617132'
[2019-03-09 17:50:49][DEBUG][zigate](ZiGate-Event Loop) : Dispatch ZIGATE_PACKET_RECEIVED
[2019-03-09 17:50:49][DEBUG][zigate](ZiGate-Decode data) : RESPONSE 0x8102 - Individual Attribute Report : sequence:29, addr:de34, endpoint:1, cluster:0, attribute:5, status:0, data_type:66, size:22, data:lumi.sensor_switch.aq2, lqi:87
[2019-03-09 17:50:49][DEBUG][zigate](ZiGate-Decode data) : Received response 0x8102: b'1dde34010000ff010042001a0121c70b03281d0421a81305217100062400000000000a210000'
[2019-03-09 17:50:49][DEBUG][zigate](ZiGate-Decode data) : Dispatch ZIGATE_ATTRIBUTE_UPDATED
[2019-03-09 17:50:49][DEBUG][zigate](ZiGate-Decode data) : RESPONSE 0x8102 - Individual Attribute Report : sequence:29, addr:de34, endpoint:1, cluster:0, attribute:65281, status:0, data_type:66, size:26, data:0121c70b03281d0421a81305217100062400000000000a210000, lqi:87
[2019-03-09 17:50:49][DEBUG][root](ZiGate-Decode data) : External command ZIGATE_ATTRIBUTE_UPDATED : {'device': LUMI lumi.sensor_switch.aq2 (de34) 00158d0002136960, 'zigate': <zigate.core.ZiGate object at 0x769a9a90>, 'attribute': {'addr': 'de34', 'value': 'lumi.sensor_switch.aq2', 'data': 'lumi.sensor_switch.aq2', 'type': <class 'str'>, 'attribute': 5, 'endpoint': 1, 'name': 'type', 'cluster': 0}}
[2019-03-09 17:50:49][DEBUG][zigate](ZiGate-Decode data) : Dispatch ZIGATE_ATTRIBUTE_UPDATED
[2019-03-09 17:50:49][DEBUG][zigate](ZiGate-Decode data) : Dispatch ZIGATE_RESPONSE_RECEIVED
[2019-03-09 17:50:49][DEBUG][root](ZiGate-Decode data) : External command ZIGATE_ATTRIBUTE_UPDATED : {'device': LUMI lumi.sensor_switch.aq2 (de34) 00158d0002136960, 'zigate': <zigate.core.ZiGate object at 0x769a9a90>, 'attribute': {'addr': 'de34', 'value': 3.015, 'data': '0121c70b03281d0421a81305217100062400000000000a210000', 'unit': 'V', 'type': <class 'float'>, 'attribute': 65281, 'endpoint': 1, 'name': 'battery_voltage', 'cluster': 0}}
[2019-03-09 17:50:49][DEBUG][zigate](ZiGate-Decode data) : Dispatch ZIGATE_RESPONSE_RECEIVED
[2019-03-09 17:50:50][DEBUG][root](Thread-1) : Send to jeedom :  {'device': LUMI lumi.sensor_switch.aq2 (de34) 00158d0002136960, 'attribute': {'addr': 'de34', 'value': 'lumi.sensor_switch.aq2', 'data': 'lumi.sensor_switch.aq2', 'type': <class 'str'>, 'attribute': 5, 'endpoint': 1, 'name': 'type', 'cluster': 0}, 'action': 'ZIGATE_ATTRIBUTE_UPDATED'}
[2019-03-09 17:50:50][DEBUG][requests.packages.urllib3.connectionpool](Thread-1) : Starting new HTTP connection (1): 127.0.0.1
[2019-03-09 18:50:50][DEBUG] : Array (     [device] => Array         (             [addr] => de34             [generictype] => sensor             [info] => Array                 (                     [addr] => de34                     [ieee] => 00158d0002136960                     [mac_capability] => 10000000                     [lqi] => 87                     [last_seen] => 2019-03-09 17:50:49                     [bit_field] => 0100000000000010                     [manufacturer_code] => 1037                     [server_mask] => 0                     [descriptor_capability] => 00000000                     [power_type] => 0                 )              [discovery] => templated             [endpoints] => Array                 (                     [0] => Array                         (                             [device] => 24321                             [clusters] => Array                                 (                                     [0] => Array                                         (                                             [attributes] => Array                                                 (                                                     [0] => Array                                                         (                                                             [attribute] => 1                                                             [value] => 3                                                             [data] => 3                                                             [name] => application_version                                                         )                                                      [1] => Array                                                         (                                                             [value] => LUMI                                                             [data] => LUMI                                                             [attribute] => 4                                                             [name] => manufacturer                                                         )                                                      [2] => Array                                                         (                                                             [value] => lumi.sensor_switch.aq2                                                             [data] => lumi.sensor_switch.aq2                                                             [type] => str                                                             [attribute] => 5                                                             [name] => type                                                         )                                                      [3] => Array                                                         (                                                             [value] => 3.015                                                             [attribute] => 65281                                                             [unit] => V                                                             [type] => float                                                             [data] => 0121c70b03281d0421a81305217100062400000000000a210000                                                             [name] => battery_voltage                                                         )                                                  )                                              [cluster] => 0                                         )                                      [1] => Array                                         (                                             [attributes] => Array                                                 (                                                     [0] => Array                                                         (                                                             [type] => bool                                                             [inverse] => 1                                                             [value] =>                                                              [attribute] => 0                                                             [name] => onoff                                                         )                                                      [1] => Array                                                         (                                                             [type] => int                                                             [expire] => 2                                                             [value] => 0                                                             [attribute] => 32768                                                             [name] => multiclick                                                         )                                                  )                                              [cluster] => 6                                         )                                  )                              [out_clusters] => Array                                 (                                     [0] => 0                                     [1] => 4                                     [2] => 65535                                 )                              [profile] => 260                             [in_clusters] => Array                                 (                                     [0] => 0                                     [1] => 65535                                     [2] => 6                                 )                              [endpoint] => 1                         )                  )          )      [attribute] => Array         (             [addr] => de34             [value] => lumi.sensor_switch.aq2             [data] => lumi.sensor_switch.aq2             [type] => str             [attribute] => 5             [endpoint] => 1             [name] => type             [cluster] => 0         )      [action] => ZIGATE_ATTRIBUTE_UPDATED )
[2019-03-09 18:50:50][DEBUG] : create command 1.0.5
[2019-03-09 17:50:50][DEBUG][requests.packages.urllib3.connectionpool](Thread-1) : http://127.0.0.1:80 "POST /plugins/zigate/core/php/jeeZiGate.php?apikey=XXXXXXXXXXXXXXXXX HTTP/1.1" 200 16
[2019-03-09 17:50:50][DEBUG][root](Thread-1) : Jeedom reply :  {'success': True}
[2019-03-09 17:50:50][DEBUG][root](Thread-1) : Send to jeedom :  {'device': LUMI lumi.sensor_switch.aq2 (de34) 00158d0002136960, 'attribute': {'addr': 'de34', 'value': 3.015, 'data': '0121c70b03281d0421a81305217100062400000000000a210000', 'unit': 'V', 'type': <class 'float'>, 'attribute': 65281, 'endpoint': 1, 'name': 'battery_voltage', 'cluster': 0}, 'action': 'ZIGATE_ATTRIBUTE_UPDATED'}
[2019-03-09 17:50:50][DEBUG][requests.packages.urllib3.connectionpool](Thread-1) : Starting new HTTP connection (1): 127.0.0.1
[2019-03-09 18:50:50][DEBUG] : Array (     [device] => Array         (             [addr] => de34             [generictype] => sensor             [info] => Array                 (                     [addr] => de34                     [ieee] => 00158d0002136960                     [mac_capability] => 10000000                     [lqi] => 87                     [last_seen] => 2019-03-09 17:50:49                     [bit_field] => 0100000000000010                     [manufacturer_code] => 1037                     [server_mask] => 0                     [descriptor_capability] => 00000000                     [power_type] => 0                 )              [discovery] => templated             [endpoints] => Array                 (                     [0] => Array                         (                             [device] => 24321                             [clusters] => Array                                 (                                     [0] => Array                                         (                                             [attributes] => Array                                                 (                                                     [0] => Array                                                         (                                                             [attribute] => 1                                                             [value] => 3                                                             [data] => 3                                                             [name] => application_version                                                         )                                                      [1] => Array                                                         (                                                             [value] => LUMI                                                             [data] => LUMI                                                             [attribute] => 4                                                             [name] => manufacturer                                                         )                                                      [2] => Array                                                         (                                                             [value] => lumi.sensor_switch.aq2                                                             [data] => lumi.sensor_switch.aq2                                                             [type] => str                                                             [attribute] => 5                                                             [name] => type                                                         )                                                      [3] => Array                                                         (                                                             [value] => 3.015                                                             [attribute] => 65281                                                             [unit] => V                                                             [type] => float                                                             [data] => 0121c70b03281d0421a81305217100062400000000000a210000                                                             [name] => battery_voltage                                                         )                                                  )                                              [cluster] => 0                                         )                                      [1] => Array                                         (                                             [attributes] => Array                                                 (                                                     [0] => Array                                                         (                                                             [type] => bool                                                             [inverse] => 1                                                             [value] =>                                                              [attribute] => 0                                                             [name] => onoff                                                         )                                                      [1] => Array                                                         (                                                             [type] => int                                                             [expire] => 2                                                             [value] => 0                                                             [attribute] => 32768                                                             [name] => multiclick                                                         )                                                  )                                              [cluster] => 6                                         )                                  )                              [out_clusters] => Array                                 (                                     [0] => 0                                     [1] => 4                                     [2] => 65535                                 )                              [profile] => 260                             [in_clusters] => Array                                 (                                     [0] => 0                                     [1] => 65535                                     [2] => 6                                 )                              [endpoint] => 1                         )                  )          )      [attribute] => Array         (             [addr] => de34             [value] => 3.015             [data] => 0121c70b03281d0421a81305217100062400000000000a210000             [unit] => V             [type] => float             [attribute] => 65281             [endpoint] => 1             [name] => battery_voltage             [cluster] => 0         )      [action] => ZIGATE_ATTRIBUTE_UPDATED )
[2019-03-09 18:50:50][DEBUG] : create command 1.0.65281
[2019-03-09 17:50:50][DEBUG][requests.packages.urllib3.connectionpool](Thread-1) : http://127.0.0.1:80 "POST /plugins/zigate/core/php/jeeZiGate.php?apikey=XXXXXXXXXXXXXXXXX HTTP/1.1" 200 16
[2019-03-09 17:50:50][DEBUG][root](Thread-1) : Jeedom reply :  {'success': True}

Informations:

Merci par avance pour votre support !

Deepcore93 commented 5 years ago

Salut,

Etrange, ca marche bien chez moi.

Comment est réglé ton scenario ? Tu peux mettre des screens

EDIT : il semble effectivement avoir un problème avec le onoff (pas le multiclick chez moi), la remontée 'on' (soit 1) est aléatoire sous Jeedom, alors que l’évènement du click est bien détecté et remonté dans les logs.

hexfred commented 5 years ago

Bonjour Deepcore93,

J'ai créé mon scenario de test comme suit : image image

Je viens de refaire mes tests avec un second bouton lumi.sensor_switch.aq2 Avec ce dernier tout semble fonctionner correctement. Le scénario est bien déclenché en multiclick (Edit: sauf de temps en temps), et le scénario est bien déclenché en onoff si j'adapte le scenario sur l'évènement onoff.

Par contre, avec le premier bouton physique, cela ne fonctionne jamais. ni sur onoff, ni en multiclick. Et pourtant j'ai bien le log zigate lorsque je presse sur le bouton.

hexfred commented 5 years ago

Je viens de voir deux comportements différents dans le log zigate. Quand je presse sur le bouton qui ne fonctionne pas, j'ai les deux lignes suivantes :

[DEBUG] : create command 1.0.5
[DEBUG] : create command 1.0.65281

Quand je presse sur le bouton qui fonctionne j'ai les deux lignes suivantes :

[DEBUG] : create command 1.6.0
[DEBUG] : create command 1.6.0

Je ne sais pas interpréter ces deux différences (différence de valeurs et différence entre les deux lignes)

hexfred commented 5 years ago

Petite information supplémentaire : Pour le bouton qui fonctionne, j'ai deux déclenchements de scénario à chaque pression sur le bouton.

------------------------------------
[2019-03-10 21:40:05][SCENARIO] Start : Scenario execute automatiquement sur evenement venant de : [Rez-de-chaussee][Bouton2][onoff].
[2019-03-10 21:40:05][SCENARIO] Exécution du sous-élément de type [action] : action
[2019-03-10 21:40:05][SCENARIO] Exécution de la commande [Rez-de-chaussée][Lumières séjour][Off]
[2019-03-10 21:40:05][SCENARIO] Fin correcte du scénario
------------------------------------
[2019-03-10 21:40:05][SCENARIO] Start : Scenario execute automatiquement sur evenement venant de : [Rez-de-chaussee][Bouton2][onoff].
[2019-03-10 21:40:05][SCENARIO] Exécution du sous-élément de type [action] : action
[2019-03-10 21:40:05][SCENARIO] Exécution de la commande [Rez-de-chaussée][Lumières séjour][Off]
[2019-03-10 21:40:05][SCENARIO] Fin correcte du scénario

Du coup, le titre de mon issue est complètement faux pour ce bouton ;-) Par contre, pour ce bouton qui fonctionne, ce double déclenchement de scénario sur le onoff n'est pas vraiment pratique.

Le titre de l'issue reste vrai pour le premier bouton qui ne déclenche jamais le scénario, même si j'ai du log en debug sur le plugin zigate qui montre bien l'événement. Je suis perdu, mais je continue à chercher...

smulle48 commented 5 years ago

To be able to catch the change of the onoff you have to run the scenario in “mode synchrone” or else the button return to it’ original state before Jeedom gets informed about the change.

Try holding the button pressed, then you should be able the see the value change

hexfred commented 5 years ago

Hi smulle48, I've enabled the mode synchrone, but the scenario is still called twice after each button pressed, according to the scenario log.

------------------------------------
[2019-03-13 20:41:39][SCENARIO] Lancement du scénario en mode synchrone
[2019-03-13 20:41:39][SCENARIO] Start : Scénario exécuté automatiquement sur événement venant de : [Rez-de-chaussée][Bouton2][onoff].
[2019-03-13 20:41:39][SCENARIO] Exécution du sous-élément de type [action] : action
[2019-03-13 20:41:39][SCENARIO] Exécution de la commande [Rez-de-chaussée][Lampe bureau][Off]
[2019-03-13 20:41:39][SCENARIO] Fin correcte du scénario
------------------------------------
[2019-03-13 20:41:39][SCENARIO] Lancement du scénario en mode synchrone
[2019-03-13 20:41:39][SCENARIO] Start : Scénario exécuté automatiquement sur événement venant de : [Rez-de-chaussée][Bouton2][onoff].
[2019-03-13 20:41:39][SCENARIO] Exécution du sous-élément de type [action] : action
[2019-03-13 20:41:39][SCENARIO] Exécution de la commande [Rez-de-chaussée][Lampe bureau][Off]
[2019-03-13 20:41:39][SCENARIO] Fin correcte du scénario
smulle48 commented 5 years ago

Hi smulle48, I've enabled the mode synchrone, but the scenario is still called twice after each button pressed, according to the scenario log.

------------------------------------
[2019-03-13 20:41:39][SCENARIO] Lancement du scénario en mode synchrone
[2019-03-13 20:41:39][SCENARIO] Start : Scénario exécuté automatiquement sur événement venant de : [Rez-de-chaussée][Bouton2][onoff].
[2019-03-13 20:41:39][SCENARIO] Exécution du sous-élément de type [action] : action
[2019-03-13 20:41:39][SCENARIO] Exécution de la commande [Rez-de-chaussée][Lampe bureau][Off]
[2019-03-13 20:41:39][SCENARIO] Fin correcte du scénario
------------------------------------
[2019-03-13 20:41:39][SCENARIO] Lancement du scénario en mode synchrone
[2019-03-13 20:41:39][SCENARIO] Start : Scénario exécuté automatiquement sur événement venant de : [Rez-de-chaussée][Bouton2][onoff].
[2019-03-13 20:41:39][SCENARIO] Exécution du sous-élément de type [action] : action
[2019-03-13 20:41:39][SCENARIO] Exécution de la commande [Rez-de-chaussée][Lampe bureau][Off]
[2019-03-13 20:41:39][SCENARIO] Fin correcte du scénario

As the multiclick can be anything between 2 to 4, you have to define the value, that the scenario has to "listen" to.

In your case it will be something like this:

The first page (Général) it correct.

On your Scénario page you have to add an IF-THEN block like this:

[Rez-de-chaussée][Bouton2][multiclick]# == 2

2 meaning the scenario listen only for 2 multiclick.

And then you add the action:

[Rez-de-chaussée][Lampe Entrée][Off]

I hope it makes sense :-D Skærmbillede 2019-03-13 kl  21 05 36

hexfred commented 5 years ago

Yes it make sense ! Thanks. I will try with the multi click event. But today my scenario is configured with the one-off event, and the scenario is started twice each time I'm pressing the button with this on-off event.

smulle48 commented 5 years ago

Yes it make sense ! Thanks. I will try with the multi click event. But today my scenario is configured with the one-off event, and the scenario is started twice each time I'm pressing the button with this on-off event.

This is my scenario. I use the button as an doorbell (Dørklokke) in my hallway (Gang). It then trigger my z-wave siren. I'm just listening to the value change on the 1 click. The 1 click is not an "real" on/off switch. It just switch from 1 to 0 when held down, and switch back to 1 when you release the button. Skærmbillede 2019-03-13 kl  21 29 02 Skærmbillede 2019-03-13 kl  21 29 12

Remeber, you can't mix onoff and multiclick, so you can't use onoff as an trigger and then using the multiclick as an IF-THEN trigger.

hexfred commented 5 years ago

Thanks to your answer I can indeed understand what is happening. When I press the button, I receive two events:

Now I've to understand why my first button doesn't work. I've the log in the zigate log file when I'm pressing the button, but the scenario is not triggered...

smulle48 commented 5 years ago

Thanks to your answer I can indeed understand what is happening. When I press the button, I receive two events:

  • [Rez-de-chaussée][Bouton2][onoff]# change from 0 to 1

  • [Rez-de-chaussée][Bouton2][onoff]# change immediately from 1 to 0

    So I've updated as you have suggested my scenario with a if #[Rez-de-chaussée][Bouton2][onoff]#==1 then.... (I think you have invert the onoff value in the equipment command configuration). My scenario is now executed only once each time I'm pressing my button. Thanks again for your support.

Now I've to understand why my first button doesn't work. I've the log in the zigate log file when I'm pressing the button, but the scenario is not triggered...

You are welcome. Yeah, I think I inverted the value on my button, because else it would show an X instead of an V on the dashboard when not triggered. As long as you use the first value change (in your case 1) as the IF-THEN trigger, you are good to go :-D

How does your scenario for your first button look like? :-D

hexfred commented 5 years ago

It is exactly the same scenario image image

When I press this button, nothing happen in the /var/www/html/log/scenarioLog/ log files

But I got this in the /var/www/html/log/zigate (debug mode):

[2019-03-13 20:56:22][DEBUG][zigate](Thread-1424) : Auto saving /var/www/html/plugins/zigate/core/class/../../resources/zigated/zigate.json
[2019-03-13 20:56:22][DEBUG][zigate](Thread-1424) : Saving persistent file
[2019-03-13 20:56:22][DEBUG][zigate](Thread-1424) : File already existing, make a backup before
[2019-03-13 20:56:23][DEBUG][zigate](ZiGate-Listen) : Raw packet received, b"\x01\x81\x02\x12\x02\x10#X\xa2\xde4\x02\x11\x02\x10\x02\x10\x02\x10\x02\x15\x02\x10B\x02\x10\x16lumi.sensor_switch.aq2\x84\x03\x01\x81\x02\x12\x02\x10'\xac\xa2\xde4\x02\x11\x02\x10\x02\x10\xff\x02\x11\x02\x10B\x02\x10\x1a\x02\x11!\xbd\x02\x1b\x02\x13(\x1c\x02\x14!\xa8\x13\x02\x15!q\x02\x10\x02\x16$\x02\x10\x02\x10\x02\x10\x02\x10\x02\x10\x02\x1a!\x02\x10\x02\x10\x84\x03"
[2019-03-13 20:56:23][DEBUG][zigate](ZiGate-Event Loop) : Dispatch ZIGATE_PACKET_RECEIVED
[2019-03-13 20:56:23][DEBUG][zigate](ZiGate-Decode data) : Received response 0x8102: b'a2de340100000005004200166c756d692e73656e736f725f7377697463682e617132'
[2019-03-13 20:56:23][DEBUG][zigate](ZiGate-Event Loop) : Dispatch ZIGATE_PACKET_RECEIVED
[2019-03-13 20:56:23][DEBUG][zigate](ZiGate-Decode data) : RESPONSE 0x8102 - Individual Attribute Report : sequence:162, addr:de34, endpoint:1, cluster:0, attribute:5, status:0, data_type:66, size:22, data:lumi.sensor_switch.aq2, lqi:132
[2019-03-13 20:56:23][DEBUG][zigate](ZiGate-Decode data) : Received response 0x8102: b'a2de34010000ff010042001a0121bd0b03281c0421a81305217100062400000000000a210000'
[2019-03-13 20:56:23][DEBUG][zigate](ZiGate-Decode data) : Dispatch ZIGATE_ATTRIBUTE_UPDATED
[2019-03-13 20:56:23][DEBUG][zigate](ZiGate-Decode data) : RESPONSE 0x8102 - Individual Attribute Report : sequence:162, addr:de34, endpoint:1, cluster:0, attribute:65281, status:0, data_type:66, size:26, data:0121bd0b03281c0421a81305217100062400000000000a210000, lqi:132
[2019-03-13 20:56:23][DEBUG][root](ZiGate-Decode data) : External command ZIGATE_ATTRIBUTE_UPDATED : {'device': LUMI lumi.sensor_switch.aq2 (de34) 00158d0002136960, 'zigate': <zigate.core.ZiGate object at 0x769a9a90>, 'attribute': {'addr': 'de34', 'value': 'lumi.sensor_switch.aq2', 'data': 'lumi.sensor_switch.aq2', 'type': <class 'str'>, 'attribute': 5, 'endpoint': 1, 'name': 'type', 'cluster': 0}}
[2019-03-13 20:56:23][DEBUG][zigate](ZiGate-Decode data) : Dispatch ZIGATE_ATTRIBUTE_UPDATED
[2019-03-13 20:56:23][DEBUG][zigate](ZiGate-Decode data) : Dispatch ZIGATE_RESPONSE_RECEIVED
[2019-03-13 20:56:23][DEBUG][root](ZiGate-Decode data) : External command ZIGATE_ATTRIBUTE_UPDATED : {'device': LUMI lumi.sensor_switch.aq2 (de34) 00158d0002136960, 'zigate': <zigate.core.ZiGate object at 0x769a9a90>, 'attribute': {'addr': 'de34', 'value': 3.005, 'data': '0121bd0b03281c0421a81305217100062400000000000a210000', 'unit': 'V', 'type': <class 'float'>, 'attribute': 65281, 'endpoint': 1, 'name': 'battery_voltage', 'cluster': 0}}
[2019-03-13 20:56:23][DEBUG][zigate](ZiGate-Decode data) : Dispatch ZIGATE_RESPONSE_RECEIVED
[2019-03-13 20:56:23][DEBUG][root](Thread-1) : Send to jeedom :  {'device': LUMI lumi.sensor_switch.aq2 (de34) 00158d0002136960, 'attribute': {'addr': 'de34', 'value': 'lumi.sensor_switch.aq2', 'data': 'lumi.sensor_switch.aq2', 'type': <class 'str'>, 'attribute': 5, 'endpoint': 1, 'name': 'type', 'cluster': 0}, 'action': 'ZIGATE_ATTRIBUTE_UPDATED'}
[2019-03-13 20:56:23][DEBUG][requests.packages.urllib3.connectionpool](Thread-1) : Starting new HTTP connection (1): 127.0.0.1
[2019-03-13 21:56:23][DEBUG] : Array (     [device] => Array         (             [addr] => de34             [generictype] => sensor             [info] => Array                 (                     [addr] => de34                     [ieee] => 00158d0002136960                     [mac_capability] => 10000000                     [lqi] => 132                     [last_seen] => 2019-03-13 20:56:23                     [bit_field] => 0100000000000010                     [manufacturer_code] => 1037                     [server_mask] => 0                     [descriptor_capability] => 00000000                     [power_type] => 0                 )              [discovery] => templated             [endpoints] => Array                 (                     [0] => Array                         (                             [device] => 24321                             [clusters] => Array                                 (                                     [0] => Array                                         (                                             [attributes] => Array                                                 (                                                     [0] => Array                                                         (                                                             [attribute] => 1                                                             [value] => 3                                                             [data] => 3                                                             [name] => application_version                                                         )                                                      [1] => Array                                                         (                                                             [value] => LUMI                                                             [data] => LUMI                                                             [attribute] => 4                                                             [name] => manufacturer                                                         )                                                      [2] => Array                                                         (                                                             [value] => lumi.sensor_switch.aq2                                                             [data] => lumi.sensor_switch.aq2                                                             [type] => str                                                             [attribute] => 5                                                             [name] => type                                                         )                                                      [3] => Array                                                         (                                                             [value] => 3.005                                                             [attribute] => 65281                                                             [unit] => V                                                             [type] => float                                                             [data] => 0121bd0b03281c0421a81305217100062400000000000a210000                                                             [name] => battery_voltage                                                         )                                                  )                                              [cluster] => 0                                         )                                      [1] => Array                                         (                                             [attributes] => Array                                                 (                                                     [0] => Array                                                         (                                                             [type] => bool                                                             [inverse] => 1                                                             [value] =>                                                              [attribute] => 0                                                             [name] => onoff                                                         )                                                      [1] => Array                                                         (                                                             [type] => int                                                             [expire] => 2                                                             [value] => 0                                                             [attribute] => 32768                                                             [name] => multiclick                                                         )                                                  )                                              [cluster] => 6                                         )                                  )                              [out_clusters] => Array                                 (                                     [0] => 0                                     [1] => 4                                     [2] => 65535                                 )                              [profile] => 260                             [in_clusters] => Array                                 (                                     [0] => 0                                     [1] => 65535                                     [2] => 6                                 )                              [endpoint] => 1                         )                  )          )      [attribute] => Array         (             [addr] => de34             [value] => lumi.sensor_switch.aq2             [data] => lumi.sensor_switch.aq2             [type] => str             [attribute] => 5             [endpoint] => 1             [name] => type             [cluster] => 0         )      [action] => ZIGATE_ATTRIBUTE_UPDATED )
[2019-03-13 21:56:23][DEBUG] : create command 1.0.5
[2019-03-13 20:56:24][DEBUG][requests.packages.urllib3.connectionpool](Thread-1) : http://127.0.0.1:80 "POST /plugins/zigate/core/php/jeeZiGate.php?apikey=XXXXXXXXXXXXX HTTP/1.1" 200 16
[2019-03-13 20:56:24][DEBUG][root](Thread-1) : Jeedom reply :  {'success': True}
[2019-03-13 20:56:24][DEBUG][root](Thread-1) : Send to jeedom :  {'device': LUMI lumi.sensor_switch.aq2 (de34) 00158d0002136960, 'attribute': {'addr': 'de34', 'value': 3.005, 'data': '0121bd0b03281c0421a81305217100062400000000000a210000', 'unit': 'V', 'type': <class 'float'>, 'attribute': 65281, 'endpoint': 1, 'name': 'battery_voltage', 'cluster': 0}, 'action': 'ZIGATE_ATTRIBUTE_UPDATED'}
[2019-03-13 20:56:24][DEBUG][requests.packages.urllib3.connectionpool](Thread-1) : Starting new HTTP connection (1): 127.0.0.1
[2019-03-13 21:56:24][DEBUG] : Array (     [device] => Array         (             [addr] => de34             [generictype] => sensor             [info] => Array                 (                     [addr] => de34                     [ieee] => 00158d0002136960                     [mac_capability] => 10000000                     [lqi] => 132                     [last_seen] => 2019-03-13 20:56:23                     [bit_field] => 0100000000000010                     [manufacturer_code] => 1037                     [server_mask] => 0                     [descriptor_capability] => 00000000                     [power_type] => 0                 )              [discovery] => templated             [endpoints] => Array                 (                     [0] => Array                         (                             [device] => 24321                             [clusters] => Array                                 (                                     [0] => Array                                         (                                             [attributes] => Array                                                 (                                                     [0] => Array                                                         (                                                             [attribute] => 1                                                             [value] => 3                                                             [data] => 3                                                             [name] => application_version                                                         )                                                      [1] => Array                                                         (                                                             [value] => LUMI                                                             [data] => LUMI                                                             [attribute] => 4                                                             [name] => manufacturer                                                         )                                                      [2] => Array                                                         (                                                             [value] => lumi.sensor_switch.aq2                                                             [data] => lumi.sensor_switch.aq2                                                             [type] => str                                                             [attribute] => 5                                                             [name] => type                                                         )                                                      [3] => Array                                                         (                                                             [value] => 3.005                                                             [attribute] => 65281                                                             [unit] => V                                                             [type] => float                                                             [data] => 0121bd0b03281c0421a81305217100062400000000000a210000                                                             [name] => battery_voltage                                                         )                                                  )                                              [cluster] => 0                                         )                                      [1] => Array                                         (                                             [attributes] => Array                                                 (                                                     [0] => Array                                                         (                                                             [type] => bool                                                             [inverse] => 1                                                             [value] =>                                                              [attribute] => 0                                                             [name] => onoff                                                         )                                                      [1] => Array                                                         (                                                             [type] => int                                                             [expire] => 2                                                             [value] => 0                                                             [attribute] => 32768                                                             [name] => multiclick                                                         )                                                  )                                              [cluster] => 6                                         )                                  )                              [out_clusters] => Array                                 (                                     [0] => 0                                     [1] => 4                                     [2] => 65535                                 )                              [profile] => 260                             [in_clusters] => Array                                 (                                     [0] => 0                                     [1] => 65535                                     [2] => 6                                 )                              [endpoint] => 1                         )                  )          )      [attribute] => Array         (             [addr] => de34             [value] => 3.005             [data] => 0121bd0b03281c0421a81305217100062400000000000a210000             [unit] => V             [type] => float             [attribute] => 65281             [endpoint] => 1             [name] => battery_voltage             [cluster] => 0         )      [action] => ZIGATE_ATTRIBUTE_UPDATED )
[2019-03-13 21:56:24][DEBUG] : create command 1.0.65281
[2019-03-13 20:56:24][DEBUG][requests.packages.urllib3.connectionpool](Thread-1) : http://127.0.0.1:80 "POST /plugins/zigate/core/php/jeeZiGate.php?apikey=XXXXXXXXXXXXX HTTP/1.1" 200 16
[2019-03-13 20:56:24][DEBUG][root](Thread-1) : Jeedom reply :  {'success': True}
hexfred commented 5 years ago

Just one more think: If I test the onoff value in the bouton1 commands panel, its value is empty. If I test the onoff value in the bouton2 commands panel, its value is 0.

smulle48 commented 5 years ago

Have the bouton1 worked before?

Mine did the same after updating the firmware to 3.0f I then reset my button (holding the tiny sync button at lease 5 seconds) then Nettoyer (the shower icon) and then include again before my button started sending data again.

hexfred commented 5 years ago

This button has never worked. After the upgrade to firmware 3.0f, I've erased the PDM, and include again all my Xiaomi equipment. I've reset this button multiple times too but without any benefits. I see all events (ZIGATE_PACKET_RECEIVED, ZIGATE_ATTRIBUTE_UPDATED, etc) in the zigate log file, but it doesn't trigger any event in jeedom.

doudz commented 5 years ago

I have some problem with that button too, the problem is events are too fast, it send ON and OFF at the same time so it works only from time to time On Home Assistant we have a workaround, it's possible to trigger an automation (like Scenario) on event rather than device state. I don't know if something like that exists on Jeedom

smulle48 commented 5 years ago

@doudz

As long as you run the scenario in synchrone mode it’s catching the state change. If not in synchrone, Jeedom adds an Pause in the scenario to not overburden Jeedom and that’s why it only catch the last state

smulle48 commented 5 years ago

@hexfred

Does the multiclick work on that button?

Think you might have an defect button. The switch state is only a small part of the complete message send to zigate so if the buttons firmware for some reason don’t change the value from 1 to 0 you won’t get it working

hexfred commented 5 years ago

Same behavior for the multiclick than for the onoff. And I've just tried to reset this button, to cleanup and then include it again : no change. Maybe that indeed this button is defective.

doudz commented 5 years ago

But if you see ZIGATE_ATTRIBUTE_UPDATED in log, your button is working

smulle48 commented 5 years ago

@doudz

Yeah, but it is not reporting the Button change

doudz commented 5 years ago

If there's ZIGATE_ATTRIBUTE_UPDATED in log, the button is working and the daemon is working too so the problem is on the Jeedom part of the plugin Since the event is really fast, maybe the Jeedom part of the plugin is working too but Jeedom is unable to handle it. So we have to find a way to use it

smulle48 commented 5 years ago

@doudz

Maybe I’m just blind, but should the button state not be part of the log message?