From 283dea2166db6f5537e66460ffbb58b81e243c5f Mon Sep 17 00:00:00 2001 From: Smanar Date: Sat, 15 Jun 2024 13:42:14 +0200 Subject: [PATCH] First PR --- devices/nedis/nedis_zbds10wt.json | 116 ++++++++++++++++++++++++++++++ devices/nedis/tuya_swversion.js | 2 + 2 files changed, 118 insertions(+) create mode 100644 devices/nedis/nedis_zbds10wt.json create mode 100644 devices/nedis/tuya_swversion.js diff --git a/devices/nedis/nedis_zbds10wt.json b/devices/nedis/nedis_zbds10wt.json new file mode 100644 index 0000000000..e099fb5f26 --- /dev/null +++ b/devices/nedis/nedis_zbds10wt.json @@ -0,0 +1,116 @@ +{ + "schema": "devcap1.schema.json", + "manufacturername": "_TYZB01_wqcac7lo", + "modelid": "TS0205", + "vendor": "Tuya", + "product": "Smoke Sensor", + "sleeper": false, + "status": "Gold", + "subdevices": [ + { + "type": "$TYPE_FIRE_SENSOR", + "restapi": "/sensors", + "uuid": [ + "$address.ext", + "0x01", + "0x0500" + ], + "fingerprint": { + "profile": "0x0104", + "device": "0x0402", + "endpoint": "0x01", + "in": [ + "0x0000", + "0x0001", + "0x0500" + ] + }, + "items": [ + { + "name": "attr/id" + }, + { + "name": "attr/lastannounced" + }, + { + "name": "attr/lastseen" + }, + { + "name": "attr/manufacturername" + }, + { + "name": "attr/modelid" + }, + { + "name": "attr/name" + }, + { + "name": "attr/swversion", + "parse": {"fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "tuya_swversion.js"}, + "read": {"fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001"} + }, + { + "name": "attr/type" + }, + { + "name": "attr/uniqueid" + }, + { + "name": "config/battery", + "parse": { + "at": "0x0021", + "cl": "0x0001", + "ep": 1, + "eval": "Item.val = Attr.val / 2", + "fn": "zcl:attr" + } + }, + { + "name": "config/enrolled" + }, + { + "name": "config/on" + }, + { + "name": "config/pending" + }, + { + "name": "config/reachable" + }, + { + "name": "state/fire" + }, + { + "name": "state/lastupdated" + }, + { + "name": "state/lowbattery" + }, + { + "name": "state/test" + } + ] + } + ], + "bindings": [ + { + "bind": "unicast", + "src.ep": 1, + "cl": "0x0001", + "report": [ + { + "at": "0x0021", + "dt": "0x20", + "min": 600, + "max": 43200, + "change": "0x00000001" + } + ] + }, + { + "bind": "unicast", + "src.ep": 1, + "cl": "0x0500" + } + ] +} diff --git a/devices/nedis/tuya_swversion.js b/devices/nedis/tuya_swversion.js new file mode 100644 index 0000000000..1aa04c0c3c --- /dev/null +++ b/devices/nedis/tuya_swversion.js @@ -0,0 +1,2 @@ +var v = Attr.val; +Item.val = String((v & 192) >> 6) + '.' + String((v & 48) >> 4) + '.' + String(v & 15);