Xiaomi & Aqara Devices - Pairing & Keeping them connected

ok so RP SMA on the antenna side. thank you.

for posterity and others after me :slight_smile:



yes sorry I was not clear female on the antenna side like these ones RP SMA antenna

1 Like

canadian eh? :wink: /jk

please dont be ... you were clear enough. you asked me to the check the router antenna and i did. so good info.

thank you.

Yup did this. And still doesn't show any devices that report to the sylvania. The strange part is when I add new devices I see them reporting to the plug. I also see the network shifting endpoints around as I add new devices and moving them to the plug to free up space on the repeater the device wants to add to. Its kinda cool to watch this in real time. Things just move around.

However once I stop and start the scan again it doesn't find anything that is connected to the repeater.

I'm thinking I may be missing a configuration setting on the xbee that is stopping it from going through the repeater. Just not sure what.

Great link. Going to read through the manual later when I get a chance.

May be time to start an Xbee thread. This isn't really about "Xiaomi devices" at all anymore.


agreed Xbee should probably have it's own thread now
(@veeceeoh you started this top 10 thread how about another?)
but just to finish replying to a few posts and note an issue people may have with routers and any Xiaomi devices routed through them.

I tested the Xbee3 as a router and a coordinator connected directly to the hub and when you first plug them in they appear to function but if you reboot the hub it goes to zigbee channel 11 and will not change and says the zigbee is disabled. Maybe there is another setting to get them to work but I didn't find it.

After doing this little test I had left the hub unplugged for 15-20 minutes which then caused the zigbee mesh to rebuild and knocked all my devices off my sylvania plug and none rejoined through the sylvania plug or just never rejoined the network period. So I had to add them again with the problem routers (iris,GE etc) disabled.
So be aware If your hub is not connected to battery backup or if you have a extended power outage or you try to rebuild your mesh your Xiaomi devices may fall off if going through a router.

finally just for clarity my xbee3 (as a router) and Xctu settings for scanning end devices routed through sylvania plug. I was able to replicate not finding any end devices but default settings with boxes unchecked worked for finding end devices (not evey scan but within 10-20 minutes of scanning or less).

Xctu scanning settings
"always clear", "remove node" and "read remote node" are all unchecked
zigbee network settings
scanning is "flood"
neighbor discovery timeout is "30 seconds"
time between requests "3 seconds"

Xbee3 (router) configuration (all settings not listed are set to default settings)
CE = join network (0)
ZS = 2
JV = 1
EE = Enabled (1)
E0 = 1
KY = 5a6967426565416c6c69616e63653039
(but will be blank after you write and try to read again it is a write only option for security)

NI - (name it whatever you like)
NH = 30
DD = 3000C
N0 = 3 (originally had recommended 7 but could not find documentation for 7 both work)
BD - 115200 (7)
AP = API enabled (1)
A0 = 1
SP = AF0
SN = 130
D8 = disabled (I do not use them so why have them enabled)
D9 = disabled (I do not use them so why have them enabled)

*I am no expert these are just what worked for me there maybe (are likely) better settings

1 Like

Hi Everyone, I am making my own sensor that happen to be a router as well. I have posted a thread here.
I am curious whether my sensor can also help with xiaomi devices. I have paired my first Xiaomi device which is Aqara Motion sensor. I also forced it as a child of my sensor. It has been a day. I have not seen any issue.

Can you guys help with how long typically xiaomi devices dropped out the network when connecting to incompatible zigbee router? Is the issue typically seen an days or hours?

Is there any Xiaomi devices that worse than the other? I like to get them because I would like to test it.

Thank you. Please let me know what you can share.

I have two Aqara Leak Sensors, two Aqara Buttons and an Aqara Motion Sensor. The leak sensors and buttons have been rock solid. Among the best I own. The motion sensor has been up for two days now, without issue, but did not reconnect when the hub had to be shut down on Thursday morning due to downed power lines from a microburst in our area. I too am curious how the motion sensor will perform over time in my short range zigbee environment (small house). I've heard is has not done so well for some, including @mike.maxwell in the lab.

I also have a door sensor on order to try next (I'm somewhat addicted to the low cost and nice industrial design of these Xiaomi Aqara devices).

I heard that that there are issue with xiaomi devices related routers mistakenly detect the xiaomi aged out of network. I am testing my new xiaomi with a my DIY router/sensor. My goal is to determine whether my DIY router would help to solve some of the aging end devices. The zigbee stack that I uses for the router has some code that handle end device time out. I suspect that it can help.

My personal Xiaomi Motion sensor has been working for more than a day as a child of my DIY router. I just want to know from those who had issue with xiaomi devices how long typically they start to drop. Is it a matter of hours or days?

When I had the iris routers installed the xiaomi devices were consistently dropping off within an hour. They would maybe do one check in and that’s it.

I pulled all the iris routers out and put in sylvania routers and all 50 xiaomi devices have been rock solid.

Tomorrow when nobody is home I’m going to pull one of the routers that have devices routing through it and see what happens.

Thank you for sharing this information. I really appreciate it.

I have a relatively small house as well (1400 sq ft), and my experience with my two Aqara Motion Sensors is that they have no more or fewer issues maintaining a connection with my Hubitat hub (or ST hub for that matter) than any of my other Xiaomi devices.

That said, one of them dropped it's connection last week, and when I re-joined it, it decided to go through my Securifi Peanut Plug, so that connection lasted less than a day. No surprise because in my previous testing I found that Xioami devices just won't stayed connected through the Peanut Plug. My theory is that the Motion Sensor switched from being connected directly to my Hubitat over to the Peanut Plug. I have removed my Peanut Plug from my network completely and will monitor how it goes.

Not surprising because the whole dropped connection issue is apparently due to Xioami devices not correctly following the Zigbee "leave and rejoin" message a hub sends when a device tries to check in after the End Device Aging timeout period has gone past. If your hub was shut down and missed one or more check ins from devices, when it was turned on again it may have asked the devices that had unsuccessfully tried to check in to "leave and rejoin". I base this theory on my experience with having to turn off my hub for some time while doing electrical work. When I booted it up again, some - not all - of my Xiaomi devices did not reestablish their connection and I needed to manually re-join them.

I'm sure your absolutely right about the Xiaomi not being fully compliant with the spec. I did just setup another button last night, and it was interesting that this was the first button I've had drop off. When I received it, I paired it with the hub, but I wasn't ready to put it to use, so I tossed it in a box in the basement, about as far as you can get from the hub and still be inside the house.

Unlike the motion sensor, which I was able to just press the pair button once to get it active in the hub again, I had to completely reset the button and pair it again with the hub. So far it's been fine now that it's in place, and not as far from the hub. Range definitely seems to be a larger issue with Xiaomi than any other device that is actually compliant. Sounds like @gavincampbell may have found a good solution. I'm hopeful it'll work for me too if I start having issues. I really like the size and design of the Aqara products and the prices are just sooooo easy on the wallet. Just received my first Aqara door/window sensor today. Wish me luck!

I think I have too. Today I did a test. Using xtcu I could see that 4 devices were routing through a specific sylvania plug so I pulled that plug. It was offline for about 5 hours and I was hoping the devices would reroute but I also realize that could take up to 24 hours. All they did was stop reporting in. I then plugged the plug back in and the devices came back online without me having to do anything.

This was better than I expected.

I have 4 of the sylvania plugs, one xbee and the hub. Looking at my device map my devices like the hub first, then the xbee and then one of the plugs. I have two plugs with no devices on them but need those plugs anyways so it just adds to the routing.

It has been solid now for a few weeks. No drop offs and I have devices scattered through 3 stories in a 2400 sq ft home. The devices report in almost every hour. Sometimes I can see that they can skip a few hours but they are still online and working.

One of the key things I did also was reset the zigbee stick. It put the hub on channel 23 which makes sense as that won’t cross over with the channels used by my eero. It looks like when you do a reset it does a scan and picks the best channel.

1 Like

I recently changed my HE ZigBee channel to 21 and now I'm rebuilding since 26 didn't seem to be an optimal option.

Using your settings I was able to get the first XBee3 to join but when I use the same config but just changing NI the second one won't pair. Are there any other settings that need to be unique?

I had the same problem a few days ago It was like it was stuck
where the hub initially saw the device but I tried doing some other settings so removed the Xbee and then tried re-pairing it but it didn't finish pairing and then hub would not see the xbee but when I did a scan with my other connected xbees they saw it connected to the hubitat network even though Hubitat didn't see it.
not sure if using Xtcu to recover the xbee and rewrite it's firmware fixed it or setting the problem xbee to an end device and then re-pairing it fixed. After setting it to an end device and re-pairing it to Hubitat. Hubitat could see it then. I could then remove it from Hubitat and reset the xbee setting back to a router and pair it again to Hubitat
I would try the recovery firmware option first.
end devices settings and a few I have also adjusted to attempt improvement
NJ = FF (to extend the joining time might help so device pair to them first)
NH = FF (maybe so devices could travel farther by going through more routers)
AP = 0 (for an end device)
SM = 1 (has to be not 0 for end devices)

of course to pair it after writing all the settings remove power from the xbee then put the hub into pairing and repower the xbee.

Updated last night to the latest FW, and had several Xiaomi devices drop off (last events recorded just before the update), after being connected with no issue before the update. Anyone else suffered this? Hopefully this is the result of the hanging after at 15% which a fix has been released today, but still a little worried. Cheers

1 Like

Not have any issues after the update, but I have experienced Aqara Motion sensors not responding after a reboot. Infrequently though. A press of the pairing button creates a new checkin and then they work fine.

Cheers @SmartHomePrimer, I'm watching the logs like a hawk just in case. It wasn't all of them just some. I've just updated again, and watching..... again. Fingers crossed they start reporting soon.

1 Like

@veeceeoh maybe remove The Orvibo Zigbee Smart Outlets from the list of compatible devices as they appear to cause more trouble than they are worth.
The Orvibo Zigbee Smart Outlets were creating a ghost mac FFFF device that could only be seen with the Xbee scans and created interference with other devices.
They did work with Xiaomi devices but may cause random problems.

Download the Hubitat app