I am trying to create a DDF for the WOOX R7049 smoke detector, see below. I used the code in tuya.cpp as far as possible, and at least test indication works. However, for the “lowbattery” attribute, DP 14 needs to be read out, any idea how to build this in?
{
"schema": "devcap1.schema.json",
"manufacturername": "_TZE200_aycxwiau",
"modelid": "TS0601",
"vendor": "WOOX",
"product": "Smart Smoke Alarm R7049",
"sleeper": true,
"status": "Gold",
"path": "/devices/Woox_smart_smoke_alarm_r7049.json",
"subdevices": [
{
"type": "$TYPE_FIRE_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0xef00"
],
"fingerprint": {
"profile": "0x0104",
"device": "0x0051",
"endpoint": "0x01",
"in": [
"0x0000",
"0xEF00"
]
},
"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/on"
},
{
"name": "config/reachable"
},
{
"name": "state/errorcode",
"awake": true,
"parse": {
"dpid": 11,
"eval": "Item.val = String(Attr.val);",
"fn": "tuya"
}
},
{
"name": "state/fire",
"awake": true,
"parse": {
"dpid": 1,
"eval": "Item.val = (Attr.val == 0 ? true : false);",
"fn": "tuya"
},
"default": false
},
{
"name": "state/lastupdated"
},
{
"name": "state/lowbattery",
"description": "True when the device battery runs low."
},
{
"name": "state/test",
"awake": true,
"parse": {
"dpid": 8,
"eval": "Item.val = (Attr.val == 0 ? false : true);",
"fn": "tuya"
},
"default": false
}
]
}
],
"bindings": [
{
"bind": "unicast",
"src.ep": 1,
"cl": "0xEF00"
}
]
}