Aqara Button Two Activation Methods, Same Device

I just paired my Aqara Button, model lumi.remote.b1acn01 and it works for a single action.

I set up an automation to turn on a bulb with a single press and it works. I can set it up to turn off the bulb with a hold action and it works. Trying to use both of these on the same device results in a press turning the bulb on but the hold turning the light off and then once released, turns the bulb right back on.

Am I missing something with this device? I pulled the xiaomi-aqara-button.src DH from bspranger today when I paired it.

Thank you

By coincidence, I’ve been reworking the Aqara Button DTH today. My button has different firmware so behaves differently to yours. However I know what it is doing.

The Classic environment only ever defined ‘pushed’ and ‘held’ events for the Button capability. In order to support double and triple clicks etc, a seemingly de facto approach evolved (or at least a not well documented one …) where a button number was added to the event data. So a normal pushed or held event would normally be sent with ‘buttonNumber: 1’ added to the data. A double-click would be a pushed event with ‘buttonNumber: 2’ added to the data. SmartLighting and webCoRE are aware of this mechanism. However, I don’t believe the Custom Automation creator in the new app is aware of it.

Drifting back to the specific point. Your particular button includes ‘hold release’ events and these have been mapped by the handler to pushed events with ‘buttonNumber: 3’. It seems you can’t check, or aren’t checking, the button number so the hold release looks the same as the button being pushed.

The new app dashboard and Automations can cope with child component buttons (for example the IKEA button handler defines ‘Top button’ and ‘Bottom button’ for the two button remote, as well as button 1 and button 2) and Smart Lighting and webCoRE can treat them like normal buttons. However the Aqara handler doesn’t define them.

The new app dashboard, Automations and SmartLighting can work with the full range of values now defined for the Button attribute. Although webCoRE hasn’t been configured with the new attributes, they can still be used in pistons with manual tweaks. The Aqara handler can’t use these attributes and it isn’t possible to use them together with button numbers. In any case there still isn’t a ‘released’ value in the capabilities.