AQARA Temperature and Humidity Sensor T1

Name: Aqara Temperature and Humidity Sensor T1
Model: TH-S02D
Link: Aqara Temperature and Humidity Sensor T1 WSDCGQ12LM Zigbee compatibility

I’m unable to connect this device to the ConBee III, and I’m not sure if it is currently supported. Probably not??

Please add support for this device. It also uses the Zigbee protocol.

Is anyone else experiencing the same issue?

It seem it is supported > deconz-rest-plugin/devices/xiaomi/xiaomi_wsdcgq12lm_t1_temp_hum_sensor.json at master · dresden-elektronik/deconz-rest-plugin · GitHub
Can you compare the model id and the manufacture name ?

  "manufacturername": "LUMI",
  "modelid": "lumi.sensor_ht.agl02"

And what is your deconz version, old version on branch 2.27 have problem with “short” manufacture name

"manufacturername": "$MF_LUMI",

I’m using ioBroker and deConz adapter (v 2.26.3)

Manufacturer: Lumi United Technology Co., Ltd.
Model: TH-S02D

I think the model id is different → not WSDCGQ12LM but TH-S02D

The DDF referenced by Smanar is indeed the right one for the device. When it was created back in the days, I haven’t had the device here for testing. However, I noted the wrong Xiaomi model ID as well and would have sworn that I changed it, including renaming the file.

Must have been in a parallel universe :smile:

I m saying model id and Manufacture name from the device itself, not the packaging.
I have search on another project and it seem value are good (or I don’t see the bad one …)

fingerprint deviceJoinName: "Aqara Temperature, Humidity & Pressure Sensor (WSDCGQ12LM)", model: "lumi.sensor_ht.agl02", modelType: "Aqara WSDCGQ12LM", profileId:"0104", endpointId:"01", inClusters:"0000,0003,0402,0405,0403,0001", outClusters:"0019", manufacturer:"LUMI"

Deconz use only “lumi.sensor_ht.agl02” and “LUMI” to select the DDF, will be usefull to check in deconz direclty.

I have 3 of these sensors now, and have noticed that the pressure sensor is having an issue. I am pretty sure I have seen it switch from values in the 10s to values in the 1000s on one of the sensors. Don’t have screenshot handy but was wondering if it is most likely a hardware issue or if it could possible be something in deCONZ? Though I can’t see how.

Yes you can edit the DDF.
I don’t understand why there is a state/pressure_bis on the sensor, can you check all values using for exemple Phoscon/help/API Information/sensors

Need to see wich one value is bad, state/pression or state/pression_bis

And can edit the DDF, but ATM the value is already / 100, so need to be / 100 000, it make too much for me

        {
          "name": "state/pressure_bis",
          "awake": true,
          "parse": {
            "at": "0x00F7",
            "ep": 1,
            "eval": "R.item('state/pressure').val = Math.round(Attr.val / 100) + R.item('config/offset').val",
            "fn": "xiaomi:special",
            "idx": "0x66",
            "mf": "0x115F"
          }
        }

Can try to remove this part and use only

        {
          "name": "state/pressure"
        },

I also use this sensor. There are two very similar models: the older Aqara WSDCGQ12LM and the newer T1 th-s02d.
I have four T1 version sensors. I’m also experiencing a problem with randomly displaying atmospheric pressure. I don’t understand where the problem lies. Does the DDF correspond to this model?
I applied an offset of 23 to the four sensors, which is the problem I noticed with a Netatmo weather station. So, I no longer display 10 when the error appears, but 33.
Below are my recent readings: all the sensors are affected by the problem; 22 out of 55 readings are incorrect. I don’t see any threads online indicating that this pressure sensor is defective.

00:01 ^ sensor {“id”:165,“state”:{“pressure”:1027}} lumi3P
00:02 ^ sensor {“id”:162,“state”:{“pressure”:1027}} lumi2P
00:08 ^ sensor {“id”:162,“state”:{“pressure”:33}} lumi2P
00:09 ^ sensor {“id”:162,“state”:{“pressure”:1026}} lumi2P
00:12 ^ sensor {“id”:162,“state”:{“pressure”:1027}} lumi2P
00:27 ^ sensor {“id”:165,“state”:{“pressure”:33}} lumi3P
01:15 ^ sensor {“id”:156,“state”:{“pressure”:1027}} lumi1P
01:16 ^ sensor {“id”:168,“state”:{“pressure”:1027}} lumi4P
01:24 ^ sensor {“id”:168,“state”:{“pressure”:33}} lumi4P
01:25 ^ sensor {“id”:165,“state”:{“pressure”:1027}} lumi3P
01:26 ^ sensor {“id”:168,“state”:{“pressure”:1027}} lumi4P
01:50 ^ sensor {“id”:156,“state”:{“pressure”:33}} lumi1P
01:58 ^ sensor {“id”:162,“state”:{“pressure”:33}} lumi2P
02:14 ^ sensor {“id”:162,“state”:{“pressure”:1027}} lumi2P
02:17 ^ sensor {“id”:165,“state”:{“pressure”:33}} lumi3P
02:19 ^ sensor {“id”:168,“state”:{“pressure”:33}} lumi4P
02:22 ^ sensor {“id”:168,“state”:{“pressure”:1027}} lumi4P
02:22 ^ sensor {“id”:156,“state”:{“pressure”:1028}} lumi1P
02:39 ^ sensor {“id”:165,“state”:{“pressure”:1028}} lumi3P
02:43 ^ sensor {“id”:165,“state”:{“pressure”:1027}} lumi3P
02:45 ^ sensor {“id”:156,“state”:{“pressure”:33}} lumi1P
02:47 ^ sensor {“id”:156,“state”:{“pressure”:1027}} lumi1P
02:53 ^ sensor {“id”:162,“state”:{“pressure”:33}} lumi2P
03:02 ^ sensor {“id”:162,“state”:{“pressure”:1027}} lumi2P
03:12 ^ sensor {“id”:165,“state”:{“pressure”:33}} lumi3P
03:14 ^ sensor {“id”:168,“state”:{“pressure”:33}} lumi4P
03:28 ^ sensor {“id”:168,“state”:{“pressure”:1027}} lumi4P
03:28 ^ sensor {“id”:156,“state”:{“pressure”:1028}} lumi1P
03:39 ^ sensor {“id”:156,“state”:{“pressure”:1027}} lumi1P
03:40 ^ sensor {“id”:156,“state”:{“pressure”:33}} lumi1P
03:45 ^ sensor {“id”:156,“state”:{“pressure”:1028}} lumi1P
03:48 ^ sensor {“id”:162,“state”:{“pressure”:33}} lumi2P
03:59 ^ sensor {“id”:156,“state”:{“pressure”:1028}} lumi1P
04:09 ^ sensor {“id”:168,“state”:{“pressure”:33}} lumi4P
04:35 ^ sensor {“id”:156,“state”:{“pressure”:33}} lumi1P
04:37 ^ sensor {“id”:165,“state”:{“pressure”:1028}} lumi3P
04:40 ^ sensor {“id”:162,“state”:{“pressure”:1028}} lumi2P
04:42 ^ sensor {“id”:162,“state”:{“pressure”:33}} lumi2P
05:02 ^ sensor {“id”:165,“state”:{“pressure”:33}} lumi3P
05:18 ^ sensor {“id”:165,“state”:{“pressure”:1027}} lumi3P
05:19 ^ sensor {“id”:162,“state”:{“pressure”:1027}} lumi2P
05:29 ^ sensor {“id”:165,“state”:{“pressure”:1028}} lumi3P
05:31 ^ sensor {“id”:162,“state”:{“pressure”:1028}} lumi2P
05:37 ^ sensor {“id”:162,“state”:{“pressure”:33}} lumi2P
05:57 ^ sensor {“id”:165,“state”:{“pressure”:33}} lumi3P
06:25 ^ sensor {“id”:156,“state”:{“pressure”:33}} lumi1P
06:26 ^ sensor {“id”:168,“state”:{“pressure”:1028}} lumi4P
06:29 ^ sensor {“id”:168,“state”:{“pressure”:1027}} lumi4P
06:35 ^ sensor {“id”:168,“state”:{“pressure”:1028}} lumi4P
06:47 ^ sensor {“id”:165,“state”:{“pressure”:1028}} lumi3P
06:47 ^ sensor {“id”:162,“state”:{“pressure”:1028}} lumi2P
06:52 ^ sensor {“id”:165,“state”:{“pressure”:33}} lumi3P
06:53 ^ sensor {“id”:168,“state”:{“pressure”:33}} lumi4P
07:11 ^ sensor {“id”:156,“state”:{“pressure”:1028}} lumi1P
07:11 ^ sensor {“id”:168,“state”:{“pressure”:1028}} lumi4P

If I look at the requests on lumi3, the pressure is 33. On RealVNC it is 1005

The DDF for T1 th-s02d is xiaomi_th-s02d_t1_temp_hum_sensor.json
Isn’t the error here:
for pressure:

Item.val = Attr.val + R.item('config/offset').val

for pressure_bis:

R.item('state/pressure').val = Math.round(Attr.val / 100) + R.item('config/offset').val

I changed pressure_bis from Math.round(Attr.val / 100) to Attr.val
Edit : Test running since 5 hours without error…

I think the error is coming from the DDF. The reports I found online came from people also using deCONZ. Aqara device broken? - Hardware - Home Assistant Community
I did a PR (if I did it correctly)

Missed ^^, I don’t see the PR.

The issue is only on pressure ?
The DDF is able to work with 2 report, the classic on Pressure cluster, and a second on the Xiaomi cluster, will be be nice to know wich one is the fautly.

Can add a “security” like

"eval": "if (Attr.val > 0) { Item.val = Attr.val; }"

But on Z2M they have removed the Xiaomi return for pressure


                } else if (["WSDCGQ12LM"].includes(model.model)) {
                    // This pressure value is ignored because it is less accurate than reported in the 'scaledValue' attribute
                    // of the 'msPressureMeasurement' cluster
                }

I’m using [‘state’][‘pressure’]. It’s the one that comes up with the websocket.
In any case, the calculation is wrong. My sensors no longer have errors. I’m not used to doing a PR; it’s annoying.

Both are using state/pressure


        {
          "name": "state/pressure_bis",
          "awake": true,
          "parse": {
            "at": "0x00F7",
            "ep": 1,
            "eval": "R.item('state/pressure').val = Math.round(Attr.val / 100) + R.item('config/offset').val",
            "fn": "xiaomi:special",
            "idx": "0x66",
            "mf": "0x115F"
          }
        }

Is a fake field, it update too “state/pressure”

Do you have a link to your PR for I check what is wrong ? Perhaps you need to create a new clean branche ?

But you can try to do like Z2M just remove “state/pressure_bis”

{
“schema”: “devcap1.schema.json”,
“manufacturername”: “$MF_LUMI”,
“modelid”: “lumi.sensor_ht.agl02”,
“vendor”: “Xiaomi Aqara”,
“product”: “T1 Temperature and Humidity Sensor (TH-S02D)”,
“sleeper”: true,
“status”: “Gold”,
“path”: “/devices/xiaomi/xiaomi_th-s02d_t1_temp_hum_sensor.json”,
“subdevices”: [
{
“type”: “$TYPE_TEMPERATURE_SENSOR”,
“restapi”: “/sensors”,
“uuid”: [
“$address.ext”,
“0x01”,
“0x0402”
],
“fingerprint”: {
“profile”: “0x0104”,
“device”: “0x0302”,
“endpoint”: “0x01”,
“in”: [
“0x0000”,
“0x0402”,
“0xFCC0”
]
},
“items”: [
{
“name”: “attr/id”
},
{
“name”: “attr/lastannounced”
},
{
“name”: “attr/lastseen”
},
{
“name”: “attr/manufacturername”
},
{
“name”: “attr/modelid”
},
{
“name”: “attr/name”
},
{
“name”: “attr/swversion”
},
{
“name”: “attr/type”
},
{
“name”: “attr/uniqueid”
},
{
“name”: “config/battery”,
“awake”: true,
“parse”: {
“at”: “0x00F7”,
“ep”: 1,
“fn”: “xiaomi:special”,
“idx”: “0x01”,
“mf”: “0x115F”,
“script”: “xiaomi_battery.js”
},
“default”: 0
},
{
“name”: “config/offset”,
“default”: 0
},
{
“name”: “config/on”
},
{
“name”: “config/reachable”
},
{
“name”: “state/lastupdated”
},
{
“name”: “state/temperature”,
“default”: 0
},
{
“name”: “state/temperature_bis”,
“public”: false,
“awake”: true,
“parse”: {
“at”: “0x00F7”,
“ep”: 1,
“eval”: “R.item(‘state/temperature’).val = Attr.val + R.item(‘config/offset’).val”,
“fn”: “xiaomi:special”,
“idx”: “0x64”,
“mf”: “0x115F”
},
“default”: 0
}
]
},
{
“type”: “$TYPE_HUMIDITY_SENSOR”,
“restapi”: “/sensors”,
“uuid”: [
“$address.ext”,
“0x01”,
“0x0405”
],
“fingerprint”: {
“profile”: “0x0104”,
“device”: “0x0302”,
“endpoint”: “0x01”,
“in”: [
“0x0000”,
“0x0405”,
“0xFCC0”
]
},
“items”: [
{
“name”: “attr/id”
},
{
“name”: “attr/lastannounced”
},
{
“name”: “attr/lastseen”
},
{
“name”: “attr/manufacturername”
},
{
“name”: “attr/modelid”
},
{
“name”: “attr/name”
},
{
“name”: “attr/swversion”
},
{
“name”: “attr/type”
},
{
“name”: “attr/uniqueid”
},
{
“name”: “config/battery”,
“awake”: true,
“parse”: {
“at”: “0x00F7”,
“ep”: 1,
“fn”: “xiaomi:special”,
“idx”: “0x01”,
“mf”: “0x115F”,
“script”: “xiaomi_battery.js”
},
“default”: 0
},
{
“name”: “config/offset”,
“default”: 0
},
{
“name”: “config/on”
},
{
“name”: “config/reachable”
},
{
“name”: “state/humidity”,
“default”: 0
},
{
“name”: “state/humidity_bis”,
“public”: false,
“awake”: true,
“parse”: {
“at”: “0x00F7”,
“ep”: 1,
“eval”: “R.item(‘state/humidity’).val = Attr.val + R.item(‘config/offset’).val”,
“fn”: “xiaomi:special”,
“idx”: “0x65”,
“mf”: “0x115F”
},
“default”: 0
},
{
“name”: “state/lastupdated”
}
]
},
{
“type”: “$TYPE_PRESSURE_SENSOR”,
“restapi”: “/sensors”,
“uuid”: [
“$address.ext”,
“0x01”,
“0x0403”
],
“fingerprint”: {
“profile”: “0x0104”,
“device”: “0x0302”,
“endpoint”: “0x01”,
“in”: [
“0x0000”,
“0x0403”,
“0xFCC0”
]
},
“items”: [
{
“name”: “attr/id”
},
{
“name”: “attr/lastannounced”
},
{
“name”: “attr/lastseen”
},
{
“name”: “attr/manufacturername”
},
{
“name”: “attr/modelid”
},
{
“name”: “attr/name”
},
{
“name”: “attr/swversion”
},
{
“name”: “attr/type”
},
{
“name”: “attr/uniqueid”
},
{
“name”: “config/battery”,
“awake”: true,
“parse”: {
“at”: “0x00F7”,
“ep”: 1,
“fn”: “xiaomi:special”,
“idx”: “0x01”,
“mf”: “0x115F”,
“script”: “xiaomi_battery.js”
},
“default”: 0
},
{
“name”: “config/offset”,
“default”: 0
},
{
“name”: “config/on”
},
{
“name”: “config/reachable”
},
{
“name”: “state/lastupdated”
},
{
“name”: “state/pressure”,
“default”: 0
},
{
“name”: “state/pressure_bis”,
“public”: false,
“awake”: true,
“parse”: {
“at”: “0x00F7”,
“ep”: 1,
“eval”: “R.item(‘state/pressure’).val = Attr.val + R.item(‘config/offset’).val”,
“fn”: “xiaomi:special”,
“idx”: “0x66”,
“mf”: “0x115F”
},
“default”: 0
}
]
}
]
}

I don’t see the change, you have just added a defaut value ? and it’s working now ?

I only changed one line at the very bottom:

“eval”: “R.item(‘state/pressure’).val = Attr.val + R.item(‘config/offset’).val”,

Yes, it works without any problems for the display; I no longer have a parasitic ‘10’ value.
Regarding your explanation above, I don’t know how to check if the atmospheric pressure indicated is accurate. My use is to know the general limit of 1013 hPa, the rain/dry limit. If the pressure can be more precise, why not do it? If you tell me the modification to make, I’ll make it on my system.

Ha yes, so the problem is the convertion, we don’t need /100, good catch.

If you tell me the modification to make, I’ll make it on my system.

No, if the result is 1013, you are necessarily right, I don’t see what else could the value be.

But I still don’t see your PR ^^, try create a new branch, then edit the file and use the button “new pull request” “from” your PR/branch “to” base/master

It’s done. I always have trouble making a PR :frowning:

Lol, np I m seing it, perfect.