[Deprecated] Xiaomi / Aqara ZigBee device drivers (possibly may no longer be maintained)

Do you still need help getting the Motion Sensor paired to your hub?

If yes, can you explain what happens when you try to pair it?

Install the driver.
Acrivate zigbee discover function and Push the motion sensor button for 4-5 seconds, then every few second push again for one second the button, until HE discover the device.
This worked for me.

Using it for 10 minutes, it's working fine so far... :slight_smile:

Pros: Can be used with both momentary and regular switches, so perfect for retrofit. Reports changes, aaaaand: supports power measurement!

Cons: Floods the network with unusually long xiaomi strings (144 bytes in every 6 secs or so, but at least they're properly length-prefixed...), and despite its small size, it seems to be challenging to squeeze it into a standard european wall box...

Fingerprint:

manufacturer : LUMI
idAsInt : 1
inClusters : 0000,0003,0004,0005,0001,0002,000A,0006,0010,0B04,000C
endpointId : 01
profileId : 0104
application : 23
outClusters : 0019,000A
initialized : true
model : lumi.relay.c2acn01
stage : 4
manufacturer :
idAsInt : 2
inClusters : 0006,0010,0004,0005
endpointId : 02
profileId : 0104
application :
outClusters :
initialized : true
model :
stage : 4

Interesting stuff, probably I'll create a driver for it in the evening...

@roberto @veeceeoh I installed the driver, discover Zigbee and pushed the sensor button for 4-5 sec every now and then. HE discovered it but stuck on initializing. Did this prosess a numerous of times, and waited for the pairing to finish for 30-40 mins. But still wont pair.

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.

2 Likes

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?
Thx

1 Like

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: 2.0.8.113 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

1 Like

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.

1 Like

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

1 Like

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.