diff --git a/devices/generic/items/config_fadingtime_item.json b/devices/generic/items/config_fadingtime_item.json new file mode 100644 index 0000000000..573b279529 --- /dev/null +++ b/devices/generic/items/config_fadingtime_item.json @@ -0,0 +1,9 @@ +{ + "schema": "resourceitem1.schema.json", + "id": "config/fadingtime", + "datatype": "UInt16", + "access": "RW", + "public": true, + "description": "Target disapperance delay time in seconds", + "default": 0 +} diff --git a/devices/generic/items/state_targetdistance_item.json b/devices/generic/items/state_targetdistance_item.json new file mode 100644 index 0000000000..24f7336879 --- /dev/null +++ b/devices/generic/items/state_targetdistance_item.json @@ -0,0 +1,9 @@ +{ + "schema": "resourceitem1.schema.json", + "id": "state/targetdistance", + "description": "Distance from detected target", + "datatype": "Int16", + "access": "R", + "public": true, + "default": 0 +} diff --git a/devices/tuya/ZY-M100_human_breathing_presence.json b/devices/tuya/ZY-M100_human_breathing_presence.json index bbef122c83..f481b10a75 100644 --- a/devices/tuya/ZY-M100_human_breathing_presence.json +++ b/devices/tuya/ZY-M100_human_breathing_presence.json @@ -171,9 +171,12 @@ "default": 1 }, { - "name": "config/duration", + "name": "config/fadingtime", "description": "Fading time : target disapperance delay time in second (from 0 to 15000). Default 90s", - "range": [0, 15000], + "range": [ + 0, + 15000 + ], "read": { "fn": "none" }, @@ -199,7 +202,10 @@ { "name": "config/sensitivity", "description": "Radar sensitivity (from 1 to 9). Default 7", - "range": [1, 9], + "range": [ + 1, + 9 + ], "read": { "fn": "none" }, @@ -219,7 +225,7 @@ { "name": "config/triggerdistance", "description": "Far detection sensitivity", - "read": { + "read": { "fn": "none" }, "write": { @@ -228,28 +234,61 @@ "eval": "Far = ['0','1','2','3','4','5','6','7','8','9','10']; Attr.val = Math.max(0,Far.indexOf(Item.val)*100);", "fn": "tuya" }, - "parse": { + "parse": { "dpid": 4, "eval": "Item.val = String(Attr.val/100);", "fn": "tuya" }, - "values": [ - ["\"1\"", "1m"], - ["\"2\"", "2m"], - ["\"3\"", "3m"], - ["\"4\"", "4m"], - ["\"5\"", "5m"], - ["\"6\"", "6m"], - ["\"7\"", "7m"], - ["\"8\"", "8m"], - ["\"9\"", "9m"], - ["\"10\"", "10m"], - ["\"0\"", "Off"] + "values": [ + [ + "\"1\"", + "1m" + ], + [ + "\"2\"", + "2m" + ], + [ + "\"3\"", + "3m" + ], + [ + "\"4\"", + "4m" + ], + [ + "\"5\"", + "5m" + ], + [ + "\"6\"", + "6m" + ], + [ + "\"7\"", + "7m" + ], + [ + "\"8\"", + "8m" + ], + [ + "\"9\"", + "9m" + ], + [ + "\"10\"", + "10m" + ], + [ + "\"0\"", + "Off" + ] ], "default": "10" - }, - { - "name": "state/angle", + }, + { + "name": "state/targetdistance", "description": "Distance from detected target in cm (from 0 to 1000).", "read": { "fn": "none" diff --git a/devices/tuya/_TS0601_TZE204_qasjif9e_mmwave_radar.json b/devices/tuya/_TS0601_TZE204_qasjif9e_mmwave_radar.json new file mode 100644 index 0000000000..79aeccf91e --- /dev/null +++ b/devices/tuya/_TS0601_TZE204_qasjif9e_mmwave_radar.json @@ -0,0 +1,312 @@ +{ + "schema": "devcap1.schema.json", + "manufacturername": "_TZE204_qasjif9e", + "modelid": "TS0601", + "product": "Tuya MmwRadar Mini human breathe sensor", + "sleeper": false, + "status": "Gold", + "subdevices": [ + { + "type": "$TYPE_LIGHT_LEVEL_SENSOR", + "restapi": "/sensors", + "uuid": [ + "$address.ext", + "0x01", + "0x0400" + ], + "items": [ + { + "name": "attr/lastseen" + }, + { + "name": "attr/manufacturername" + }, + { + "name": "attr/modelid" + }, + { + "name": "attr/name" + }, + { + "name": "attr/swversion", + "refresh.interval": 86400, + "read": { + "at": "0x0001", + "cl": "0x0000", + "ep": 1, + "fn": "zcl" + }, + "parse": { + "at": "0x0001", + "cl": "0x0000", + "ep": 1, + "fn": "zcl", + "script": "tuya_swversion.js" + } + }, + { + "name": "attr/type" + }, + { + "name": "attr/uniqueid" + }, + { + "name": "config/on" + }, + { + "name": "config/reachable" + }, + { + "name": "state/lastupdated" + }, + { + "name": "state/dark" + }, + { + "name": "config/tholddark" + }, + { + "name": "config/tholdoffset" + }, + { + "name": "state/daylight" + }, + { + "name": "state/lightlevel" + }, + { + "name": "state/lux", + "description": "The current light intensity in Lux (max is 2000)", + "read": { + "fn": "none" + }, + "parse": { + "dpid": 104, + "script": "../generic/illuminance_cluster/lux_to_lightlevel.js", + "fn": "tuya" + }, + "default": 0 + } + ] + }, + { + "type": "$TYPE_PRESENCE_SENSOR", + "restapi": "/sensors", + "uuid": [ + "$address.ext", + "0x01", + "0xef00" + ], + "items": [ + { + "name": "attr/id" + }, + { + "name": "attr/lastannounced" + }, + { + "name": "attr/lastseen" + }, + { + "name": "attr/manufacturername" + }, + { + "name": "attr/modelid" + }, + { + "name": "attr/name" + }, + { + "name": "attr/swversion", + "refresh.interval": 86400, + "read": { + "at": "0x0001", + "cl": "0x0000", + "ep": 1, + "fn": "zcl" + }, + "parse": { + "at": "0x0001", + "cl": "0x0000", + "ep": 1, + "fn": "zcl", + "script": "tuya_swversion.js" + } + }, + { + "name": "attr/type" + }, + { + "name": "attr/uniqueid" + }, + { + "name": "config/delay", + "description": "Detection delay : target confirmation delay time in 10th of second (from 0 to 100). Default 0.1s", + "read": { + "fn": "none" + }, + "write": { + "dpid": 101, + "dt": "0x2b", + "eval": "Item.val;", + "fn": "tuya" + }, + "parse": { + "dpid": 101, + "eval": "Item.val = Attr.val;", + "fn": "tuya" + }, + "default": 5 + }, + { + "name": "config/fadingtime", + "description": "Fading time : target disapperance delay time in second (from 0 to 15000). Default 90s", + "range": [ + 0, + 15000 + ], + "read": { + "fn": "none" + }, + "write": { + "dpid": 102, + "dt": "0x2b", + "eval": "Item.val;", + "fn": "tuya" + }, + "parse": { + "dpid": 102, + "eval": "Item.val = Attr.val;", + "fn": "tuya" + }, + "default": 25 + }, + { + "name": "config/on" + }, + { + "name": "config/reachable" + }, + { + "name": "config/sensitivity", + "description": "Radar sensitivity (from 1 to 9). Default 7", + "range": [ + 1, + 9 + ], + "read": { + "fn": "none" + }, + "write": { + "dpid": 2, + "dt": "0x2b", + "eval": "Item.val;", + "fn": "tuya" + }, + "parse": { + "dpid": 2, + "eval": "Item.val = Attr.val;", + "fn": "tuya" + }, + "default": 7 + }, + { + "name": "config/triggerdistance", + "description": "Far detection sensitivity", + "read": { + "fn": "none" + }, + "write": { + "dpid": 4, + "dt": "0x2b", + "eval": "Far = ['0','1','2','3','4','5','6','7','8','9']; Attr.val = Math.max(0,Far.indexOf(Item.val)*100);", + "fn": "tuya" + }, + "parse": { + "dpid": 4, + "eval": "Item.val = String(Attr.val/100);", + "fn": "tuya" + }, + "values": [ + [ + "\"1\"", + "1m" + ], + [ + "\"2\"", + "2m" + ], + [ + "\"3\"", + "3m" + ], + [ + "\"4\"", + "4m" + ], + [ + "\"5\"", + "5m" + ], + [ + "\"6\"", + "6m" + ], + [ + "\"7\"", + "7m" + ], + [ + "\"8\"", + "8m" + ], + [ + "\"9\"", + "9m" + ], + [ + "\"0\"", + "Off" + ] + ], + "default": "6" + }, + { + "name": "state/targetdistance", + "description": "Distance from detected target in cm (from 0 to 1000).", + "read": { + "fn": "none" + }, + "parse": { + "dpid": 9, + "eval": "Item.val = Attr.val;", + "fn": "tuya" + }, + "default": 0 + }, + { + "name": "state/lastupdated" + }, + { + "name": "state/presence", + "read": { + "fn": "tuya" + }, + "parse": { + "dpid": 1, + "eval": "Item.val = Attr.val;", + "fn": "tuya" + }, + "default": false + } + ] + } + ], + "bindings": [ + { + "bind": "unicast", + "src.ep": 1, + "cl": "0xEF00" + } + ] +} diff --git a/devices/tuya/_TZE204_sxm7l9xa_mmwave_radar.json b/devices/tuya/_TZE204_sxm7l9xa_mmwave_radar.json index 1c66adbcfc..68c98dd849 100644 --- a/devices/tuya/_TZE204_sxm7l9xa_mmwave_radar.json +++ b/devices/tuya/_TZE204_sxm7l9xa_mmwave_radar.json @@ -1,231 +1,231 @@ { - "schema":"devcap1.schema.json", - "manufacturername":"_TZE204_sxm7l9xa", - "modelid":"TS0601", - "product":"Tuya Human Presence Detector", - "sleeper":false, - "status":"Silver", - "subdevices":[ + "schema": "devcap1.schema.json", + "manufacturername": "_TZE204_sxm7l9xa", + "modelid": "TS0601", + "product": "Tuya Human Presence Detector", + "sleeper": false, + "status": "Gold", + "subdevices": [ { - "type":"$TYPE_LIGHT_LEVEL_SENSOR", - "restapi":"/sensors", - "uuid":[ + "type": "$TYPE_LIGHT_LEVEL_SENSOR", + "restapi": "/sensors", + "uuid": [ "$address.ext", "0x01", "0x0400" ], - "items":[ + "items": [ { - "name":"attr/lastseen" + "name": "attr/lastseen" }, { - "name":"attr/manufacturername" + "name": "attr/manufacturername" }, { - "name":"attr/modelid" + "name": "attr/modelid" }, { - "name":"attr/name" + "name": "attr/name" }, { - "name":"attr/swversion", - "read":{ - "at":"0x0001", - "cl":"0x0000", - "ep":1, - "fn":"zcl" + "name": "attr/swversion", + "read": { + "at": "0x0001", + "cl": "0x0000", + "ep": 1, + "fn": "zcl" }, - "parse":{ - "at":"0x0001", - "cl":"0x0000", - "ep":1, - "fn":"zcl", - "script":"tuya_swversion.js" + "parse": { + "at": "0x0001", + "cl": "0x0000", + "ep": 1, + "fn": "zcl", + "script": "tuya_swversion.js" } }, { - "name":"attr/type" + "name": "attr/type" }, { - "name":"attr/uniqueid" + "name": "attr/uniqueid" }, { - "name":"config/on" + "name": "config/on" }, { - "name":"config/reachable" + "name": "config/reachable" }, { - "name":"state/lastupdated" + "name": "state/lastupdated" }, { - "name":"state/dark" + "name": "state/dark" }, { - "name":"config/tholddark" + "name": "config/tholddark" }, { - "name":"config/tholdoffset" + "name": "config/tholdoffset" }, { - "name":"state/daylight" + "name": "state/daylight" }, { - "name":"state/lightlevel" + "name": "state/lightlevel" }, { - "name":"state/lux", - "description":"The current light intensity in Lux (max is 2000)", - "read":{ - "fn":"none" + "name": "state/lux", + "description": "The current light intensity in Lux (max is 2000)", + "read": { + "fn": "none" }, - "parse":{ - "dpid":104, - "script":"../generic/illuminance_cluster/lux_to_lightlevel.js", - "fn":"tuya" + "parse": { + "dpid": 104, + "script": "../generic/illuminance_cluster/lux_to_lightlevel.js", + "fn": "tuya" }, - "default":0 + "default": 0 } ] }, { - "type":"$TYPE_PRESENCE_SENSOR", - "restapi":"/sensors", - "uuid":[ + "type": "$TYPE_PRESENCE_SENSOR", + "restapi": "/sensors", + "uuid": [ "$address.ext", "0x01", "0xef00" ], - "items":[ + "items": [ { - "name":"attr/id" + "name": "attr/id" }, { - "name":"attr/lastannounced" + "name": "attr/lastannounced" }, { - "name":"attr/lastseen" + "name": "attr/lastseen" }, { - "name":"attr/manufacturername" + "name": "attr/manufacturername" }, { - "name":"attr/modelid" + "name": "attr/modelid" }, { - "name":"attr/name" + "name": "attr/name" }, { - "name":"attr/swversion", - "read":{ - "at":"0x0001", - "cl":"0x0000", - "ep":1, - "fn":"zcl" + "name": "attr/swversion", + "read": { + "at": "0x0001", + "cl": "0x0000", + "ep": 1, + "fn": "zcl" }, - "parse":{ - "at":"0x0001", - "cl":"0x0000", - "ep":1, - "fn":"zcl", - "script":"tuya_swversion.js" + "parse": { + "at": "0x0001", + "cl": "0x0000", + "ep": 1, + "fn": "zcl", + "script": "tuya_swversion.js" } }, { - "name":"attr/type" + "name": "attr/type" }, { - "name":"attr/uniqueid" + "name": "attr/uniqueid" }, { - "name":"config/delay", - "description":"Detection delay : target confirmation delay time in 10th of second (from 0 to 100). Default 0.1s", - "read":{ - "fn":"none" + "name": "config/delay", + "description": "Detection delay : target confirmation delay time in 10th of second (from 0 to 100). Default 0.1s", + "read": { + "fn": "none" }, - "write":{ - "dpid":110, - "dt":"0x2b", - "eval":"Item.val;", - "fn":"tuya" + "write": { + "dpid": 110, + "dt": "0x2b", + "eval": "Item.val;", + "fn": "tuya" }, - "parse":{ - "dpid":110, - "eval":"Item.val = Attr.val;", - "fn":"tuya" + "parse": { + "dpid": 110, + "eval": "Item.val = Attr.val;", + "fn": "tuya" }, - "default":1 + "default": 1 }, { - "name":"config/duration", - "description":"Fading time : target disapperance delay time in second (from 0 to 15000). Default 90s", - "range":[ + "name": "config/fadingtime", + "description": "Fading time : target disapperance delay time in second (from 0 to 15000). Default 90s", + "range": [ 0, 15000 ], - "read":{ - "fn":"none" + "read": { + "fn": "none" }, - "write":{ - "dpid":111, - "dt":"0x2b", - "eval":"Item.val;", - "fn":"tuya" + "write": { + "dpid": 111, + "dt": "0x2b", + "eval": "Item.val;", + "fn": "tuya" }, - "parse":{ - "dpid":111, - "eval":"Item.val = Attr.val;", - "fn":"tuya" + "parse": { + "dpid": 111, + "eval": "Item.val = Attr.val;", + "fn": "tuya" }, - "default":90 + "default": 90 }, { - "name":"config/on" + "name": "config/on" }, { - "name":"config/reachable" + "name": "config/reachable" }, { - "name":"config/sensitivity", - "description":"Radar sensitivity (from 1 to 9). Default 7", - "range":[ + "name": "config/sensitivity", + "description": "Radar sensitivity (from 1 to 9). Default 7", + "range": [ 1, 9 ], - "read":{ - "fn":"none" + "read": { + "fn": "none" }, - "write":{ - "dpid":106, - "dt":"0x2b", - "eval":"Item.val;", - "fn":"tuya" + "write": { + "dpid": 106, + "dt": "0x2b", + "eval": "Item.val;", + "fn": "tuya" }, - "parse":{ - "dpid":106, - "eval":"Item.val = Attr.val;", - "fn":"tuya" + "parse": { + "dpid": 106, + "eval": "Item.val = Attr.val;", + "fn": "tuya" }, - "default":7 + "default": 7 }, { - "name":"config/triggerdistance", - "description":"Far detection sensitivity", - "read":{ - "fn":"none" + "name": "config/triggerdistance", + "description": "Far detection sensitivity", + "read": { + "fn": "none" }, - "write":{ - "dpid":107, - "dt":"0x2b", - "eval":"Far = ['0','1','2','3','4','5','6','7','8','9','10']; Attr.val = Math.max(0,Far.indexOf(Item.val)*100);", - "fn":"tuya" + "write": { + "dpid": 107, + "dt": "0x2b", + "eval": "Far = ['0','1','2','3','4','5','6','7','8','9','10']; Attr.val = Math.max(0,Far.indexOf(Item.val)*100);", + "fn": "tuya" }, - "parse":{ - "dpid":107, - "eval":"Item.val = String(Attr.val/100);", - "fn":"tuya" + "parse": { + "dpid": 107, + "eval": "Item.val = String(Attr.val/100);", + "fn": "tuya" }, - "values":[ + "values": [ [ "\"1\"", "1m" @@ -271,44 +271,44 @@ "Off" ] ], - "default":"10" + "default": "10" }, { - "name":"state/angle", - "description":"Distance from detected target in cm (from 0 to 1000).", - "read":{ - "fn":"none" + "name": "state/targetdistance", + "description": "Distance from detected target in cm (from 0 to 1000).", + "read": { + "fn": "none" }, - "parse":{ - "dpid":109, - "eval":"Item.val = Attr.val;", - "fn":"tuya" + "parse": { + "dpid": 109, + "eval": "Item.val = Attr.val;", + "fn": "tuya" }, - "default":0 + "default": 0 }, { - "name":"state/lastupdated" + "name": "state/lastupdated" }, { - "name":"state/presence", - "read":{ - "fn":"tuya" + "name": "state/presence", + "read": { + "fn": "tuya" }, - "parse":{ - "dpid":105, - "eval":"Item.val = Attr.val;", - "fn":"tuya" + "parse": { + "dpid": 105, + "eval": "Item.val = Attr.val;", + "fn": "tuya" }, - "default":false + "default": false } ] } ], - "bindings":[ + "bindings": [ { - "bind":"unicast", - "src.ep":1, - "cl":"0xEF00" + "bind": "unicast", + "src.ep": 1, + "cl": "0xEF00" } ] }