zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

[TS0601 / _TZE200_kccdzaeo OR _TZE200_s7rsrtbg OR TZE200_tmszbtzq] does not expose distance for presence detection

Open tl-zigbee opened this issue 1 year ago • 2 comments

Link

https://www.aliexpress.com/item/1005008802620080.html

What happened?

  • Detected as ZG-302ZM
  • Unable to set detection distance (up till 6 meters)
  • Sensitivity might not be working correctly, currently set 0x but still sensitive in detecting motion

What did you expect to happen?

Able to set detection distance up till 6 meters, corrected sensitivity

Debug logs

from Tuya IOT Platform:

2-gang

{
  "result": {
    "properties": [
      {
        "code": "presence_state",
        "custom_name": "",
        "dp_id": 1,
        "time": 1757230079534,
        "type": "enum",
        "value": "none"
      },
      {
        "code": "sensitivity",
        "custom_name": "",
        "dp_id": 2,
        "time": 1757206309340,
        "type": "value",
        "value": 10
      },
      {
        "code": "far_detection",
        "custom_name": "",
        "dp_id": 4,
        "time": 1757207210932,
        "type": "value",
        "value": 300
      },
      {
        "code": "switch_1",
        "custom_name": "",
        "dp_id": 101,
        "time": 1757208939634,
        "type": "bool",
        "value": false
      },
      {
        "code": "switch_2",
        "custom_name": "",
        "dp_id": 102,
        "time": 1757210350015,
        "type": "bool",
        "value": false
      },
      {
        "code": "countdown_1",
        "custom_name": "",
        "dp_id": 103,
        "time": 1757206301854,
        "type": "value",
        "value": 0
      },
      {
        "code": "countdown_2",
        "custom_name": "",
        "dp_id": 104,
        "time": 1757206301854,
        "type": "value",
        "value": 0
      },
      {
        "code": "all_on",
        "custom_name": "",
        "dp_id": 107,
        "time": 1757206301854,
        "type": "bool",
        "value": false
      },
      {
        "code": "switch_trigger",
        "custom_name": "",
        "dp_id": 108,
        "time": 1757206301854,
        "type": "enum",
        "value": "ch1"
      },
      {
        "code": "all_off",
        "custom_name": "",
        "dp_id": 109,
        "time": 1757206301854,
        "type": "bool",
        "value": false
      },
      {
        "code": "bright_sensitivity",
        "custom_name": "",
        "dp_id": 110,
        "time": 1757206310080,
        "type": "value",
        "value": 5
      },
      {
        "code": "backlight_switch",
        "custom_name": "",
        "dp_id": 111,
        "time": 1757207177865,
        "type": "bool",
        "value": false
      },
      {
        "code": "relay_status",
        "custom_name": "",
        "dp_id": 112,
        "time": 1757206305977,
        "type": "enum",
        "value": "memory"
      },
      {
        "code": "h_on",
        "custom_name": "",
        "dp_id": 113,
        "time": 1757207051845,
        "type": "enum",
        "value": "off"
      },
      {
        "code": "pir_delay",
        "custom_name": "",
        "dp_id": 114,
        "time": 1757206309098,
        "type": "value",
        "value": 60
      },
      {
        "code": "h_off",
        "custom_name": "",
        "dp_id": 115,
        "time": 1757206309818,
        "type": "enum",
        "value": "off"
      }
    ]
  }

from Dev console:

2-gang

import * as m from 'zigbee-herdsman-converters/lib/modernExtend';

export default {
    zigbeeModel: ['TS0601'],
    model: 'TS0601',
    vendor: '_TZE200_s7rsrtbg',
    description: 'Automatically generated definition',
    extend: [m.deviceEndpoints({"endpoints":{"1":1,"2":2}}), m.onOff({"powerOnBehavior":false}), m.iasZoneAlarm({"zoneType":"generic","zoneAttributes":["alarm_1","alarm_2","tamper","battery_low"]})],
    meta: {"multiEndpoint":true},
};

1-gang

import * as m from 'zigbee-herdsman-converters/lib/modernExtend';

export default {
    zigbeeModel: ['TS0601'],
    model: 'TS0601',
    vendor: '_TZE200_kccdzaeo',
    description: 'Automatically generated definition',
    extend: [m.onOff({"powerOnBehavior":false}), m.iasZoneAlarm({"zoneType":"generic","zoneAttributes":["alarm_1","alarm_2","tamper","battery_low"]})],
    meta: {},
};

from database.db:

2-gang

{"id":14,"type":"EndDevice","ieeeAddr":"0xa4c138af060c1563","nwkAddr":47647,"manufId":4742,"manufName":"_TZE200_s7rsrtbg","powerSource":"Mains (single phase)","modelId":"TS0601","epList":[1,2],"endpoints":{"1":{"profId":260,"epId":1,"devId":0,"inClusterList":[0,6,1280,10],"outClusterList":[25],"clusters":{"genBasic":{"attributes":{"modelId":"TS0601","manufacturerName":"_TZE200_s7rsrtbg","powerSource":1,"zclVersion":3,"appVersion":147,"stackVersion":2,"hwVersion":1,"swBuildId":"0122052017"}},"ssIasZone":{"attributes":{"iasCieAddr":"0x8c8b48fffe4fdddd","zoneState":0}},"genOnOff":{"attributes":{"onOff":0,"moesStartUpOnOff":0,"tuyaBacklightSwitch":0}}},"binds":[],"configuredReportings":[],"meta":{}},"2":{"epId":2,"inClusterList":[],"outClusterList":[],"clusters":{"genOnOff":{"attributes":{"onOff":0}}},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":147,"stackVersion":2,"hwVersion":1,"swBuildId":"0122052017","zclVersion":3,"interviewCompleted":true,"interviewState":"SUCCESSFUL","meta":{},"lastSeen":1761056188792}

1-gang

{"id":15,"type":"EndDevice","ieeeAddr":"0xa4c1380e72efc6c5","nwkAddr":13693,"manufId":4742,"manufName":"_TZE200_kccdzaeo","powerSource":"Mains (single phase)","modelId":"TS0601","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":0,"inClusterList":[0,6,1280,10],"outClusterList":[25],"clusters":{"genBasic":{"attributes":{"modelId":"TS0601","manufacturerName":"_TZE200_kccdzaeo","powerSource":1,"zclVersion":3,"appVersion":147,"stackVersion":2,"hwVersion":1,"swBuildId":"0122052017"}},"ssIasZone":{"attributes":{"iasCieAddr":"0x8c8b48fffe4fdddd","zoneState":0}},"genOnOff":{"attributes":{"onOff":0,"moesStartUpOnOff":0,"tuyaBacklightSwitch":0}}},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":147,"stackVersion":2,"hwVersion":1,"swBuildId":"0122052017","zclVersion":3,"interviewCompleted":true,"interviewState":"SUCCESSFUL","meta":{},"lastSeen":1761056181744}

Details

os: #81180 SMP Fri Oct 3 13:55:28 CST 2025 - 4.4.302+ - x64 node: v22.16.0 zigbee2mqtt: 2.6.2 (4d247f3ae129ee7318eeede877ffdbbd27444693 ) zigbee-herdsman: 6.1.5 zigbee-herdsman-converters: 25.35.1 adapter: EmberZNet {"build":397,"ezsp":14,"major":8,"minor":0,"patch":2,"revision":"8.0.2 [GA]","special":0,"type":170}

Device

software_build_id: 0122052017 date_code: undefined endpoints:

{"1":{"bindings":[],"clusters":{"input":["genBasic","genOnOff","ssIasZone","genTime"],"output":["genOta"]},"configured_reportings":[],"scenes":[]},"2":{"bindings":[],"clusters":{"input":[],"output":[]},"configured_reportings":[],"scenes":[]}}

tl-zigbee avatar Oct 21 '25 05:10 tl-zigbee

Hi @Koenkk, would you be able to add the tuyaDatapoints 4 for distance of presence detection? Also noticed presence sensitivity should be tuyaDatapoints 2 instead of 110.

tuya.ts line 17128 onwards:

        meta: {
            tuyaDatapoints: [
                [1, "presence", tuya.valueConverter.trueFalse1],
                [101, "switch1", tuya.valueConverter.onOff],
                [102, "switch2", tuya.valueConverter.onOff],
                [103, "switch3", tuya.valueConverter.onOff],
                [110, "sensitivity", tuya.valueConverter.raw],
                [111, "backlight", tuya.valueConverter.onOff],
                [114, "trigger_hold", tuya.valueConverter.raw],

tl-zigbee avatar Nov 06 '25 06:11 tl-zigbee

Could you make a PR by clicking here?

Koenkk avatar Nov 06 '25 18:11 Koenkk