[Release] Xiaomi / Aqara device drivers



5 seconds first time (enter pair mode) just 1 second after. If you push 5 secs every time, the devuce enter pairing mode each time resetting the process. I hope this can help you. I had not problems.
be sure to have not any uncompatible repeater (switch off them all)


@veeceeoh, I added support for LLKZMK11LM (the Aqara double relay) to my wall switch drivers. There is not much difference, even power metering and button/relay separation works (with some tweaks), you can implement them in your drivers if interested.


Anyone with a C5 hub getting weird characters when joining some Xiaomi devices? It doesn't seem to happen to all of mine, but here is what one of my buttons looked like (this is a couple-year-old square variety):

I don't have Zigbee on my older hubs anymore so I can't test for sure, but I wonder if this has something to do with character encoding on the C5 as we found with the "Hubitat® Dashboard" app name. I suppose it could also be related to endianness changes in Zigbee parsing as of a few firmware versions ago. In any case, besides the odd display, this also prevents it from choosing the correct driver, but it seems to work as expected if I manually choose it after. Looks like it might be something with the Hubitat pairing/parsing process and not the driver itself, but I wasn't sure where to post this or if anyone else has noticed similar problems. Again, while I can't test, I suspect it's a C5 thing.


I just got some Aqara devices (temp & humidity, vibration sensor)
I did pair the tem&humidity sensor, but device type wasn't recognized, I had to change it to generic zigbee ... is that it. do I need to install any drivers manually?


No, you need to install the driver for that specific Xiaomi device (see the first post in this thread) and change to that driver. But if you have a new C5 hub, I'm also curious if it parsed the model of your device correctly (see my post above for what it shouldn't do). If you have the right driver installed before you pair, it should automatically select it for you.


I have a C4 hub and have seen garbage characters at the end of the ZigBee Model on a range of devices. It's also been mentioned here and there's a whole thread about it here.

I suspect the issue is related to the string length not being correctly defined for the model data. Interestingly, in some cases the correct device driver was selected for devices with garbage characters at the end of the the ZigBee model name.

For the Aqara buttons and Wireless Wall switch drivers, some of the setup (including setting the number of buttons available to apps, and determining what log / event description text to display) is based on that model string, but I use startsWith in an attempt to disregard the garbage characters.


That sounds good, mine finally arrived yesterday after some delays being caught in customs. Strange how they can do power measurement though, on initial look I thought these were dry-contact.

That's not so good, perhaps that can be identified at some point and turned off .... it could have a severe impact on a busy network if you add several of them


Honestly I have no idea how it works, I'm not really into electronics... What was strange to me is that wall switches report 0W when both of the loads are turned off, but this one always reports a positive value (min. 0.01-0.05W), and even though no load was ever connected to it, now I managed to reach 0.0019kWh. :slight_smile:

I'm not aware of any way to control them, and I think it wouldn't be wise to completely disable them, because they have quite a lot of more or less useful info in them... but I agree that 6 secs is a bit too frequent.
Maybe once I'll finish the (Zigbee 3) firmware I started to write for an Aqara wall switch, but I lost interest when I read that the new generation of devices will be standard compliant...


@veeceeoh Tried just about every tips & tricks in here to get my Aquara Motion sensor pair'd but it won't show up under zigbee discovery. RTCGQ11LM with FCC id 2AKIT-22635-RTCGQ11LM.

Long pressed and get three short flashes and a longer, after a couple of seconds a get a long again. Then tried to push a short press again untill it blinks. Over and over again for almost 40 min. Driver code ver Version 0.7.2 installed. Any more tips or hove to success with this pairing ?

Hub firmware: EU
Brand new sensor, sold in eu.


Changed Zigbee channel from 11 to 24, reboot hub and then it found it directly. Was at work in under 5 sec after entered discovery=)


FYI, the Aqara hub made to specifically work with xiaomi sensors is only set to zigbee channel 25, and can not be changed
I have my hubitat on 25 and the sensors pair on first try


Also note: In the wild, in addition to channel 25, I have seen reports of Xiaomi Gateways operating on ZigBee channel 20 and channel 11 (here and here.)

Since both Xiaomi and Aqara branded Zigbee devices are supposed to be compatible with either Xiaomi or Aqara branded Gateways, I have to conclude the end devices should be capable of operating on at least a number of different channels.

There was quite a bit of discussion early on in the Xiaomi Devices - are they pairing / staying connected for you thread (probably a better choice of thread for this discussion, BTW), and user @NoWon reported difficulties with Xiaomi devices on channel 25 (not sure if that was just older Xiaomi or a mix including Aqara devices), and then seemed to have more success with channel 20.

I myself went from using channel 26 to channel 20, subsequently experiencing few issues, and have stuck with that, though I will say that my Aqara Wireless Smart Switches can be a pain to pair (I have been moving them back and forth between my Hubitat and SmartThings hubs for testing and working on DTH/driver improvements).

I haven't tried changing to channel 25 though, so I can't say whether that would help with things. I do know that when my Xiaomi/Aqara devices pair via one of my XBees, it seems to be a lot easier/quicker in general.


Me too, but now I have the Xiaomi mesh on channel 15 with no issues. I decided to get out from ch 26 because I had issues with xbee.


Ah, interesting. I'm thinking, then like ST, xiaomi ships the hub set on a single channel. My hub is the one with the "M" on it-Mejia.
Thanks for clarifying. I prefer 25 because it doesn't have the lower power like 26, and is well away from my wifi AP's.

I'm not having any issues with my 16 Xiaomi devices on channel 25, since yanking my Iris plugs


Has anyone noticed some strange behaviour with latest Hubitat releases with Xiaomi Aqara motion sensor?
I've not been at home too much in the latest months and I've upgraded to 2.0.7 and 2.0.8 remotely, but now that I'm back I've noticed that some Xiaomi motion sensors seems to don't report any motion when I move in front of them but they update illuminance.
That's strange because they should report illuminance just when they detect motion, so seems that they are detecting motion correctly but sending just illuminance event and not motion one...

EDIT: Found it! Probably due to a change in the mesh during upgrades, it was connected to an Osram bulb that doesn't work very well with Xiaomi, I'll replace soon with a Tradfri one


I just changed my zigbee channel to 25, and put my wifi on channel 6. so far so good with the xiaomi devices.


seeing a new error with the 08 vibration sensor driver, after running good for 2weeks without errors. Tagging @veeceeoh for translation from "Greek"

dev:5872019-04-22 11:51:21.676 pm errorgroovy.lang.GroovyRuntimeException: Ambiguous method overloading for method java.util.ArrayList#getAt. Cannot resolve which method to invoke for [null] due to overlapping prototypes between: [interface groovy.lang.Range] [interface java.util.Collection] on line 403 (parse)


Line 403 is part of the function that confirms the sensitivity level has been set, triggered by a catchall message received from the sensor (after the user has requested the change in level and short-pressed the reset button.)

For me to know what exactly happened, I'd need more context, especially debug log entries that occurred just before that error, and also what the values of the State Variables requestedSensLevel and currentSensLevel are:


Also: are you running a beta version of the hub firmware?


I recently got a Xiaomi Motion Sensor and it is working great. The only problem I am running into is it is not working with the HSM. Has anyone had issues with this?


Which sensors?

Would these be supported?

Xiaomi Aqara Human Body Sensor Smart Body Movement Motion Sensor Zigbee Connection