SmartThings Community

Zigbee - from flakey to stable

(Keith G) #157

This does not match my experience with my two Aqara Motion Sensors. If they are dropping off after about 2 hours then it’s likely because of end device aging timeout, but this hasn’t been an issue with the ST v2 hub for a while. It is an issue with other hub types, such as the Samsung Connect Home or the Samsung ST Link for NVIDIA Shield TV. Are you using a v2 hub?

It may be possible that with adjusted sleep timeout settings on an XBee (SN = AF0 & SP = 130 or higher, as described in this post,) you might be able to keep Xiaomi devices connected beyond a non-v2 ST hub’s end device aging timeout period, as long as the are paired and always remain connected via the XBee. But I threw out my Samsung ST Link out of disgust and have most moved over to a Hubitat hub so I don’t think I’ll be testing this theory.

In all my testing, if a Xioami end device shows up as a router in an XCTU scan, it won’t remain connected. Also, I’ve not seen this happen when a Xiaomi device is connected via an XBee, just when connected through my only other Zigbee router, a Securifi Peanut Plug. As I understand it, if the XBee recognizes a device as a router, it will try to send and expect to receive messages only intended for routers, which an end device isn’t going to be capable of. But if it’s working for you, then fantastic!



I have read through both the Xbee2 and Xbee3 manual and I can not find what setting AO = 7 does. I only see settings 0,1,3
I haven’t had any issues just curious where you found this setting.


(Don) #159

I don’t remember off the top of my head.

I think it had something to do with the firmware I loaded into my pro module. I was just putting pieces together from different threads, websites, and people’s help. This was before this became so common and talked about.

I am using firmware 4060 on Zigbee reg family. With function set for Zigbee reg.

Possibly it’s in there somewhere. I should be able to select option 3, but since it is working I have not messed with it.

When I get time to be at my computer I can see if I left any notes and hints there.


(Graeme) #160

Thanks - yes, I had changed the SN and SP settings on my xbee’s.
One of my xBees is a Digi usb x-stick, which I have plugged into a permanently on PC, constantly running scans from XCTU at present. The other is a xBee SC2 plugged into a Waveshare USB adapter. It is currently also plugged into a PC, but I am planning to have it just run from a USB power socket.

Oddly, all but one of my Xiaomi motion sensors have switched from routers to End Devices on their own in the last day.

I have 45 ZigBee devices and my network looks like this:

B9C6 is a XIaomi Motion sensor which is showing as a router.
DE93 is also a Xiaomi Motion Sensor which changed from a router to an End Device
5362 is the Digi X-stick
B1E8 is the xbee SC2
963F and F76C are both ST Power Outlets


(Keith G) #161

Very interesting that a majority of end devices (31) are connected directly to your ST hub. It definitely confirms that the 32 device limit is still just for end devices, and not for routers (repeaters), as was stated here:

So I stand corrected on my previous statement that routers count towards the limit, a few posts up. I could have sworn I read that somewhere here on the forums, but it turns out I was wrong!

Also interesting is that of the other end devices, only 2 of them are “claimed” by a single router. The other 6 are showing a connection via multiple routers. I don’t know enough about the deep ins and outs of Zigbee to know whether that’s normal.

Hopefully those work just as well with Xiaomi and other devices as the developer modules!


(Keith G) #162

Hi again - I have to apologize, because I was incorrect in previously stating that Zigbee routers count towards the 32 device limit. That limit is only for end devices as stated here.

However, you will only be able to pair one more end device that directly connects to the hub, and after that any additional devices need to connect via a router. Since you have so many devices directly connected to the hub, perhaps moving a router closer to the location of the hub would help with your issue of dropped connections - if they are due to weak network connections because of distance and or interference.


(Devesh Batra) #163

appreciate if someone can point me to part numbers for what i need (module, USB adapter…) to get started… tried finding stuff on and its a nightmare …




@ArstenA where did you buy your CR-10S at that price? I have been looking for one


(Brian Spranger) #165

I got mine from lightinthebox.

I have seen them as low as $340 on groupbuys.

Get the CR-10s not the CR-10.

I do think prices have in general gone up on all Chinese import sites.


(Alwas) #166

The last time I used and i was very satisfied with their service.
These are the part numbers.



(Devesh Batra) #167

thanks… i’ll check out mouser

1 Like


Thanks for the info. My zigbee has been strong since implementing the sylvania outlets, but I like to play and want to see the mesh. This made it easy for me.

1 Like


Thanks I will be on the lookout for a groupbuy to come up, right now its going for $440 which is still good i think


[RELEASE] Iris SmartPlug Z-Wave Repeater with Diagnostics

Hi - I am still trying to fix issues on my network, can you advise what you changed the SN & SP values to and why(rationale) ? - I am trying to pickup zigbee skills as much as I can from the docs, but relating that to my network is confusing me at present, thanks.



From the note above “If the SP parameter within the power management component is set to 5000, meaning 5000 mS or 5 seconds, the SP parameter within the coordinator must be set to 5000 / 10 = 500 = 0x1F4 -> 1F4.”

Do we know what the SP parameter is for the coordinator (=hub I believe) ?


(Graeme) #172

Hi, I am no expert - I just experimented with settings after reading the posts above.
At first, I ran into problems when I had more than 32 devices and kept having devices dropping off, particularly the Xiaomi devices.
I then introduced the Xstick - mainly to run XCTU and scan the network to see what was going on. I then got the Xbee SC2 and got that working as a router.
I have set mine as follows in both my xStick and the Xbee SC2:

So I have SN set to AF0 and SP to 64 (which is 1000ms) Since doing this, I have not had any ZigBee device dropouts or issues. The mesh has continued to improve and is supporting 44 ZigBee devices of which the vast majority are Xiaomi devices.

I haven’t tried increasing SP to 5000, because I haven’t needed to, but if I encounter any further flakiness on the network, that is what I’ll try.



Yes I have similar issues - as reported above though the devices I had connected via he routers would drop off over time and I’ve not found a remedy for that yet.
Thanks, will give it a try and see what the impact is.


(Keith G) #174

The suggestion came from @tpmanley in an earlier post in this thread:

The adjustment of these values seems to be needed in order to avoid Xiaomi devices from dropping their connection due to End Device Aging as also described by @tpmanley here:

Long story short, the ST Hub has an End Device Aging timeout that’s shorter than the check-in interval of Xiaomi devices (50 or 60 minutes depending on whether the device is an Aqara model or not). When the Xioami device doesn’t check in soon enough, the ST hub “forgets” that device (drops the connection) and if the device tries to check-in after that, the hub asks the device to leave and rejoin the network. For some reason, Xiaomi devices leave the network but don’t rejoin. So the user see that the ST hub has lost the connection with the device.

Between several hub firmware updates last year, the ST hub first didn’t send the “leave and rejoin” message to devices that didn’t check in often enough, and then the hub did send the message, and then the behavior seems to have reverted to not sending the “leave and rejoin” message.

However, XBee modules operate on a different set of default parameters than the ST hub, with different naming conventions than the Zigbee specification, because (depending on the model) the modules can either be set up for use with a Zigbee network or Digital International’s Digimesh network. So we need to adjust specific parameters on an XBee module to get it to “play” well on a ST Hub’s Zigbee network, and also a couple of parameters (SN and SP) to work with the limitations of Xiaomi devices if you have any. This is because the XBee will also send the “leave and rejoin” message if a device hasn’t checked in before the XBee’s End Device Aging Timeout (known as “Child Poll Timeout” by Digi in the XBee documentation), and we want to avoid “leave and rejoin” message, knowing the Xiaomi device won’t rejoin as requested.

If you mean your SmartThings hub, then no, because it doesn’t have an SP parameter. @tpmanley might be able to answer what the ST hub’s End Device Aging Timeout is. But his suggestion of setting an XBee router’s SN parameter to 0xAF0 and SP to 130 calculates out to a timeout period of a little over 3 hours, which should be plenty (as he states) for a Xiaomi device that checks in every 50 or 60 minutes.

That said, I have seen cases in my testing where after being initially paired or manually rejoined to the network, some of my Xiaomi devices did not check in for 1 or two hours. So in other words, they missed their first couple of check ins. The surest way that I know of to confirm that a Xiaomi device has checked in is to look for a battery percentage report event. Those happen at the same time that Xiaomi devices check in. Keep in mind that a Xiaomi device will happily send open/close, motion detected, temperature, etc. reports even though it’s not checking in, but that will all stop when the hub (or router) asks it to leave and rejoin due to the End Device Aging Timeout.

I know this thread is not supposed to be about Xiaomi devices specifically, so I will say that there could possibly be device timeout issues with other Zigbee devices, and also that by extending the timeout period on an XBee module through changing the SN & SP parameters, you may be obscuring issues with devices that are dropping their connection due to a weak mesh network (low signal strength due to distance / obstacles).


(Alwas) #175

As JDRoberts has mentioned more than once, Xiaomi uses a different protocol that SmartThings, and if you use these devices and are looking for any kind of stability, you are opening yourself up to a whole world of pain. But as he also says, people are different. I guess people’s definition of “fun” varies considerably.

1 Like


Wow what a difference these two sleep settings have made.

As previously mentioned I hit 32 device limit and when I added more Xiaomi devices paired to the xbee routers they showed up as routers themselves and stayed connected for a few hours before dropping off. With 90% connecting to the coordinator (hub).

I have applied these settings to my routers and as you can see the devices all show up as Endpoint now (OK except 1) and have distributed themselves far more evenly etc, and they are stable.

Thanks all !
I just need to add my remaining devices now this looks to work.