Skip to content

Commit

Permalink
DDF for Tuya radar sensor (_TZE204_laokfqwu) (#8109)
Browse files Browse the repository at this point in the history
  • Loading branch information
Smanar authored Feb 5, 2025
1 parent 6f54b89 commit 55fff54
Show file tree
Hide file tree
Showing 2 changed files with 331 additions and 3 deletions.
4 changes: 1 addition & 3 deletions devices/tuya/ZY-M100_human_breathing_presence.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@
"_TZE204_ztc6ggyl",
"_TZE200_ar0slwnd",
"_TZE200_sfiy5tfs",
"_TZE200_mrf6vtua",
"_TZE204_laokfqwu"
"_TZE200_mrf6vtua"
],
"modelid": [
"TS0601",
"TS0601",
"TS0601",
"TS0601",
"TS0601",
"TS0601"
],
"vendor": "Tuya",
Expand Down
330 changes: 330 additions & 0 deletions devices/tuya/_TZE204_laokfqwu_radar.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,330 @@
{
"schema": "devcap1.schema.json",
"manufacturername": "_TZE204_laokfqwu",
"modelid": "TS0601",
"vendor": "Tuya",
"product": "MmwRadar Human Presence Detector (TS0601)",
"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:attr"
},
"parse": {
"at": "0x0001",
"cl": "0x0000",
"ep": 1,
"fn": "zcl:attr",
"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": 103,
"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:attr"
},
"parse": {
"at": "0x0001",
"cl": "0x0000",
"ep": 1,
"fn": "zcl:attr",
"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": 105,
"dt": "0x2b",
"eval": "Item.val;",
"fn": "tuya"
},
"parse": {
"dpid": 105,
"eval": "Item.val = Attr.val;",
"fn": "tuya"
},
"default": 1
},
{
"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": 106,
"dt": "0x2b",
"eval": "Item.val;",
"fn": "tuya"
},
"parse": {
"dpid": 106,
"eval": "Item.val = Attr.val;",
"fn": "tuya"
},
"default": 90
},
{
"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','10']; 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"
],
[
"\"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": 9,
"eval": "Item.val = Attr.val;",
"fn": "tuya"
},
"default": 0
},
{
"name": "state/errorcode",
"description": "Self check result code. \n0 = checking, 1 = check_success, 2 = check_failure, 3 = others, 4 = comm_fault, 5 = radar_fault",
"read": {
"fn": "none"
},
"parse": {
"dpid": 6,
"eval": "Item.val = String(Attr.val);",
"fn": "tuya"
},
"default": "Unknown"
},
{
"name": "state/lastupdated"
},
{
"name": "state/presence",
"read": {
"fn": "none"
},
"parse": {
"dpid": 1,
"eval": "Item.val = Attr.val;",
"fn": "tuya"
},
"default": false
}
]
}
],
"bindings": [
{
"bind": "unicast",
"src.ep": 1,
"cl": "0xEF00"
}
]
}

0 comments on commit 55fff54

Please sign in to comment.