[OBSOLETE] Xiaomi Sensors and Button (beta)

I forgot, I also have eight xiaomi motion sensors (app/button presses paired)
Never had a dropout of any xiaomi sensors.
Only unstable thing I have is a fibaro plug, it got unstable/unavailable after the last firmware update.


Got 4 of the Temperature Sensors… One for my Small Freezer one for my Fridge on for its Freezer and one for my Ice Machine (its been left off before and DARN NO ICE) I 3D Printed these holders used a Loop of clear tape to hold them in the freezers (the small one uses Magnets on the outside of the Freezer And the main freezer has a loop on the shelf grate) Now I can monitor all of my cold Devices …

If anyone wants this I can add it to my Thingiverse Account (SuperMouseDV of course) let me know…


i can not pair two new ones and one i had paired now drops out

Ok, then it’s not just me who’s having problems, I have contacted support so let’s hope they will look into it.

i got two new ones last week and emailed the supplier saying there broken. now the one that was working has dropped out and wont work at all
support have been emailed.

Did you add them with catchall? You have to remember that using catchall the Network ID can change and so it will drop off. Using catchall is pretty unreliable and you really should add them with the Add Thing and the pairing button. Add a Thing, press the pairing button once, wait for the LED to respond ( 2 to 4 seconds), press again, wait…, keep repeating and the LED will after a time respond with 3 flashes, keep repeating until it appears on the screen, Rename, Save

Can you be a little more specific as to what sensors you are actually referring to also? Motion? Find it strange that they are all faulty.

Also make sure that all other hard wired Zigbee devices are powered OFF at the mains before you start to pair as routing via a different device will also cause issues. If this does not solve things then remove the batteries and power the hub down for 30 minutes (I think it is ~20mins but I always leave it off for 30 to be safe). This should for a mesh rebuild.

EDIT: your sensors do not have the same Network ID, they are most likely not faulty. The ID is generated at random which is picked up using catchall, this is why so many people have trouble with the sensors dropping off etc. as this ID is generated randomly and it changes after a dropout, reboot etc. I have paired all my sensors (over 40 of them over the last 6 or so months) and not had a single issue as I never used Catchall. I also tested a few new (out the box) yesterday and they paired without issue but everyone’s setup is different and other sensors etc. can interrupt the pairing process so just make sure you turn off any other hard wired Zigbee devices etc.

1 Like

ill give it ago now
they are motion sensors.
ill turn off all bulbs etc and try again
thanks for updating

all turned off
have tried this one aswell

is this similar to what you are saying

Hi can you add this to your Thingiverse account please

How can you find the firmware version? I’m looking in the details in the SmartThings IDE and don’t see any details.

Your Wish is my command :slight_smile:

1 Like

kept trying and it finally turned up. the original one i had catchall. this time i just kept pressing the button till it showed up
now to try the newer ones

1 Like

One thing that helps me with these Xiaomi devices is once I get them to show in the catchall (events/ ALL)
and I save them as a new thing. I re add them via the add things and pressing the button a few times and they
then STICK very well…

1 Like

In the app, press the “more” tab and then its behind the “hub is online”

going for the second reset of the whole network.

So I spent this weekend looking into plugins and code to figure out why my window/door sensors didn’t work as nicely. Even though i was able to pair it using your DH and the catchall method some things weren’t working such as battery levels and the refresh kicked errors in the log (not sure what else may break because of this).

I was able to make a few modifications to get mine working and just want to share in case this helps.

First, i added to the fingerprint. I’m not sure if these sensors have different fingerprints for whatever reason but once I added the extra line it was picking it up right away as I added it as a thing. I just added this to the line below the original.

fingerprint endpointId: “01”, inClusters: “0000,0003,FFFF,0006”, outClusters: “0000,0004,FFFF”, manufacturer: “LUMI”, model: “lumi.sensor_magnet.aq2”, deviceJoinName: “Xiaomi Aqara Door Sensor”

Second, to fix the battery issue I made a change in the parseCatchAllMessage to grab the battery level from a different location. I monitored the cluster.data from the sensors over the weekend and found that location wast he only location that consistently went down and hopefully that signaled battery drain.

resultMap = getBatteryResult(cluster.data.get(6))

However, the value pulled there is a percentage measured out of 255 so I had to make a modification to the getBatteryResult routine to do the calculation below and return it. That gave me very good readings from all of my sensors.

def battLevel = Math.round((rawValue / 255) * 100)
result.value = battLevel

With these modifications, not only did my sensors add easily using the add things method, but the battery percentage showed up within an hour or so on all of my devices.

I don’t know if there are differences between the various window/door aqara sensors but this is working perfectly. I’m starting to wonder if they make small changes on the sensors that affect things. That is why some people have success with discovery and others don’t.

Hopefully this makes sense.

No help from support, wasted time.

“Thanks for reaching out to us.

I’m very sorry to say your Xiaomi devices aren’t one of our Works With SmartThings. The devices labeled WWST are devices we know work - and work well. For ease of use and plug-and-play setups, we recommend sticking with those on the Works With SmartThings page. Unfortunately, we cannot roll back the Hub firmware to a previous version.

From experience, Xiaomi doesn’t seem to quite follow the standard Zigbee protocol. You may have some luck searching around on our Community Forums to see if any users have any tips on getting these connected up? Otherwise, our Developer documents will guide you through creating your own integrations.

Feel free to let us know if you have any other questions or concerns, we’ll be happy to help out!

Best wishes”

Thank you @SuperMouseDV :slight_smile:

1 Like

Any luck on pairing the new ones ?

one worked after another reboot. and i broke the little switch off the other pressing it so much
will solder back on
another 6 on the way from the 11.11 sales on gearbest, so we will see