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

No problem. I'm just chucking ideas out there about things I've read/picked up along the way. Good luck.

Those are not Xiaomi compatible, so you will always have drop-out issues if you use Xiaomi devices with those repeaters. That isn't a Hubitat thing, that is a Xiaomi device thing, and will happen when used with incompatible repeaters on any hub.

I refer you to here:


All four of the Aqara humidity/temperature/pressure sensors I got are reporting 70ish percent battery remaining after only a few days of having them. Anybody else experience battery drain on these? If so, any possible fixes? I'm using the Ikea Tradfri repeaters, though only two of these should be routing through them. Or could the driver just be misinterpreting the numbers?

mine have all reported weird battery first off when pairing. im just going to run them til they stop reporting and with new batteries see what comes.

How long have yours been running for without changing them?

@veeceeoh wrote a very good explanation of how battery calculations are handled.


The question is, what are the voltages being reported?

1 Like

maybe 6 weeks

Correct. If I remember it wasn't fully supported on the Hubitat platform when I started porting the driver from my SmartThings device handler, but it has become very clear since then that the 3-axis values would not be of any real use because the X/Y/Z values for any given position vary somewhat wildly from unit to unit.

The best use for the X/Y/Z values is already implemented: Vertical or "off-angle" object or door open/close position, which is presented by the driver through the contact sensor capability. The driver already does all the heavy lifting calculations to provide this feature, and it is based on relative X/Y/X accelerometer positions rather than absolute (which would not work due to the lack of accuracy / consistency between units as described above).

That said, if you can come up with a valid useful reason to reinstate the 3-axis capability, I could rework the code, but it would just send the raw values, which may not make sense / be useful to apps written around the 3-axis output of other manufacturer's devices.

The new USA market Aqara Smart Switches (wired for 120V/60A, models WS-USC01 & WS-USC02 for no-neutral and WS-USC03 & WS-USC04 with neutral) are currently the only ZigBee 3.0 devices officially listed that I'm aware of. However, even these are not yet available to purchase anywhere.


It's the usual problem with community forums. Useful information is scattered all over the place, disorganized. But the issues with Xiaomi / Aqara devices not playing well with most ZigBee repeaters has been known of and discussed for a while. With a recent uptick in people who seem to be interested in Xiaomi / Aqara devices but unaware of the potential pitfalls in their use on the Hubitat (and SmartThings) platforms, I was prompted to add this to my opening posts of the the two big threads I started here on the Hubitat Community Forums:

I am hoping that's enough to prompt potential users to look into why they are not officially supported or guaranteed to work, without having a lengthly paragraph explanation in giant bold type. :rofl:

In all seriousness, however, Xiaomi / Aqara's official websites state that their ZigBee-based devices require a Xiaomi / Aqara Gateway Hub, and compatibility with any other hub platforms is never mentioned. So using them with other hubs is presumably at the user's risk.

I feel your pain, though, as it works in reverse: I have bought ZigBee repeater capable devices hoping my Xiaomi / Aqara devices would play well only to discover they don't. It's no fun wasting time / money / effort on devices that don't do what you were hoping they would do.

As @bjcowles mentioned, I have explained how the battery percentage is calculated in a previous post, but the short explanation is that the percentage is a rough estimate based on the range of voltage readings expected from a working battery in a Xiaomi / Aqara device.

The default range is from 2.9 Volts to 3.05 Volts, which means a battery percentage of 70% is the equivalent of a battery reporting 3.01 Volts. And this means your batteries are working fine. In fact, there is official Aqara documentation stating that the battery should be replaced when the reported voltage is 2.8 Volts. So with the driver's current default minimum of 2.9 Volts used to calculate the percentage, if you see a percentage of 0%, the battery should still work fine, just it needs to be replaced fairly soon.

If you don't like seeing such "low" percentages, I recommend manually changing the min/max values to 3.0/2.8, respectively, in the device details page when viewing the sensor/device in the Hubitat web interface. But with those values, a percentage of 15-20% would mean it's time to replace the battery.

So far these are pretty damn good sensors; I can trigger one seemingly on demand by cupping my hands over it and breathing into my hands for a second. Between these and the Iris v2 motion sensors, I'm really liking the snappy response I'm getting out of my hubitat setup so far, unlike what I was seeing with my hue only setup. I can't imagine having a smartthings hub, it must be infuriating having things not work just because your ISP decided to be flaky one day. I personally can't stand it when technology goes slow for no good reason, one of the reasons I ditched my roku in favor of shieldtv.

Stop. Send me a PM before you do that and I'll send you my address where you can ship them. I'll pay the shipping. :stuck_out_tongue_winking_eye:

I'm able to get all the Xiaomi Zigbee devices to work reliably, and not drop from the Zigbee network by using only IKEA Trådfri outlets and repeaters, with no incompatible powered Zigbee devices on my hub.

However, that has not been the case for me with the Xiaomi Mijia or Aqara contact sensors. They work, but I still had occasional drops and contact sensors that did not respond correctly on occasion, despite being very close to the hub. The only fix has been to pair them directly to a Xiaomi Aqara HomeKit hub, and then sync that back to HE virtual switches via HomeKit automation. That has been 100% solid performance.

Not the answer for everyone, but for $40 US, this gave me 100% solid, nicely designed and compact contact sensors, that cost only $10 each. It also gave me a doorbell, a supplemental alarm siren, a full spectrum nightlight/status light, and the ability to use any supported Xiaomi Zigbee device, regardless of whether or not the driver exists on HE, and regardless of its reliability on HE. So if you consider the total cost, I have 6 Xiaomi contact sensors, and one Xiaomi HomeKit hub. Those, plus the Controller app for iOS was a total cost of $112 US. Whereas 6 Samsung SmartThings multi-sensors would have cost $120 US. So it's not that I'm saving a ton, but I will save $10 every time I buy a new contact sensor. Plus I have the flexibility to purchase other Xiaomi Zigbee products, and I only have to make sure they are supported by the Aqara Home app.

This works well for me because I'm an iOS users, I was already running Homebridge for HE, and I have an Apple TV 4 to do the HomeKit automations in the background. So while it's obviously not a solution for everyone, it is a solid solution. The only word of advice extra I will add is as noted above, pay for the Controller Pro for HomeKit app, and be sure to backup your HomeKit automations. They are the one unstable piece in that puzzle, no thanks to Apple's stupid idea to automatically delete your automations the moment a device is unavailable in HomeKit.

1 Like

I just pre-ordered one of these new Zigbee 3.0 motion sensors. If I can get it to pair, I'll be happy to work with you to get a driver created if you're interested.

1 Like

Are those actually Xiaomi? I know the listing title says it is, but I don't see that anywhere else. I ordered one from Amazon a while back and had mixed luck: Konke motion sensor

They do seem to behave a bit like the Xiaomi sensor in that they only send "motion active" messages, but unlike the Xiaomi sensors, faking "inactive" with a timeout doesn't seem to work since they don't keep reporting activity if motion remains active--they just don't do anything at all. I could be missing something (maybe there's a configuration it needs sent that I didn't do, or some say it only is able to receive these at certain times).

Also, as I noted above, I couldn't get it to pair on channel 19. Google tells me 15, 20, and 25 are the ones that work (and 20 does for me). I ended up putting mine outside at a place I normally just walk by once (to solve the first problem) to have a light turn on and don't care if it gets eaten by the elements (which would solve the remaining problems :slight_smile: ).

Interesting. Wish I had seen your post first. Bit of an impulse buy I must admit. In the interest of helping to make this square peg fit a round hole, I will keep my order. There must be some way of making this work, we just haven't found it yet.

No idea if they are actually Xiaomi or Shenzhen Green Rice Lianchuang Technology Co., Ltd, or whomever, but I purchased because I like the idea that I might be able to get these working well enough to be an effective ceiling mount motion sensor. NYCE are too expensive for my smart home budget. The Mijia sensors work with the Aqara HomeKit hub, so maybe these would too. That would be fine for me.

Was looking at the Alliexpress ad for those, and it says “for Xiaomi” instead of “from Xiaomi Ecosystem”. Wonder if this is a translation error. Maybe they meant that they are compatible with the Xiaomi hub? That would be fine with me. We will know in about a month when I receive mine.

From the reviews section on this Ali Express page:

Seems not to work with zigbee 3.0

it's NOT Zigbee Protocol! It doesn't work with a CC2531 stick which can pair EVERY Zigbee device! Seller doesn't help at all; just saying it works with the Konke Hub!

From a Deconz thread about trying to add support for the sensor, this post:

Yea, to be honest the sensor is quite bad. Slow reaction. And no “no motion” trigger.

Also a small fov. I hoped it would be like 160 degrees or so.

However the Ali Express seller does state this:

Support:tuya , Philip HUE ,CC2531 etc, all ZigBee 3.0 device & HUB。if cannot connect We will refund the money.

Honestly, it doesn't sound like the device is worth trying to make a Hubitat driver.

Nevertheless, @SmartHomePrimer, since you've decided to keep your order, I'd be curious to hear as to whether it works acceptably with your Aqara Gateway.

As best I can tell, the company is completely different: Hangzhou Konke Information Technology Co., Ltd. They are listed as an "Adopter Member" on the Zigbee Alliance site; however, they have no products listed as ZigBee Certified.


:joy: Totally want to cancel now, but I will proceed, otherwise we’ll never know. I could not find any posts about anyone trying them or actually using them with an Aqara or Mijia gateways.

@bertabcd1234, would you say the reaction time is slow? Because that I’m not interested in, even if they did work 100% with the Xiaomi gateway.

Having followed this thread for some time and reading people's comments I was just after some advice. So I want to get contact sensors that'll work with hubitat. I used the Xiaomi Aqara one which as mentioned previously, worked fine for a month and then stopped working. I haven't got any repeaters in use so it was connected directly to the hub and isn't too far from the hub.

Are there any alternatives? Though xiaomi devices are cheap, they're not always cheerful and without the ability of linking the Xiaomi gateway to hubitat (not an iOS user here) what alternatives are there that I could use?

I don't think I noticed slowness when I was trying to write a driver, but I'm using it outside now so can't speak to how it behaves in real life (that's where I don't care if slow things go, Monoprice sensor...).

I see the quote above says it should work with Hue. I never tried that, not that it would do me much good on Hubitat, but maybe someone could figure out how "inactive" works if it works properly there.

Nearly any Z-Wave or Zigbee contact sensor would work, but to be safe, stick to those from the supported devices page (or search the Community if you find one you like otherwise). You have a lot of options. If you want a lot and for not much money (maybe that's why you went with Xiaomi), one seller currently has a lot of 10 used Iris v2 sensors on eBay: Lot of 10 Iris 3320-L Zigbee Door & Window Contact Sensor | eBay. However, they come without magnets (you could probably re-use the Xiaomi one if it lines up well enough and is strong enough--anyone tried?). This seller or others also has Iris v1 sensors, which do work with Hubitat now, but people seem to have mixed luck with those. But again, you have a lot of options--used or new.

1 Like

Visonic mct-340 are usually cheap new, or on eBay. And fully supported.

1 Like

Download the Hubitat app