[OBSOLETE] Xiaomi Zigbee Outlet (Steps to Pair any Xiaomi Zigbee device!)

Setting aside my emotional state when everything went “belly up”. I decided to conduct some better tests. It seems to repeat for a length of time then just stop and to then switch off the power to the relay at the same time. Hitting refresh and powering the relay back on seems to allow it to work again.

So… creating a simple CoRE piston to detect when the switch is off and to run a refresh and power back on the relay seems to work.
I’m cautious in saying this and the test has only been for 24 hours so far and seems to work. If it does indeed work then it does mean that you will not be able to use this to power any peripherals off attached to it as it will break any heavily laden zigbee networks like mine. The smartthings motion sensors appear to be incapable of recovering when the xiaomi outlet it is attached to goes into this bad state. My theory is that the xiaomi still advertises that it can take incoming connections but just does not relay, almost like some kind of power saving mode. Maybe the Xiaomi hub has some kind of api to deal with this that the smartthings hub lacks.

Another benefit this gives is that the periodic refresh updates the temperature reading if it has changed.