Here's my take on some drivers for a select few battery powered Xiaomi Aqara devices. There are a number of other excellent drivers out there with more complete support of the range, but these are for the devices I own and now use every day.
These are combination drivers and can be used with directly paired Xiaomi devices or those connected via my Zigbee2MQTT Routing Driver.
There's a little backstory below, but due to the faff I've had with Xiaomi products I can only recommend using Xiaomi devices on Hubitat via Zigbee2MQTT. I had partial success for a long time with them directly connected, but they were still troublesome. They are flawless using Zigbee2MQTT.
Installation
Search for the keyword "Xiaomi" on Hubitat Package Manager and you should see "Xiaomi Drivers from BirdsLikeWires". Requires HPM v1.8.7 or later. Or install manually from the links below.
- Xiaomi Aqara Temperature and Humidity Sensor WSDCGQ11LM - Import URL: RAW
- Xiaomi Aqara Wireless Mini Switch WXKG11LM / WXKG12LM - Import URL: RAW
- Xiaomi Aqara Wireless Remote Switch WXKG06LM / WXKG07LM - Import URL: RAW
- Xiaomi Mijia Smart Light Sensor GZCGQ01LM - Import URL: RAW
Note!
If you have more than one driver installed for a particular device and pair it for the first time, there will be a "race condition" and whichever driver "wins" will perform the initial configuration.
This isn't a problem if you're switching between drivers on a device that has already been paired. Just follow the instructions in Device Configuration below.
Mesh Advice
Use Zigbee2MQTT and my Routing Driver. No, honestly, I promise it's the best way. It took me four years and a lot of code writing to come to this conclusion and you don't have to do that!
If you're completely insistent you're going to pair them directly to your Hubitat hub... you're going to need an additional hub to dedicate to them.
I've encountered so many issues getting them to work reliably that keeping them on their own separate network and making them available using Hub Mesh is the only directly-connected method I can recommend. My setup was very simple:
- Hubitat C-7 on Zigbee Channel 23
- IKEA Trådfri Signal Repeater E1746
I found that even some of Xiaomi's own wired Smart Wall Switches (namely models QBKG22LM and QBKG25LM) will cause mesh instability. Battery devices will become unreliable and then drop completely within a few hours, so you will never find drivers for those here. Instead I use very reliable Samotech modules fitted behind the Wireless Remote Switches.
In theory the Zigbee channel shouldn't matter, but channel 23 was the best I had available, away from my wifi and with a little space between other Zigbee frequencies in use.
The drivers do nothing special to try and keep devices alive and connected. The mesh is either good or it's not and devices should check in every 50-60 minutes with battery readings. These reporting intervals are a firmware default and cannot be changed.
Devices and Features
Some of the devices send a unique transmission (sometimes with battery data) on a short press of the reset button. Where this could be useful it is mapped to a button press and referred to here as the "reset button" feature, to give an extra means of control for "free".
Note: Battery reports only come through every hour, so don't be surprised if you don't see that value appear when you've first paired a device. Give it a few hours and if it's paired correctly, it'll be there.
Xiaomi Aqara Temperature and Humidity Sensor WSDCGQ11LM
Provides temperature, relative humidity, calculated absolute humidity, pressure, pressure direction (rising or falling), reset button, device presence and battery reporting. Tapping reset is mapped as button one.
Xiaomi Aqara Wireless Mini Switch WXKG11LM
Supports push, double push, triple push, quadruple push, quintuple push, reset button, device presence and battery reporting. Tapping reset is the same transmission as the quintuple push, so is also reported as button five.
Xiaomi Aqara Wireless Mini Switch WXKG12LM
Supports push, double push, hold, release, reset button, acceleration (shake), level (calculated from duration held), device presence and battery reporting. Tapping reset is again reported as button five, while acceleration (shake) is reported as button six.
Xiaomi Aqara Wireless Remote Switch WXKG06LM / WXKG07LM
Supports push, double push, hold, long hold, device presence and battery reporting. Left key is button one, right key is button two, both keys together make button three, with each button supporting all four modes of press:
- Press
- Double Press
- Hold (2 seconds)
- Long Hold (5 seconds, reported as a "released" event)
If you hold a button for more than 10 seconds the device will reset, so don't do that.
The "long hold" feature makes use of a message received from the device if a button is still being held down three seconds after the "held" transmission has been sent. A "hold" is reported after two seconds, therefore this "long hold" message is triggered after five seconds.
Given that there is no genuine "released" message supported by the device it would seem the best way to capture this functionality is to consider it an "autorelease" of the button. Therefore a long hold is reported as the held button being released.
We're basically getting a fourth type of press for free!
Xiaomi Mijia Smart Light Sensor GZCGQ01LM
Supports illuminance, illuminance direction (brightening, darkening), device presence and battery reporting. Tapping reset is mapped as button one.