[RELEASE] Xiaomi Sensors and Button (beta)

I repushed the latest dth for the motion sensor and I’m finally reporting battery % on all 3 sensors. I’ve had these sensors over a month now. This is an interesting screen shot…

I haven’t been able to “fix” the issue been busy. One thing I’d try is switching them to C instead of Friday measurement.

I figured out what I was doing wrong…I was using the standard DTH instead
of the one specifically for the Aqara. Solved the problem in a heartbeat.

Would you mind sharing link or code for the right DH. TIA

Has anyone successfully and repeatedly paired the temp/humidty sensors?
I can pair the motion and button without issue but I have 2 new temp/humidity sensors that won’t pair. I don’t even get anything in the logs for a catchall - nada.
Batteries test fine. LED’s blink as per usual on reset.
i’m using the standard DTH from @a4refillpad and v1/v2 hubs.

I had issues where the Aquara Leak Sensor was not getting recognized at all. Here is what I had to do for it to work (putting it in beginner words, as I am a beginner):

  1. Look at this thread: Xiaomi Zigbee Outlet (Steps to Pair any Xiaomi Zigbee device!) for instructions on how to pair Xiaomi devices in general. Keep this information in mind as you are looking for "catchall: " (without quotes) to show up in IDE (http://ide.smartthings.com).
  2. Put the hub in pairing mode. These devices do not show up so easily when you put the hub in pairing mode, to say the least, and even if you are trying to locate them in Live Logging (a. go to IDE, b. select your location & hub, c. go to Live Logging page).
  3. Follow the reset & pair process:
    a. Hold the sensor down for some time till the light flashes and then turns off (takes around 1 minute or so). Key point to note that once you let go you should see a single flash (my unit was not showing this behavior, so i improvised).
    b. To complete reset, you need to hold it down again and then wait for the light flash to turn off. Reset completes at this step.
    c. Put it in pairing mode, quick press till it flashes, repeat if does not work (in my case it did not work).
    a. Remove the battery cover using a penny.
    b. Hold the battery down with your finger and repeat the step 3.
    c. You should see the "catchall: " show up. Close the lid.
  5. Add the device from IDE using steps mentioned in Step 1. Change the device type to “SmartSense Moisture Sensor” from the list.
  6. Pairing is now complete. You now need to establish the link between the sensor and the device by dunking the sensor in a bowl of water filled shallow, just enough to produce the water leak effect!

ENJOY! Wait for a developer to create a proper device handler for this thing: to get battery status etc.

P.S: Either all of this is fluke (highly likely) or I was drunk (I do not drink) or this actually works (somewhat likely). I was able to reproduce this on two devices.

1 Like

surprised you had had so much trouble. My trial one paired right away as a thing. I have two more coming, one of which i’m going to ship off to someone (who wants to volunteer?) to keep it and try and write a DTH that can get the battery %.

Just got two of the Xiaomi Aqara Temp/Humidity sensors, and wanted to share my experiences with you. I got the square sensors, exactly as described in the link, including the model number on the back of the device. Picked them for the added atmospheric pressure monitoring.

I paired them successfully with my ST Hub v2, firmware 000.018.00022, after about 4 hours of struggling and reading through more than half this thread. This is what worked in the end.

  1. Delete the sensors from ST if they were already added, or start at step 6
  2. The reset process is to hold down the button on the sensor for 3-5 seconds until you get 3 long blinks. This should put it in the pairing mode from what I understand and experienced.
  3. Releasing the button after the holding will do a single blink, and every single press will be a single blink, forcing the sensor to send out an update.
  4. Start the ST app, add a thing.
  5. The sensor will show up as ‘Thing’ with the default device handler. Save the discovered devices, give them a name if desired. The updates will be ‘Unknown’, and you will get no data.
  6. Open SmartThings Web, and add a Device Handler. Add a4refillpad’s Device Handler for the sensor
  7. For each sensor added earlier, select the sensor on the ST web console, and click Edit.
  8. Set the Type to ‘Xiaomi Temperature Humidity Sensor’. The device ID, and zigbee ID will already be filled in and available, so you don’t have to do the manual method. Leave all other details as-is.
  9. Click Update, and you should start seeing updates from the sensors.

There’s one change I made for my Device Handler, to get rid of the hardcoded deviceId. I’m not sure if this makes any difference -
Changed this in the handler
fingerprint profileId: "0104", deviceId: "0302", inClusters: "0000,0001,0003,0009,0402,0405"
To this -
fingerprint profileId: "0104", inClusters: "0000,0001,0003,0009,0402,0405", manufacturer: "Xiaomi Aqara", model: "WSDCGQ11LM"

Hope this helps someone. Also, I’m happy to run any diagnostics or any steps for anyone who’s working on making the device handlers better. I’d like to see the battery status, and pressure stats from the sensor.

Some useful instructions of the Xiaomi manuals as translated by someone else that I found useful - https://docs.google.com/document/d/1zYOjPk4Fttndztbq7hqnCrVLcNKX_AI4uWWjXL6h3nw/edit

There’s about two of the Xiaomi Smart Water Sensors coming in some time in the future. Hopefully, they will give me less of a headache when pairing

Got some of the Xiaomi Temp/humidity sensors (the older round ones). Finally got them paired (I was originally looking at live logging to find the device id, but once I looked under hub events to get it, things went smooth).

They are paired up and do report temperature, although the refresh feature does not seem to refresh data on command. Not sure why.

A question/issue I have is that every so often (every hour ish) they will show Last Update on their main screen as if the data was refreshed and is up to date according to that last update time, but in the “recently” tab the events show that only checkin was completed for the last bunch of events (every hour ish), but the last new temp/humidity/battery data receive event was like 6-8 hours ago. Hitting refresh usually doesn’t do anything, but if it does, it will update the “Last Update” date/time on the main page, and a lastcheckin event will show, but again, the battery/humidity/temp data points don’t change and the events don’t show new data for those. It’s only been a day but the temp/humidity/battery data seems to just update when it feels like it and nothing to do with checkins or refresh requests.

Is this normal? Maybe a bug? Anything I can try?

I will try this little change to see if it helps. I have tried the battery removal technique as well but I get nothing in the logs. I haven’t tried the “one minute” press for reset so I’ll give that a try as well. Was looking at live logging also so will look under hub events for some clues.

My sensors started with 3% after pairing. Here’s the info: catchall: 0104 0000 01 01 0100 00 0C52 00 04 115F 0A 01 01FF421D0121490C0328180421A81305214F00062404000300000A210000641000

Obviously not correct, but maybe it will get the ball rolling.

Model # is MCCOQ1LM.

To partially answer my own question above, I noticed a note in the code that the refresh is not expected to work. I can see the refresh command is sent via logging, but usually doesn’t do anything. Sometimes it will do a lastcheckin update a minute or two later but I’m not entirely sure it’s related.

As far as temps not updating I did a little experimentation and it seems like the temp is only reported when it changes by 0.9 degrees F. Most updates are exactly 0.9 apart. I put the sensors in radically different temperature area from where they were and the updates rolled in automatically in 0.9 to 1.0 degrees F increments (not time based, change in temp based). Humidity appears to send updates on a 1% change basis. Battery I couldn’t get a feel for as presumably the battery is fairly stable, but the couple updates I did get were 4% changes.

My final question is – is this amount of change required to send an update something I can control via changes in the device handler? Looked quick and didn’t see anything obvious? I wouldn’t care as much if the refresh worked to pull the latest data but as is I wouldn’t mind getting a little more resolution on updates (no real reason other than more updates would inspire more confidence that it’s working and updating properly).

Let me try to find it…I can’t remember where it was!

Can you try the solution in my previous post? After you update your DH, you might need to wait up to a day, because the sensors report battery % about once a day.

Which sensor does this work with aeozyalcin? I briefly tried it yesterday, but it made no difference. I will leave the code in longer today. For a Xiaomi Aqara contact sensor (model # MCCOQ1LM), I used Brian Sparanger’s forked code from here to finally get battery % (https://github.com/bspranger/Xiaomi/blob/master/devicetypes/a4refillpad/xiaomi-aqara-door-window-sensor.src/xiaomi-aqara-door-window-sensor.groovy).

For the motion sensors, I’ve inserted your code. The bigger issue with the motion sensor right now is that it’s going offline (or at least it did last night) after 5 hours of inactivity. If it stays connected, I’ll report back to see if the battery % is working.

I updated the code last night, it didn’t change anything right away but checked it today and both contact sensors are reporting 100%, thanks

Finally found it…try this


1 Like

All of my Xiaomi motion and door/window sensors became unresponsive today after many months of smooth sailing. I tried rebooting ST hub and short-pressing the pair button on the motion sensor but it didn’t work. Anyone else having an issue all of a sudden?

Try removing the battery and replacing it after a few seconds. Shouldn’t have to pair it again since it’s already paired. I see this like if there was a power outage or the internet went down


Does anyone have any further guidance on how to pair this device? https://www.gearbest.com/alarm-systems/pp_610095.html?utm_source=email_sys&utm_medium=email&utm_campaign=shipping6
The xiaomi WXKG02LM. (it is a zigbee device).

While putting my ST app to “add a thing”, I have pressed the button for 5 seconds until the blue lights flashed 3 times. While at the same time, reviewing my ST logs. There was no “catchall” shown :frowning: I repeated the process 6 times for good measure).

I can’t think what else to do, any further guidance is welcome.

Many thanks