Skip to content

Commit

Permalink
DDF for TS0601_TZE204_qasjif9e & fix other mmWave Radar Presence DDF (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
BabaIsYou authored Aug 31, 2023
1 parent 7a54557 commit 4a7864d
Show file tree
Hide file tree
Showing 5 changed files with 542 additions and 173 deletions.
9 changes: 9 additions & 0 deletions devices/generic/items/config_fadingtime_item.json
Original file line number Diff line number Diff line change
@@ -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
}
9 changes: 9 additions & 0 deletions devices/generic/items/state_targetdistance_item.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"schema": "resourceitem1.schema.json",
"id": "state/targetdistance",
"description": "Distance from detected target",
"datatype": "Int16",
"access": "R",
"public": true,
"default": 0
}
79 changes: 59 additions & 20 deletions devices/tuya/ZY-M100_human_breathing_presence.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -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"
},
Expand All @@ -219,7 +225,7 @@
{
"name": "config/triggerdistance",
"description": "Far detection sensitivity",
"read": {
"read": {
"fn": "none"
},
"write": {
Expand All @@ -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"
Expand Down
Loading

0 comments on commit 4a7864d

Please sign in to comment.