[OBSOLETE] Original & Aqara Xiaomi Zigbee Sensors (contact, temp, motion, button, outlet, leak, etc)

[UPDATE] Aqara Button device hander to v1.2

Available immediately on the bspranger/Xiaomi GitHub repository. The updated code can be copied from this direct link.

New features

  • Compatible with the new Aqara Button model WXKG12LM, which offers single-click, double-click, hold, and shake functions (see table below)
  • Compatible with Aqara Smart Light Switch models WXKG02LM / WXKG03LM (with limitations, see Important Notes, below)
  • Button status correctly displayed in main tile of mobile app UI, with a new custom icon
  • Live logging preference settings, with toggles for display of info (“plain” English) and/or debug (technical) log messages. As a default, info log messages are displayed.
  • Improved webCoRE support

Aqara Model WXKG12LM Functions Table

Button action Event sent to hub
single-click button 1 pushed
hold button 1 held
double-click button 2 pushed
shake button 3 pushed

Note: the hold function is hardware-based, activated after 400ms according to Xiaomi’s specifications - which cannot be changed

Important Notes

  • Limitation: The “original” Aqara model WXKG11LM, and both models of Aqara Smart Light Switch only support button pushed. There is NO possibility of adding a hold feature for these models.
  • Limitation: The 2-button Aqara Smart Light Switch model WXKG02LM is only recognized as ONE button. This is because the SmartThings API ignores the data that distinguishes between left, right, or both-button presses.
  • webCoRE users can make use of a number of custom attributes, some of which have been renamed from the previous version of the device handler:
    lastCheckinCoRE - updated on every single message received from the button
    lastPressedCoRE - updated when the button is physically pressed (or shaken, for model WXKG12LM)
    lastReleasedCoRE - model WXKG12LM only updated when the button is physically released after being held
  • The device handler no longer sends button released events. This is because SmartThings’ button capability only supports pushed and held events.
  • The toggle mode option has been removed, because SmartThings’ button capability doesn’t support button released events and also because most Smart Apps that work with buttons offer a toggle switch option already.
  • The SmartThings app UI display of “pushed” (or for model WXKG12LM, “single-clicked”, “double-clicked”, or “shaken”) lasts for about 1 second, and then will reset back to “released”. When model WXKG12LM’s button is held, the UI will display “held” until the button is physically released, but note that the button 1 held event is always sent after the button has been held for 400ms.
4 Likes