ANNOUNCEMENT: Multiple Device Driver Betas
It's been quite a while since I've made any updates to the Xiaomi device drivers for Hubitat. In the meantime, the Hubitat Button Implementation has been updated, Hubitat added their Dashboard allowing for custom device driver attributes to be displayed (such as a human-readable time/date stamp that would be nice to have as @mike has pointed out), more is known about the battery typical voltage range seen in Xiaomi devices, and Xiaomi has released new revisions of a few of their button devices.
So I'm currently in the process of updating all of the Xiaomi device drivers to address all of these things, starting with two beta releases today: A brand new device driver that replaces the 2-button Aqara Smart Light Switch driver, and an update to the Aqara Button device driver.
[BETA] v0.55b of Xiaomi Aqara Button Device Driver
With many thanks to @guyeeba for reporting on the new revision of the model WXKG11LM Aqara Button and the code changes to make it work, I am releasing this beta of the Aqara Button driver. At the same time, I am updating the way this driver produces button events with the model WXKG12LM Aqara Button.
The beta device driver code can be copied directly from here.
Here are charts showing what events are generated for actions on each of the three models of Aqara buttons:
Aqara Button - Model WXKG11LM (original revision)
Action |
Event |
Button # |
Notes |
Single-click |
pushed |
1 |
|
Double-click |
pushed |
2 |
|
Triple-click |
pushed |
3 |
|
Quad-click |
pushed |
4 |
|
Release |
pushed |
0 |
Generated by device driver with 2 second (user-adjustable) timer |
Notes: The functionality for this model remains the same as before, even though it doesn't make use of the Hubitat-specific doubleTapped
and released
events. The reason for this is because of the additional triple- and quad-click functions supported by the hardware. If anyone thinks there are very good reasons to change it so that a double click results in a button 1 doubleTapped
event, I'm all ears.
Aqara Button - Model WXKG11LM (new revision)
Action |
Event |
Button # |
Single-click |
pushed |
1 |
Hold |
held |
1 |
Double-click |
doubleTapped |
1 |
Release |
released |
1 |
Note: I don't own this model, but I assume the hardware button held message is sent after 400ms like with Model WXKG12LM.
Aqara Button - Model WXKG12LM
Action |
Event |
Button # |
Single-click |
pushed |
1 |
Hold |
held |
1 |
Double-click |
doubleTapped |
1 |
Release |
released |
1 |
Shake |
pushed |
2 |
Note: The hardware button held message is sent after the button has been held for 400ms.
Changes:
- added compatibility for the new revision of Model WXKG11LM (ZigBee reported model:
lumi.remote.b1acn01
) with help from Hubitat user @guyeeba (Thanks again!!)
- changed event type functionality for Model WXKG12LM to include
DoubleTapableButton
and ReleasableButton
capabilities, so that pushed
, held
, doubleTapped
, and released
events are all assigned to button 1
, and shaking the button results in a button 2 pushed
event.
- added a routine to determine model at time pairing and set appropriate number of buttons available to Hubitat apps
- added
buttonPressedTime
, buttonHeldTime
, and buttonReleasedTime
attributes used for generating human-readable date/time stamp events which can be utilized for Habitat dashboard display
- renamed
updateCoREEvent()
to updateDateTimeStamp
- changed default battery voltage range used for calculating percentage to 2.9 V minimum / 3.05 V maximum
- minor formatting / comments fixes
[BETA] v0.55b of NEW Aqara Wireless Smart Light Switch Device Driver
Based on the 2-button Aqara Smart Light Switch device driver, his new driver adds support for the 1-button model (WXKG03LM). Note that this driver only supports the wireless
battery-powered light switches, not the mains-powered versions. Many thanks to @Peter for his help in contributing to and testing the new code for the 1-button model.
The beta device driver code can be copied directly from here.
Here are charts showing what events are generated for actions on each of the two models of Aqara Wireless Smart Light Switches:
1-button model WXKG03LM
Action |
Event |
Button # |
Single-click |
pushed |
1 |
Hold |
held |
1 |
Double-click |
doubleTapped |
1 |
Note: Holding the button for more than 15-20 seconds puts the device into pairing mode.
2-button model WXKG02LM
Action |
Event |
Button # |
Press left button |
pushed |
1 |
Press right button |
pushed |
2 |
Press both buttons |
pushed |
3 |
Changes (to the code of the existing 2-button Aqara Smart Light Switch device driver)
- added support for and parsing of button press, double-click, and hold messages sent by model WXKG03LM (1 button) which result in Hubitat button 1
pushed
, doubleTapped
, and held
events, respectively
- added a routine to determine model at time pairing and set appropriate number of buttons available to Hubitat apps
- added attributes
buttonDoubleTapped
and buttonHeld
to contain the most recent Epoch Time date/time stamps of corresponding button events that can be used in addition to buttonPressed
in WebCoRE pistons
- added
buttonPressedTime
, buttonDoubleTappedTime
, and buttonReleasedTime
attributes used for generating human-readable date/time stamp events which can be utilized for Habitat dashboard display
- renamed
updateCoREEvent()
to updateDateTimeStamp
- changed default battery voltage range used for calculating percentage to 2.9 V minimum / 3.05 V maximum
- minor formatting / comments fixes
NOTE: When this new device driver goes out of beta, I plan to "retire" the old 2-button Wireless Smart Light Switch device driver.
Any feedback and/or suggestions on these beta device drivers is both welcome and much appreciated!