Zigbee2Tasmota MQTT button integration

I have OpenHab 3.3.0 and recently started to test Zigbee2Tasmota installed over a Sonoff ZBBridge Pro.
I Use MQTT to receive data from sensors, and I have some doubt regarding a Xiaomi Aqara button.
It is paired with Zigbee2Tasmota and I receive data into my MQTT Broker.
I receive some data and I do not know how to receive it and fire some rules.

Here is what I receive via MQTT on varius action:

1 Click

00:49:50.518 MQT: tele/ZigbeeBridge/087F/SENSOR = {"ZbReceived":{"0x087F":{"Device":"0x087F","Power":0,"Endpoint":1,"LinkQuality":225}}}
00:49:50.915 MQT: tele/ZigbeeBridge/087F/SENSOR = {"ZbReceived":{"0x087F":{"Device":"0x087F","Power":1,"Endpoint":1,"LinkQuality":211}}}

2 Click

00:50:25.782 MQT: tele/ZigbeeBridge/087F/SENSOR = {"ZbReceived":{"0x087F":{"Device":"0x087F","Power":2,"Endpoint":1,"LinkQuality":222}}}

3 Click

00:50:55.446 MQT: tele/ZigbeeBridge/087F/SENSOR = {"ZbReceived":{"0x087F":{"Device":"0x087F","Power":3,"Endpoint":1,"LinkQuality":218}}}

4 Click

00:50:51.940 MQT: tele/ZigbeeBridge/087F/SENSOR = {"ZbReceived":{"0x087F":{"Device":"0x087F","Power":4,"Endpoint":1,"LinkQuality":222}}}

Long Press

00:51:42.356 MQT: tele/ZigbeeBridge/087F/SENSOR = {"ZbReceived":{"0x087F":{"Device":"0x087F","Power":0,"Endpoint":1,"LinkQuality":211}}}
00:51:43.758 MQT: tele/ZigbeeBridge/087F/SENSOR = {"ZbReceived":{"0x087F":{"Device":"0x087F","Power":1,"Endpoint":1,"LinkQuality":211}}}

As you can see there is a difference from 1 click and other Action, instead for long press there is only more delay between 2 events

How can I convert this behaviour into a rule?


Search the forum for ‘hold release’. I’m not sure what you’re going to accomplish, but Light control (on/off/brightness/color temp/color change) using Ikea Styrbar wireless remote might come close.

Ikea exmple is not fit to me, in that case is the button that send hold status, not openhab. My button does not send hold status, but 2 MQTT message with different timing.


To me it looks like Power:0 is hold and a subsequent Power:1 is release - assuming that your log for ‘1 Click’ is a hold/release sequence and a log for a real ‘1 Click’ (Power:1 without a preceding Power:0) is missing - I might be wrong though.

Hi, Hold and relesase and One Click, send same log but with different timing.
I don’t know how detect this with openhab


Manufacturer, model no., … of your DUT?

Button is a Xiaomi Button, not Aqara, the round one.

Zigbee gateway is Zigbee2Tasmota on a Sonoff ZB Bridge pro.

Xiaomi WXKG01LM control via MQTT | Zigbee2MQTT indicates that your device supports two modes: legacy and non-legacy - I don’t know whether the non-legacy mode is configurable at the Zigbee protocol level or whether the non-legacy mode is provided by Zigbee2MQTT. I’m not familiar with Zigbee2Tasmota, but maybe there is an equivalent Zigbee2Tasmota option to switch the MQTT messages to non-legacy mode. That’s all I can contribute.

Thanks a lot, I will ask help to Tasmota team, in case I will go back here with solution