I think it’s possible using 2 DDF
On the previous one need to add
"matchexpr": "R.hasCluster(0x01,0x0012)",
Because this cluster is present only on old version
And create a news DDF with
"matchexpr": "R.hasCluster(0x01,0x0012) == false",
With this trick, I think we can use 2 DDF for both devices.
And need to make a DDF that use the cluster 0x0405 0x0402 instead of the Xiaomi cluster.
What is your OS ? to know if it will be easy to edit file.
Do you have both devices versions ?
Edit:
No need the DDF already have the support for both version.
Probably just miss bind/report.
Try with adding to DDF
{
"bind": "unicast",
"src.ep": 1,
"cl": "0x0402",
"report": [
{
"at": "0x0000",
"dt": "0x29",
"min": 60,
"max": 300,
"change": "0x00000064"
}
]
},
{
"bind": "unicast",
"src.ep": 1,
"cl": "0x0405",
"report": [
{
"at": "0x0000",
"dt": "0x21",
"min": 60,
"max": 300,
"change": "0x00000064"
}
]
}
And re-cinclude the device (the device is a sleeper, easier for deconz to set bind/report at inclusion, the device is awake at this moment)
Full DDF
{
"schema": "devcap1.schema.json",
"uuid": "89456203-1e4a-49e4-860c-5b34fa54b4a7",
"manufacturername": "$MF_LUMI",
"modelid": "lumi.sensor_ht.agl02",
"vendor": "Xiaomi Aqara",
"product": "T1 Temperature and Humidity Sensor (TH-S02D)",
"sleeper": true,
"status": "Gold",
"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",
"awake": true
},
{
"name": "attr/name"
},
{
"name": "attr/swversion",
"awake": true,
"parse": {
"at": "0x00F7",
"ep": 1,
"eval": "Item.val = '0.0.0_' + ('0000' + (Attr.val & 0xFF).toString()).slice(-4)",
"fn": "xiaomi:special",
"idx": "0x08",
"mf": "0x115F"
},
"read": {
"fn": "none"
}
},
{
"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"
}
},
{
"name": "config/offset"
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/lastupdated"
},
{
"name": "state/temperature"
}
]
},
{
"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",
"awake": true
},
{
"name": "attr/name"
},
{
"name": "attr/swversion",
"awake": true,
"parse": {
"at": "0x00F7",
"ep": 1,
"eval": "Item.val = '0.0.0_' + ('0000' + (Attr.val & 0xFF).toString()).slice(-4)",
"fn": "xiaomi:special",
"idx": "0x08",
"mf": "0x115F"
},
"read": {
"fn": "none"
}
},
{
"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"
}
},
{
"name": "config/offset"
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/humidity"
},
{
"name": "state/humidity_bis",
"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"
}
},
{
"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",
"awake": true
},
{
"name": "attr/name"
},
{
"name": "attr/swversion",
"awake": true,
"parse": {
"at": "0x00F7",
"ep": 1,
"eval": "Item.val = '0.0.0_' + ('0000' + (Attr.val & 0xFF).toString()).slice(-4)",
"fn": "xiaomi:special",
"idx": "0x08",
"mf": "0x115F"
},
"read": {
"fn": "none"
}
},
{
"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"
}
},
{
"name": "config/offset"
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/lastupdated"
},
{
"name": "state/pressure"
},
{
"name": "state/pressure_bis",
"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"
}
}
]
}
],
"bindings": [
{
"bind": "unicast",
"src.ep": 1,
"cl": "0x0001",
"report": [
{
"at": "0x0021",
"dt": "0x20",
"min": 60,
"max": 3600,
"change": "0x00000001"
}
]
},
{
"bind": "unicast",
"src.ep": 1,
"cl": "0x0402",
"report": [
{
"at": "0x0000",
"dt": "0x29",
"min": 60,
"max": 300,
"change": "0x00000064"
}
]
},
{
"bind": "unicast",
"src.ep": 1,
"cl": "0x0405",
"report": [
{
"at": "0x0000",
"dt": "0x21",
"min": 60,
"max": 300,
"change": "0x00000064"
}
]
}
]
}
If you are on docker and create a new one remove the “uuid”