Xiaomi & Aqara Devices - Pairing & Keeping them connected

On day 10 with support. They did ask 2 questions but then went silent for for a week.
Update- I reinitialized the device, it now has a new 16 address (4DAB) and still does not show on main Hubitat zigbee settings page, but does respond and also shows on xbee scan. It also shows on the main devices page.

How long do you guys think before support figures this out?

Probably they will not do anything because is not a supported device with a custom driver (2 strikes, hey, I have Xiaomi devices too). This is what I would do, unpair the sensor, if not on the list of devices in HE then hard reset the device, make sure you hard reset it, then take out the battery, now with your XBee, scan your network, create a map and verify each device in the map with the zigbee device list in settings>zigbee, all devices should match the 2 list at this point and all devices should be working so make sure they are communicating, if yes then do not add the offender sensor, maybe is defective, this happens(I work with other security systems, they use zigbee(not HA protocol) to communicate and I seen this before), if at this point you still have a mismatch then post here what you found, but please keep the offender sensor without battery.

Good luck.

1 Like

So on a whim I ordered a xiaomi gateway v2 (Mi).

It's quite small and very elegant.
I found some very interesting things out.
The hub is fixed on zigbee channel 25 and apparently can't be changed.

Once I got into the developer options I saw a very interesting page which spoke about connecting the hub to the internet of things, via particular protocols. I'm thinking for 28 bucks that the hub costs, it's well worth it as you'll save hundreds in sensor costs, if we can get the Mi hub to communicate with hubitat.
This is the IOT "secret" page

1 Like

Yes, I think integrating the Xiaomi hub with HE is a win, like Hue and Yeelight. They mention homekit, maybe Lumi to homekit, homekit to HE for now?

I would be interested in this as well. UDP would be the most likely based on what is listed on that page. At least for the many of us that aren't apple users. :smile:


Old News this is the integration that i posted a few weeks back. This is how openhab and Homeassistant officially support Xiaomi.
Its well documented already.
But HE or anyone on the community hasn't come forward yet with a version yo HE.
I'm no developer sadly to do it myself.

Reposting the link

There is also a SmartThings solution called Mi Connector, though it requires an API Server running on Docker:

When Mi Connector is used with a Xiaomi Gateway, the LAN Communication Protocol developer option does need to be enabled and the Mi Connector API server uses UDP to communicate with the gateway.

Also very interesting is that the Mi Connector solution opens up the control / interaction with other non-ZigBee Lumi / Xiaomi / Aqara / MiJia smart home devices.

However, there are some potential disadvantages:

  • All of the device handlers and smart app would need to be ported to/adapted for use with Hubitat - with the author's permission

  • English is not the first language of the author of Mi Connector, and it may be a challenge to communicate through technical issues in porting the code.

  • Although turning on the LAN Communication Protocol developer option on a Xiaomi gateway does enable direct local LAN communication with Xiaomi devices vis-a-vis the gateway, the WAN connection still remains and the gateway still "phones home" to servers in China for iOS / Android app control and interaction.

  • The Xiaomi hub is limited to connecting to 32 ZigBee end-devices. To increase that limit, only Xiaomi / Aqara mains-powered wall switches can be used as repeaters. Also important for people in the USA: to my knowledge, there's only one model of Aqara wall switch that is suitable for use with 60Hz / 110-120V power.


Thanks for that clarification.

The drivers/smartapp are already ported to Hubitat.

I was under the impression the Mi hub has both control methods local & cloud. so I blocked the internet from the Mi hub and I can still control the hub(change light & sound) via being on the same wifi and using mihome app. I did not get any logs from the door sensor while the internet was off, but I know the hub is still getting the zigbee signal from door sensor, so possibly once the connector is setup, we wouldn't need internet for miHub? but Keith would know better than me.

I have an RPi and have everything setup, the hubitat smart app is finding all 3 devices plus the lumi hub, but none are showing as devices in hubitat, even with drivers loaded. I'm having fun but I've invested over 15 hours fiddling with this. The documentation is sparse and if I can ever get it all functioning properly, I will do a video, as I had to piece stuff together from 5 different posts on various forums.
If the Mihub has to have internet for this to all work, well then, guess my xiaomi devices will stay on hubitat.
Although I'm kinda pissed off, my xiaomi were more stable on ST. I heard some rumblings about an issue with zigbee stack on Hubitat, that supposedly is being worked on, but apparently it's a big job...

1 Like

Thanks for the work.
Would be interesting to know how if Openhab or homeassistant did anything else on their systems.
Through their explanations it seems lan to lan connection basically (same behaviour as Hue).

I have a couple Aqara Motion sensors. Most of the time they work great. I have lots of ikea outlets around the house and very close to these motions. They have been unresponsive a handful of times in the last week or so. I dont need to re-pair or anything to get them back up and running they just seem to come back as im about to start troubleshooting.

I do have a smartthings outlet in my laundry room that runs my boiler, should i get rid of this? i'm thinking maybe at times the motions are routing through this outlet? Or at least trying to?

Do you have an xbee? I have a mesh just for xiaomi and Tradfri outlets, right now I have 1 outlet and 12 xiaomi sensors, the map on xbee shows me that only 3 Xiaomi sensors are connected to the outlet, and the odd thing is I have some Xiaomi sensors futher than the outlet(from hub) and with better RSSI than the outlet and the sensors connected to the outlet instead to the hub, I suppose is a reading error with the outlet because one sensor is like 3 ft away from the outlet and it has a very low RSSI, but the other sensor (connected directly to hub) that is further from hub and outlet, like 5 ft from the outlet, gets better RSSI readings. Anyway, what I mean is, xiaomi devices choose whatever they want, so maybe doing a map of your mesh will be good, or probably the ST outlet is a problem.

1 Like

@jasonbalsor, I've got 2 Hubitat hubs now. One for testing the other that handles the day-to-day stuff.

On the main hub I have nothing but 4 Tradfri Outlets and no other Zigbee repeaters. I have Sengled bulbs throughout the house and half dozen Xiaomi devices scattered around. Also I have several Iris v2 devices in the mix.

As long as I don't add an Iris 3210-L smart plug into that setup everythings is stable. I've run that main system for a month with no issues. When I tested by adding a Iris smart plug in that system in a location where a couple of Xiaomi devices might jump to the Iris plug, one of them did and at some point that Xiaomi temp sensor dropped out of the mesh.

On the second C5 hub I have that setup using nothing but Iris 3210-Ls for repeaters. Like the main hub I have Sengled bulbs that don't repeat for lights and several other Iris sensors and fobs.

The one detail I've noticed when comparing these two setups is the Iris Smart Plugs do repeat stronger and further than the Ikea Tradfri Smart Plugs. I've measured this on a mailbox sensor and a door contact sensor on an out building and in both cases the Iris plug will repeat at least to a distance 10' further than the Tradfri plug.

1 Like

And based on my findings I believe issue he has is the ST plug repeats stronger than the ikea and some sensors are moving to it then dropping the mesh.

1 Like

This is what im thinking, I will swap that ST for an existing ikea (move one from the bedroom) and let it settle for a while and see. Or get a zwave outlet for the boiler.

With the Hub 2.0.6 update that includes the "ZigBee stack stability" improvements, I'm going to wait until I have a fair chunk of time set aside to check that it doesn't affect the "fragile" state of affairs with Xiaomi / Aqara devices.

Are there any Xiaomi / Aqara users who have already taken the leap?

yes I updated my hub to 2.0.6 Xiaomi temp/humidity and motion are reporting fine.

I did. So far so good.

EDIT: Nope... None of the Aqara temp/humidity sensors are updating any more. :frowning:

It has been 30 minutes since I updated my hub and no issues

I did. Disaster has struck.
70% were not working after the update. Re-paired them OK.
The rest then dropped off.
Now just been round all the devices and re-paired them.
Not hopeful that they will remain connected. :rage: