[Release] Xiaomi / Aqara device drivers



Hubitat doesn’t have any mobile UI (yet) nor a built-in way to report non-standard attributes that I am aware of.

I would never consider using a ambient atmospheric pressure measurement device to measure the air pressure of HVAC output vents. An overpressure/gauge pressure device is appropriate for that task.


Ya i don’t know enough about HVAC systems lol.




Great work! I’m about to start migrating devices from ST, and will probably start with the Xiaomi ones.

Do you have any plans for the Xiaomi/Honeywell Smoke Detector as well? I’m using one of those for my current ST SHM setup.

(I’m emilakered at the ST forums/github btw, but for some reason this one pulled my email domain as my username. Computers…)


Send an email to support@hubitat.com with a change user name request. Mine was done in an hour.


Yes, but since I don’t own one, I’ve been waiting for a Hubitat owner who can help test a device driver. :grin:

I guess I should get started on that soon…


I thought about getting one but I’m a little leery to buy devices before I know they’re supported, after getting burned a few times (Xiaomi yee light strip still orphaned, more or less)


For any Xiaomi Zigbee devices, if there’s a device handler to support them on SmartThings, then a device driver can be made for Hubitat. Personally I’ll only buy a device if it would be useful to me, not just for testing a device driver. In fact I just received a couple of the new revision of the Aqara Button (model WXKG12LM), and have updated the SmartThings DH (currently being tested), and will be updating the Aqara Button device driver for Hubitat very soon.

As you’re well aware, Xiaomi’s Yee Light / Yee Light Strip is WiFi-based, and as such is a very different monster to support than any of their Zigbee devices.


Yeah, because I was unsure about smartthings when I started getting smart devices so I got a few different wifi/ethernet based things: Yeelight, Nanoleaf, and Sinope’s hub thermostats, and of course Caseta.

I do have yeelight strip control sort of… it’s just TV backlight, so I’m running tasker, sharptools and yeelight app on my ShieldTV, so when tasker detects screen on it turns on the yeelight locally through the app. I’m hoping sharptools gets Hubitat connectivity as well.


I think I can help with that, just as soon as I have time to start moving devices over… :wink:


[RELEASE] v0.5 of Xiaomi Aqara Button Device Driver
Now compatible with both models - WXKG11LM & WXKG12LM
Originally created by @brianspranger

For convenience please copy the driver code from this direct link.

This release adds support for the new revision of the Aqara Button, model WXKG12LM. This new model takes away the triple- and quadruple-click functions, but adds hardware-based hold support, and also sends a unique message when the button is shaken. Note that if the button is mounted to a surface, there’s no way to get the shake function to work (unless you can shake the whole surface!)

Below are charts of what happens with each type of action, for both models:

Aqara Button model WXKG12LM

Action Hubitat button event(s)
Single click button 1 pushed
Hold, release button 1 held, then button 0 pushed when released
Double-click button 2 pushed
Shake button 3 pushed

Aqara Button model WXKG11LM

Action Hubitat button event(s)
Single click button 1 pushed, then button 0 pushed after user-set delay
Double-click button 2 pushed
Triple-click button 3 pushed
Quadruple-click button 4 pushed
Hold Not supported (same behavior as single-click)

Other Features:

  • The Hubitat hub should correctly select this custom device driver when pairing.
  • Battery replacement date tracking, stored in batteryLastReplaced state
  • Commands / Preferences include:
    Model WXKG11LM only - A preference to set how many seconds until single press is cleared with a button 0 “released” event
    • A Reset Battery Replaced Date command to track battery life
    • Min/Max voltage values used to calculate the battery percentage
    • Toggle settings for enabling display of informational and/or debug log messages

Changes from previous version

  • removed Toggle Mode preference setting because Apps provide that functionality
  • added (informational) info log message toggle preference setting, for displaying helpful
    plain English" / non-debug log messages
  • changed Battery Replaced Date to use system-formatted new Date() date/time stamp
  • removed Date Format and 24 hour clock preference settings because they are no longer used
  • removed lastPressedDate because it doesn’t serve any real purpose on Hubitat
  • changed lastPressed to buttonPressed event, for webCoRE use
  • added custom buttonHeld and buttonReleased events for webCoRE use

Note: This device driver is not final, and some features or preferences may be added / removed


Can they be paired to ST and Hubitat at the same time?


Have you had any luck with the xiaomi cube? The ST DH seemed to port over easily enough. The cube was discovered immediately by the hub. When I change the face of the cube, the device state changes properly. However, I can’t figure out how to do anything with it. I couldn’t figure out how to get RM to do anything with it and haven’t had a lot of luck with webcore and Hubitat playing nice to see if it works with webcore.


You have to create custom commands first, I believe.


I see how you can create a custom command. The connection I’m missing is how to use that custom command to trigger an event. I know how to trigger a custom command but not vice versa.


Incompatibilities with RM are because of the difference between ST’s button capability implementation and Hubitat’s.

If you got webCoRE working on your Hubitat that would work in the interim because it would still “see” the button events from the ST device handler.

I have been working on updating the currently released Xiaomi device handlers for ST and device drivers for Habitat. After that, I plan on working on the Hubitat device driver for the Mi Cube.


No Zigbee or Z-Wave devices can be paired to more than one hub at the same time.

If you want to pair your Xiaomi devices with you Hubitat hub, you should be able to make them available for your SmartThings hub to “see” using @krlaframboise’s Other Hub SmartThings Integration app.


I’m working on getting webcore integrated for that specific issue and guessed that was my best option to complete the integration. But the webcore dashboard has been very glitchy for me, which is a whole diff ball of wax on a diff thread, as you know… I was hoping there was a solution with button controller or RM. I was pleasantly surprised at how easy it was to get as far as I did with the cube and will keep plugging away at getting webcore working.


I have put up an early beta of the Hubitat device driver for the Xiaomi Mi Cube on my GitHub repository.

You can grab the code from here.

It should now register different actions as button presses in RM or other Hubitat Apps, but I have not tested it at all.

Things I still need to figure out include dealing with the Three Axis functionality (apparently not implemented on Hubitat) and also whether the additional data posted in button pushed is being handled correctly for the device driver to use.

Let me know if it works at all for you!


Thank you. Both the DH and webcore are working!