From 9504edf6b14ce77ed479bd080f40e5fa51b8796a Mon Sep 17 00:00:00 2001 From: BabaIsYou <85300265+BabaIsYou@users.noreply.github.com> Date: Fri, 18 Aug 2023 11:13:57 -0400 Subject: [PATCH 01/13] Create state_targetdistance_item.json --- devices/generic/items/state_targetdistance_item.json | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 devices/generic/items/state_targetdistance_item.json diff --git a/devices/generic/items/state_targetdistance_item.json b/devices/generic/items/state_targetdistance_item.json new file mode 100644 index 0000000000..23d261f044 --- /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 +} From 18d2cb175e357ca04b72a0421268513a0a258725 Mon Sep 17 00:00:00 2001 From: BabaIsYou <85300265+BabaIsYou@users.noreply.github.com> Date: Fri, 18 Aug 2023 11:15:21 -0400 Subject: [PATCH 02/13] Create config_fadingtime_item.json --- devices/generic/items/config_fadingtime_item.json | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 devices/generic/items/config_fadingtime_item.json diff --git a/devices/generic/items/config_fadingtime_item.json b/devices/generic/items/config_fadingtime_item.json new file mode 100644 index 0000000000..590656b1e4 --- /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 +} From 4950f49167e7b3408d2967a25e028521ea68697c Mon Sep 17 00:00:00 2001 From: BabaIsYou <85300265+BabaIsYou@users.noreply.github.com> Date: Fri, 18 Aug 2023 11:19:28 -0400 Subject: [PATCH 03/13] Create TS0601_TZE204_qasjif9e_mmwave_radar.json --- .../TS0601_TZE204_qasjif9e_mmwave_radar.json | 272 ++++++++++++++++++ 1 file changed, 272 insertions(+) create mode 100644 devices/tuya/TS0601_TZE204_qasjif9e_mmwave_radar.json 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..9c842762f3 --- /dev/null +++ b/devices/tuya/TS0601_TZE204_qasjif9e_mmwave_radar.json @@ -0,0 +1,272 @@ +{ + "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", + "refresh.interval": 5, + "read": { + "fn": "tuya" + }, + "parse": { + "dpid": 1, + "eval": "Item.val = Attr.val;", + "fn": "tuya" + }, + "default": false + } + ] + } + ], + "bindings": [{ + "bind": "unicast", + "src.ep": 1, + "cl": "0xEF00" + }] +} From 472ffab7b84d340e494cec80d8d67403316357da Mon Sep 17 00:00:00 2001 From: BabaIsYou <85300265+BabaIsYou@users.noreply.github.com> Date: Fri, 18 Aug 2023 11:28:49 -0400 Subject: [PATCH 04/13] Update TS0601_TZE204_qasjif9e_mmwave_radar.json Remove useless refresh.intervall --- devices/tuya/TS0601_TZE204_qasjif9e_mmwave_radar.json | 1 - 1 file changed, 1 deletion(-) diff --git a/devices/tuya/TS0601_TZE204_qasjif9e_mmwave_radar.json b/devices/tuya/TS0601_TZE204_qasjif9e_mmwave_radar.json index 9c842762f3..0e13fbd656 100644 --- a/devices/tuya/TS0601_TZE204_qasjif9e_mmwave_radar.json +++ b/devices/tuya/TS0601_TZE204_qasjif9e_mmwave_radar.json @@ -250,7 +250,6 @@ }, { "name": "state/presence", - "refresh.interval": 5, "read": { "fn": "tuya" }, From 251f614669de4e1997e2851ca0f53b80df5880d2 Mon Sep 17 00:00:00 2001 From: BabaIsYou <85300265+BabaIsYou@users.noreply.github.com> Date: Fri, 18 Aug 2023 12:51:23 -0400 Subject: [PATCH 05/13] Update ZY-M100_human_breathing_presence.json Change reuse of angle and duration (this last one has side effects) --- devices/tuya/ZY-M100_human_breathing_presence.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devices/tuya/ZY-M100_human_breathing_presence.json b/devices/tuya/ZY-M100_human_breathing_presence.json index bbef122c83..e84161d5fc 100644 --- a/devices/tuya/ZY-M100_human_breathing_presence.json +++ b/devices/tuya/ZY-M100_human_breathing_presence.json @@ -171,7 +171,7 @@ "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], "read": { @@ -249,7 +249,7 @@ "default": "10" }, { - "name": "state/angle", + "name": "state/targetdistance", "description": "Distance from detected target in cm (from 0 to 1000).", "read": { "fn": "none" From 57f8596531dbb39b9cf38123804d01c6cc87fa8d Mon Sep 17 00:00:00 2001 From: BabaIsYou <85300265+BabaIsYou@users.noreply.github.com> Date: Fri, 18 Aug 2023 13:08:30 -0400 Subject: [PATCH 06/13] Update _TZE204_sxm7l9xa_mmwave_radar.json --- .../tuya/_TZE204_sxm7l9xa_mmwave_radar.json | 65 +++++-------------- 1 file changed, 16 insertions(+), 49 deletions(-) diff --git a/devices/tuya/_TZE204_sxm7l9xa_mmwave_radar.json b/devices/tuya/_TZE204_sxm7l9xa_mmwave_radar.json index 1c66adbcfc..63ecd55522 100644 --- a/devices/tuya/_TZE204_sxm7l9xa_mmwave_radar.json +++ b/devices/tuya/_TZE204_sxm7l9xa_mmwave_radar.json @@ -4,7 +4,7 @@ "modelid":"TS0601", "product":"Tuya Human Presence Detector", "sleeper":false, - "status":"Silver", + "status":"Gold", "subdevices":[ { "type":"$TYPE_LIGHT_LEVEL_SENSOR", @@ -157,7 +157,7 @@ "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, @@ -225,56 +225,23 @@ "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" From 3d8911fe8089f91a7e1ebb70d707110a1afa39b4 Mon Sep 17 00:00:00 2001 From: BabaIsYou <85300265+BabaIsYou@users.noreply.github.com> Date: Fri, 18 Aug 2023 13:10:14 -0400 Subject: [PATCH 07/13] Update _TZE204_sxm7l9xa_mmwave_radar.json --- devices/tuya/_TZE204_sxm7l9xa_mmwave_radar.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices/tuya/_TZE204_sxm7l9xa_mmwave_radar.json b/devices/tuya/_TZE204_sxm7l9xa_mmwave_radar.json index 63ecd55522..9be9b3e049 100644 --- a/devices/tuya/_TZE204_sxm7l9xa_mmwave_radar.json +++ b/devices/tuya/_TZE204_sxm7l9xa_mmwave_radar.json @@ -235,7 +235,7 @@ ["\"7\"", "7m"], ["\"8\"", "8m"], ["\"9\"", "9m"], - ["\"10\"", "10m"], + ["\"10\"", "10m"], ["\"0\"", "Off"] ], "default":"10" From 5f3cbf0c8a98da0b64bf01c694502c0eedf30f53 Mon Sep 17 00:00:00 2001 From: BabaIsYou <85300265+BabaIsYou@users.noreply.github.com> Date: Fri, 18 Aug 2023 13:11:47 -0400 Subject: [PATCH 08/13] Rename TS0601_TZE204_qasjif9e_mmwave_radar.json to _TS0601_TZE204_qasjif9e_mmwave_radar.json --- ...mwave_radar.json => _TS0601_TZE204_qasjif9e_mmwave_radar.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename devices/tuya/{TS0601_TZE204_qasjif9e_mmwave_radar.json => _TS0601_TZE204_qasjif9e_mmwave_radar.json} (100%) diff --git a/devices/tuya/TS0601_TZE204_qasjif9e_mmwave_radar.json b/devices/tuya/_TS0601_TZE204_qasjif9e_mmwave_radar.json similarity index 100% rename from devices/tuya/TS0601_TZE204_qasjif9e_mmwave_radar.json rename to devices/tuya/_TS0601_TZE204_qasjif9e_mmwave_radar.json From 426c288732ed396b0610c4343ca1f46580294ff8 Mon Sep 17 00:00:00 2001 From: BabaIsYou <85300265+BabaIsYou@users.noreply.github.com> Date: Wed, 30 Aug 2023 09:09:13 -0400 Subject: [PATCH 09/13] Update _TS0601_TZE204_qasjif9e_mmwave_radar.json Passing thru json formatter --- .../_TS0601_TZE204_qasjif9e_mmwave_radar.json | 579 ++++++++++-------- 1 file changed, 310 insertions(+), 269 deletions(-) diff --git a/devices/tuya/_TS0601_TZE204_qasjif9e_mmwave_radar.json b/devices/tuya/_TS0601_TZE204_qasjif9e_mmwave_radar.json index 0e13fbd656..79aeccf91e 100644 --- a/devices/tuya/_TS0601_TZE204_qasjif9e_mmwave_radar.json +++ b/devices/tuya/_TS0601_TZE204_qasjif9e_mmwave_radar.json @@ -1,271 +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" - }] + "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" + } + ] } From 6f1aa7b297caaf4437274170e1cf515cfe4a8d56 Mon Sep 17 00:00:00 2001 From: BabaIsYou <85300265+BabaIsYou@users.noreply.github.com> Date: Wed, 30 Aug 2023 09:10:02 -0400 Subject: [PATCH 10/13] Update _TZE204_sxm7l9xa_mmwave_radar.json Passing thru json formatter --- .../tuya/_TZE204_sxm7l9xa_mmwave_radar.json | 367 ++++++++++-------- 1 file changed, 200 insertions(+), 167 deletions(-) diff --git a/devices/tuya/_TZE204_sxm7l9xa_mmwave_radar.json b/devices/tuya/_TZE204_sxm7l9xa_mmwave_radar.json index 9be9b3e049..68c98dd849 100644 --- a/devices/tuya/_TZE204_sxm7l9xa_mmwave_radar.json +++ b/devices/tuya/_TZE204_sxm7l9xa_mmwave_radar.json @@ -1,281 +1,314 @@ { - "schema":"devcap1.schema.json", - "manufacturername":"_TZE204_sxm7l9xa", - "modelid":"TS0601", - "product":"Tuya Human Presence Detector", - "sleeper":false, - "status":"Gold", - "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/fadingtime", - "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": [ - ["\"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/targetdistance", - "description":"Distance from detected target in cm (from 0 to 1000).", - "read":{ - "fn":"none" + "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/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" } ] } From a96a6c13f63484d654c7b648904905c9de0aa8dc Mon Sep 17 00:00:00 2001 From: BabaIsYou <85300265+BabaIsYou@users.noreply.github.com> Date: Wed, 30 Aug 2023 09:10:43 -0400 Subject: [PATCH 11/13] Update ZY-M100_human_breathing_presence.json Passing thru json formatter --- .../ZY-M100_human_breathing_presence.json | 75 ++++++++++++++----- 1 file changed, 57 insertions(+), 18 deletions(-) diff --git a/devices/tuya/ZY-M100_human_breathing_presence.json b/devices/tuya/ZY-M100_human_breathing_presence.json index e84161d5fc..f481b10a75 100644 --- a/devices/tuya/ZY-M100_human_breathing_presence.json +++ b/devices/tuya/ZY-M100_human_breathing_presence.json @@ -173,7 +173,10 @@ { "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,27 +234,60 @@ "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/targetdistance", "description": "Distance from detected target in cm (from 0 to 1000).", "read": { From 7cf29763b3c99c0aba69ad6072c1cc878f155301 Mon Sep 17 00:00:00 2001 From: BabaIsYou <85300265+BabaIsYou@users.noreply.github.com> Date: Wed, 30 Aug 2023 09:12:34 -0400 Subject: [PATCH 12/13] Update config_fadingtime_item.json Passing thru json formatter --- .../generic/items/config_fadingtime_item.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/devices/generic/items/config_fadingtime_item.json b/devices/generic/items/config_fadingtime_item.json index 590656b1e4..573b279529 100644 --- a/devices/generic/items/config_fadingtime_item.json +++ b/devices/generic/items/config_fadingtime_item.json @@ -1,9 +1,9 @@ { - "schema": "resourceitem1.schema.json", - "id": "config/fadingtime", - "datatype": "UInt16", - "access": "RW", - "public": true, - "description": "Target disapperance delay time in seconds", - "default": 0 -} + "schema": "resourceitem1.schema.json", + "id": "config/fadingtime", + "datatype": "UInt16", + "access": "RW", + "public": true, + "description": "Target disapperance delay time in seconds", + "default": 0 +} From 39dafd8aaf30a4668c8361943efd96d3ac348eba Mon Sep 17 00:00:00 2001 From: BabaIsYou <85300265+BabaIsYou@users.noreply.github.com> Date: Wed, 30 Aug 2023 09:13:06 -0400 Subject: [PATCH 13/13] Update state_targetdistance_item.json Passing thru json formatter --- .../generic/items/state_targetdistance_item.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/devices/generic/items/state_targetdistance_item.json b/devices/generic/items/state_targetdistance_item.json index 23d261f044..24f7336879 100644 --- a/devices/generic/items/state_targetdistance_item.json +++ b/devices/generic/items/state_targetdistance_item.json @@ -1,9 +1,9 @@ { - "schema": "resourceitem1.schema.json", - "id": "state/targetdistance", - "description": "Distance from detected target", - "datatype": "Int16", - "access": "R", - "public": true, - "default": 0 + "schema": "resourceitem1.schema.json", + "id": "state/targetdistance", + "description": "Distance from detected target", + "datatype": "Int16", + "access": "R", + "public": true, + "default": 0 }