[RELEASE] Xiaomi Sensors and Button (beta)

Can anyone help me update the temp/humidity sensor for the Aqara and parse the pressure data?

The following lines need to be added:

under capabilities:
capability “Barometric Pressure”

under preferences:
input title: “Pressure Offset”, description: “This feature allows you to correct any pressure variations by selecting an offset. Ex: If your sensor consistently reports a pressure that’s 5 millibars too high, you’d enter ‘-5’. If 3 millibars too cold, enter ‘+3’. Please note, any changes will take effect only on the NEXT pressure change.”, displayDuringSetup: false, type: “paragraph”, element: "paragraph"
input “pressOffset”, “number”, title: “millibars”, description: “Adjust prssure by this many millibars”, range: “”, displayDuringSetup: false

In the tiles section:
standardTile(“pressure”, “device.pressure”, inactiveLabel: false, decoration: “flat”, width: 2, height: 2) {
state “default”, label:’${currentValue} mb’, icon:“st.Weather.weather2”

What I don’t understand is how to parse the pressure message. From the log, it is as follows:
read attr - raw: 1DFC0104031C000029AC03140028FF100029BE24, dni: 1DFC, endpoint: 01, cluster: 0403, size: 1C, attrId: 0000, encoding: 29, value: 24be290010ff28001403ac

The format of the message is: 1DFC: zigbee network id
0104031C: device fingerprint, fixed
000029: filler
24be: pressure in tenths of millibars
290010ff280014: filler
03ac: pressure in millibars

It seems like the sensors are ALWAYS under reporting the pressure (based on my 4 sensors). The data of 0x24be is 9406 while the actual pressure is 1022mb, so an adjustment factor of 814 is required. Since the last section of data is just the first pressure measurement divided by 10. Since precision to the nearest tenth of a millibar isn’t required, the last data set could be used. In this case, an adjustment factor of 81 is required.

To convert to kPa, it’s simply the pressure in millibars divided by 10, so at least conversion on that is easy.

Thanks for the assistance.

If your speaking of the Iris plug there’s a lot of info on the forum on pairing both the zigbee switch and the z-wave repeater. I use several and they pair as 2 separate devices. When paired, the zwave repeater will shows as a switch with off/on control. The switch does nothing and will not turn off the repeater. The zigbee plug will also show as a switch and energy meter.


I have made a pull request for this functionality on github.

1 Like

Hi. I’m comletely new to Smarthings, considering buying one - so apologies this a newbie question.

I have various xiaomi sensors (temp/humidity) and smart wifi power sockets etc.

When we connect say the temp humnidity (zigbee senors) to smarthings, does this still involve the xiaomi original hub, or do the sensors connect directly to smarthings?

Also, does anyone know if the smart wifi power sockets also work with smarth things - I can see from this thread temp and humidity do.

One last question, related to above, in the thread it mentions v1 hubs do not work, v2 only. Is this xiaomi or smarthings hubs?


The sensors connect directly to the smartthings v2 hub. No need for the Xiaomi hub.

I do not have a power socket but there is a device handler for them, so I would guess they work.

Hi @tommyincville just to let you know I am working on same functionality so I know when to ventilate my basement with outside fresh air.

However I do not find using relative humidity and temperature as a good comparison. I am converting the relative humidity to absolute humidity g/m3. Then I can do compare on outside air to inside air.

Please see this DH, with help from @johnconstantelo Help adding tile in DH

Does anyone know if Ikea Tradfri Bulbs (paired to the Smartthings Hub) will act as repeaters for the Xiaomi sensors?

From what I read at the start of this thread, the Smartthings outlets do not, but has anyone done any tests with the Tradfri bulbs?

There isn’t a capability for "Barometric Pressure"
I did add the pressure offset.

The units are in kPa from the xiaomi aqara temp sensor.

the temperature sensor seems to report temperature every 10 mins. is there any way to change this interval?

thank you.

For this device, you are not able to change the poling manually. However, I use community app Polster to force update the device at my prefered interval. Understand this; the current interval is set to save bettery on the device and if you update it frequantly, you will drain the battary faster.



thank you.

1 Like

I recently bought 4 of the motion sensors. All of them paired successfully initially. Two of them stopped reporting within a few hours, and the battery level was never reported for these two.

I unpaired one of them from the ST App. I was not able to pair it back afterwards. How long and how many times I need to press the Xiaomi reset button to ensure it has been unpaired?

Just hold it down for about 5 seconds.

I have one of the motion sensors, and it’s paired okay, but when I get motion, it starts, but never stops (until I press reset motion).

Also, the Configure button doesn’t seem to do anything.

What have I done wrong…?

I am using a temp/humidity sensor and am getting a mega battery drain. It has gone from 100 to 14 in 3 days and this is the second time in a row. Is it maybe a faulty device or is it possible just a problem with getting a correct reading?

Same thing happened to me. But I did not change the batteries the last time, just let it run. It kept working, and after a couple of days at around 1% it jumped up to 98% and have stayed above 90 for a couple of weeks


I always make a point of leaving the newly paired Xiaomi devices near the hub for at least 12 hours before moving them to the final destination. Works for me. In fact it’s the Samsung sensors which get knocked off, in particular the multi sensor which I have on my back door.

1 Like


I am using this device handler in WebCore.
I have created a piston that uses the date attributes which are returned as string. I convert these strings to dates, otherwise i can’t do a date comparison in WebCore.
This string -> date conversions seems to be a problem as this string is not in a correct format.
So i created my own version of the device handler and added two more attributes “lastOpenedDate” and “lastCheckinDate” both of these types are dates.
Now i can use these attributes properly in WebCore.

Basically i changed the following code (not 100% sure if this is correct, but it seems to work in WebCore)

   attribute "lastOpenedDate", "Date"
   attribute "lastCheckinDate", "Date"

In parse:

   def timeDate = new Date(now).getTime()
   sendEvent(name: "lastCheckinDate", value: timeDate)

   if (description?.startsWith('on/off: ')) {

      sendEvent(name: "lastOpenedDate", value: timeDate)

Is it an idea to put this in the standard handler (or something similar)?


I have to say that after 2-3 months with the Xiaomi motion sensors, I am very impressed. I have them set up in my closet and my wife’s to turn on and off the lights based on motion. Paired with a Lutron Caseta in-wall dimmer, the lights turn on in a second or less after we enter the room. I have them in the kids’ rooms to turn off the lights after 15 minutes of no motion. I put one in the shower to automatically turn on the exhaust fan and turn off after 30 min (will adjust in the winter for a longer run time). I’m now over my insecurities with this sensor so I will order more for use in conjunction with the security portion of my ST setup.


I have the button and while it sends a “checkin” every time the button is pressed, I cannot get it to register an actual button press. Any idea what might be wrong? I am using a4’s handler.