Zigbee - from flakey to stable

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).

2 Likes