Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Device Request - Human Presence detector Device Model: TS0225 #506

Closed
STD078 opened this issue Oct 26, 2023 · 11 comments
Closed

Device Request - Human Presence detector Device Model: TS0225 #506

STD078 opened this issue Oct 26, 2023 · 11 comments

Comments

@STD078
Copy link

STD078 commented Oct 26, 2023

Device Name: Human Presence detector
Device Model: TS0225
Device Description: Human Presence detector
Link to device image: https://nl.aliexpress.com/item/1005006038128151.html?spm=a2g0o.order_list.order_list_main.10.6bbf79d2LwX1s5&gatewayAdapt=glo2nld

Device Interview:

"ids": {
"modelId": "TS0225",
"manufacturerName": "_TZE200_2aaelwxk"
},
"endpoints": {
"endpointDescriptors": [
{
"endpointId": 1,
"applicationProfileId": 260,
"applicationDeviceId": 1026,
"applicationDeviceVersion": 0,
"_reserved1": 1,
"inputClusters": [
0,
3,
1280,
57346,
61184,
60928,
57344,
1024
],
"outputClusters": []
},
{
"endpointId": 242,
"applicationProfileId": 41440,
"applicationDeviceId": 97,
"applicationDeviceVersion": 0,
"_reserved1": 0,
"inputClusters": [],
"outputClusters": [
33
]
}
],
"endpoints": {
"1": {
"clusters": {
"basic": {
"attributes": [
{
"acl": [
"readable"
],
"id": 0,
"name": "zclVersion"
},
{
"acl": [
"readable"
],
"id": 1,
"name": "appVersion"
},
{
"acl": [
"readable"
],
"id": 2,
"name": "stackVersion"
},
{
"acl": [
"readable"
],
"id": 3,
"name": "hwVersion"
},
{
"acl": [
"readable"
],
"id": 4,
"name": "manufacturerName"
},
{
"acl": [
"readable"
],
"id": 5,
"name": "modelId"
},
{
"acl": [
"readable"
],
"id": 7,
"name": "powerSource"
},
{
"acl": [
"readable",
"writable"
],
"id": 18,
"name": "deviceEnabled"
},
{
"acl": [
"readable"
],
"id": 16384,
"name": "swBuildId"
},
{
"acl": [
"readable"
],
"id": 65533,
"name": "clusterRevision"
}
],
"commandsGenerated": "UNSUP_GENERAL_COMMAND",
"commandsReceived": "UNSUP_GENERAL_COMMAND"
},
"identify": {
"attributes": [
{
"acl": [
"readable",
"writable"
],
"id": 0
},
{
"acl": [
"readable"
],
"id": 65533,
"name": "clusterRevision",
"value": 1
}
],
"commandsGenerated": "UNSUP_GENERAL_COMMAND",
"commandsReceived": "UNSUP_GENERAL_COMMAND"
},
"iasZone": {
"attributes": [
{
"acl": [
"readable"
],
"id": 0,
"name": "zoneState",
"value": "notEnrolled"
},
{
"acl": [
"readable"
],
"id": 1,
"name": "zoneType",
"value": "motionSensor"
},
{
"acl": [
"readable"
],
"id": 2,
"name": "zoneStatus",
"value": {
"type": "Buffer",
"data": [
0,
0
]
}
},
{
"acl": [
"readable",
"writable"
],
"id": 16,
"name": "iasCIEAddress",
"value": "00:00:00:00:00:00:00:00"
},
{
"acl": [
"readable"
],
"id": 17,
"name": "zoneId",
"value": 6
},
{
"acl": [
"readable"
],
"id": 65533,
"name": "clusterRevision",
"value": 1
}
],
"commandsGenerated": "UNSUP_GENERAL_COMMAND",
"commandsReceived": "UNSUP_GENERAL_COMMAND"
},
"illuminanceMeasurement": {
"attributes": [
{
"acl": [
"readable"
],
"id": 0,
"name": "measuredValue",
"value": 1000
},
{
"acl": [
"readable"
],
"id": 1,
"name": "minMeasuredValue",
"value": 0
},
{
"acl": [
"readable"
],
"id": 2,
"name": "maxMeasuredValue",
"value": 4000
},
{
"acl": [
"readable"
],
"id": 65533,
"name": "clusterRevision",
"value": 1
}
],
"commandsGenerated": "UNSUP_GENERAL_COMMAND",
"commandsReceived": "UNSUP_GENERAL_COMMAND"
}
},
"bindings": {}
},
"242": {
"clusters": {},
"bindings": {}
}
}
}

@STD078 STD078 changed the title Device Request - [Device name] - [manufacturerName] / [modelId] Device Request - Human Presence detector Device Model: TS0225 Oct 26, 2023
@henkdeboom
Copy link

I am also interested in this device to be added to the Tuya Zigbee app.
Hopefully this will be soon.

Best regards,
Henk de Boom

@eelco2k
Copy link

eelco2k commented Nov 18, 2023

I'm also trying to make this sensor ( _TZE200_2aaelwxk ) compatible. I have the Lux sensor working, but the presence sensor has different datapoints. I also cannot write new settings to the device. (so it doesn't use the default tuya cluster for writing settings it seems...

I'm using the datapoints described in this post: Koenkk/zigbee2mqtt#18612

and using these datapoint values:

//[1, 'presence_state', tuya.valueConverterBasic.lookup({'none': tuya.enum(0), 'presence': tuya.enum(1)})],
[1, 'presence', tuya.valueConverter.trueFalse1],
[2, 'motion_detection_sensitivity', tuya.valueConverter.raw],
[3, 'mov_minimum_distance', tuya.valueConverter.raw],
[4, 'motion_detection_distance', tuya.valueConverter.divideBy100],
[101, 'human_motion_state', tuya.valueConverterBasic.lookup({'none': tuya.enum(0), 'large': tuya.enum(1), 'small': tuya.enum(2), 'breathe': tuya.enum(3)})],
[102, 'fading_time', tuya.valueConverter.raw],
[103, 'motion_false_detection', tuya.valueConverter.raw],
[104, 'small_motion_detection_distance', tuya.valueConverter.divideBy100],
[105, 'small_motion_detection_sensitivity', tuya.valueConverter.raw],
[106, 'illuminance_value', tuya.valueConverter.raw],
[107, 'indicator', tuya.valueConverter.onOff],
[108, 'static_detection_distance', tuya.valueConverter.divideBy100],
[109, 'static_detection_sensitivity', tuya.valueConverter.raw],
[110, 'micro_minimum_distance', tuya.valueConverter.raw],
[111, 'motionless_minimum_distance', tuya.valueConverter.raw],
[112, 'reset_setting', tuya.valueConverter.raw],
[113, 'breathe_false_detection', tuya.valueConverter.raw],
[114, 'time', tuya.valueConverter.raw],
[115, 'alarm_time', tuya.valueConverter.raw],
[116, 'alarm_volume', tuya.valueConverterBasic.lookup({'low': tuya.enum(0), 'medium': tuya.enum(1), 'high': tuya.enum(2), 'mute': tuya.enum(3)})],
[117, 'working_mode', tuya.valueConverterBasic.lookup({'arm': tuya.enum(0), 'off': tuya.enum(1), 'alarm': tuya.enum(2),  'doorbell': tuya.enum(3)})],
[118, 'auto1', tuya.valueConverter.raw],
[119, 'auto2', tuya.valueConverter.raw],
[120, 'auto3', tuya.valueConverter.raw],

It looks like it cannot identify some of the inputClusters: 57346, 60928, 57344 and outputCluster: 33

also from the 1024 (IlluminanceMeasurementCluster) the attribute measuredValue is a weird value, way to high unless the hex calculations below are correct....

zigbee-clusters:cluster ep: 1, cl: illuminanceMeasurement (1024) received frame reportAttributes illuminanceMeasurement.reportAttributes {
  attributes: <Buffer 00 00 21 6f 7f>

not sure it could be like this:

00 00 in hexadecimal is 0 in decimal.
21 in hexadecimal is 33 in decimal.
6f in hexadecimal is 111 in decimal.
7f in hexadecimal is 127 in decimal.

then: 
 
0 + 0 + 33 + 111 + 127 = 271 Lux

and not:

216f7f in hexadecimal is equal to 2207327 in decimal.

i'm also receiving these errors:

  zigbee-clusters:cluster ep: 1, cl: iasZone (1280) unknown command received: ZCLStandardHeader {
  frameControl: Bitmap [ clusterSpecific, directionToClient ],
  trxSequenceNumber: 220,
  cmdId: 0,
  data: <Buffer 01 00 00 ff 00 00>
} {} +1ms
  zigbee-clusters:endpoint ep: 1, cl: iasZone (1280), error while handling frame unknown_command_received {
  meta: {},
  frame: ZCLStandardHeader {
    frameControl: Bitmap [ clusterSpecific, directionToClient ],
    trxSequenceNumber: 220,
    cmdId: 0,
    data: <Buffer 01 00 00 ff 00 00>
  }
}

and the only "working data" i'm getting is:

 zigbee-clusters:cluster ep: 1, cl: tuya (61184) received frame response tuya.response {
  status: 0,
  transid: 218,
  dp: 1,
  datatype: 4,
  length: 1,
  data: <Buffer 01>
} +2m
2023-11-18T21:00:37.048Z [log] [ManagerDrivers] [Driver:radar_sensor] [Device:ad704e4c-bfe5-476f-92de-e81d60ee0b65] presence state: 1
  zigbee-clusters:cluster ep: 1, cl: tuya (61184) received frame response tuya.response {
  status: 0,
  transid: 219,
  dp: 101,
  datatype: 4,
  length: 1,
  data: <Buffer 02>
} +72ms
2023-11-18T21:00:37.119Z [log] [ManagerDrivers] [Driver:radar_sensor] [Device:ad704e4c-bfe5-476f-92de-e81d60ee0b65] AIS Zone: 2
2023-11-18T21:00:37.119Z [log] [ManagerDrivers] [Driver:radar_sensor] [Device:ad704e4c-bfe5-476f-92de-e81d60ee0b65] IASZoneStatusChangeNotification received: true 0 255 0

2023-11-18T21:06:11.425Z [log] [ManagerDrivers] [Driver:radar_sensor] [Device:ad704e4c-bfe5-476f-92de-e81d60ee0b65] lux value: 1806
2023-11-18T21:06:11.425Z [log] [ManagerDrivers] [Driver:radar_sensor] [Device:ad704e4c-bfe5-476f-92de-e81d60ee0b65] measure_luminance | Luminance - measuredValue (lux): 1806
  zigbee-clusters:cluster ep: 1, cl: illuminanceMeasurement (1024) received frame reportAttributes illuminanceMeasurement.reportAttributes {
  attributes: <Buffer 00 00 21 38 7f>
}
  zigbee-clusters:cluster ep: 1, cl: iasZone (1280) received frame zoneStatusChangeNotification iasZone.zoneStatusChangeNotification {
  zoneStatus: Bitmap [ alarm1 ],
  extendedStatus: 0,
  zoneId: 255,
  delay: 0
}

write settings errors:

 zigbee-clusters:cluster ep: 1, cl: iasZone (1280) unknown command received: ZCLStandardHeader {
  frameControl: Bitmap [ clusterSpecific, directionToClient ],
  trxSequenceNumber: 7,
  cmdId: 0,
  data: <Buffer 01 00 00 ff 00 00>
} {} +0ms
  zigbee-clusters:endpoint ep: 1, cl: iasZone (1280), error while handling frame unknown_command_received {
  meta: {},
  frame: ZCLStandardHeader {
    frameControl: Bitmap [ clusterSpecific, directionToClient ],
    trxSequenceNumber: 7,
    cmdId: 0,
    data: <Buffer 01 00 00 ff 00 00>
  }
} +11s
  zigbee-clusters:cluster ep: 1, cl: tuya (61184) send frame ZCLStandardHeader {
  frameControl: [ 'clusterSpecific' ],
  data: tuya.datapoint {
    status: 0,
    transid: 0,
    dp: 109,
    datatype: 2,
    length: 4,
    data: <Buffer 00 00 00 01>
  },
  cmdId: 0,
  trxSequenceNumber: 1
} +39s
  zigbee-clusters:cluster ep: 1, cl: tuya (61184) received frame reporting tuya.reporting {
  status: 0,
  transid: 0,
  dp: 109,
  datatype: 2,
  length: 4,
  data: <Buffer 00 00 00 01>
} +335ms
2023-11-18T21:10:34.191Z [log] [ManagerDrivers] [Driver:radar_sensor] [Device:ad704e4c-bfe5-476f-92de-e81d60ee0b65] DEBUG DATA!!!!!!
2023-11-18T21:10:34.191Z [log] [ManagerDrivers] [Driver:radar_sensor] [Device:ad704e4c-bfe5-476f-92de-e81d60ee0b65] tuya.reporting {
  status: 0,
  transid: 0,
  dp: 109,
  datatype: 2,
  length: 4,
  data: <Buffer 00 00 00 01>
}
  zigbee-clusters:cluster ep: 1, cl: tuya (61184) received frame defaultResponse tuya.defaultResponse { cmdId: 0, status: 'FAILURE' } +1ms
  zigbee-clusters:cluster ep: 1, cl: tuya (61184) received frame reporting tuya.reporting {
  status: 0,
  transid: 0,
  dp: 109,
  datatype: 2,
  length: 4,
  data: <Buffer 00 00 00 01>
} +1ms
2023-11-18T21:10:34.192Z [log] [ManagerDrivers] [Driver:radar_sensor] [Device:ad704e4c-bfe5-476f-92de-e81d60ee0b65] DEBUG DATA!!!!!!
2023-11-18T21:10:34.194Z [log] [ManagerDrivers] [Driver:radar_sensor] [Device:ad704e4c-bfe5-476f-92de-e81d60ee0b65] tuya.reporting {
  status: 0,
  transid: 0,
  dp: 109,
  datatype: 2,
  length: 4,
  data: <Buffer 00 00 00 01>
}
/app/node_modules/zigbee-clusters/lib/Cluster.js:1062
                throw new Error(response.status);
                      ^

Error: FAILURE
    at TuyaSpecificCluster.datapoint (/app/node_modules/zigbee-clusters/lib/Cluster.js:1062:23)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Hopefully another person finds this info useful...

@eelco2k
Copy link

eelco2k commented Nov 20, 2023

After some testing i managed to retrieve all the sensor data. but saving/setting settings still doesn't work.

does not matter which function i use to save:


this.dataPoinst = {
  presence: 1, // [0/1]
  motion_detection_sensitivity: 2, // [0-10, 1, x]
  mov_minimum_distance: 3, //
  motion_detection_distance: 4, // [0-10, 0.01, m]
  human_motion_state: 101, // [enum(0,1,2,3) none, large, small, breathe]
  fading_time: 102, // [0-28800, 1, s]
  motion_false_detection: 103, // [0-10, 1, x]
  small_motion_detection_distance: 104, // [0-6, 0.01, m]
  small_motion_detection_sensitivity: 105, // [0-10, 1, x]
  illuminance_value: 106, // (lux)
  indicator: 107, // LED Indicator
  static_detection_distance: 108, // [0-6, 0.01, m]
  static_detection_sensitivity: 109, // [0-10, 1, x]
  micro_minimum_distance: 110,
  motionless_minimum_distance: 111,
  reset_setting: 112,
  breathe_false_detection: 113, // [0/1]
  time: 114,
  alarm_time: 115, // [1-60, 1, m]
  alarm_volume: 116, // [enum(0: low, 1: medium, 2: high, 3: mute)]
  working_mode: 117, // [enum(0: arm, 1: off, 2: alarm, 3: doorbell)]
  auto1: 118,
  auto2: 119,
  auto3: 120,
};
async onSettings({ oldSettings, newSettings, changedKeys }) {

    if (changedKeys.includes("motion_detection_sensitivity")) {
      this.writeData32(
        this.dataPoints.motion_detection_sensitivity,
        newSettings["motion_detection_sensitivity"]
      );
    }

    if (changedKeys.includes("indicator")) {
      this.writeBool(this.dataPoints.indicator, newSettings["indicator"]);
    }

    if (changedKeys.includes("alarm_volume")) {
      this.writeEnum(this.dataPoints.alarm_volume, newSettings["alarm_volume"]);
    }
}

There are the errors when saving settings from homey... So the cluster 61184 (tuya) is not capable to write data to ...

 zigbee-clusters:cluster ep: 1, cl: tuya (61184) send frame ZCLStandardHeader {
  frameControl: [ 'clusterSpecific' ],
  data: tuya.datapoint {
    status: 0,
    transid: 0,
    dp: 2,
    datatype: 2,
    length: 4,
    data: <Buffer 00 00 00 0a>
  },
  cmdId: 0,
  trxSequenceNumber: 1
} +53s
  zigbee-clusters:cluster ep: 1, cl: tuya (61184) received frame reporting tuya.reporting {
  status: 0,
  transid: 0,
  dp: 2,
  datatype: 2,
  length: 4,
  data: <Buffer 00 00 00 0a>
} +339ms
2023-11-20T18:57:56.275Z [log] [ManagerDrivers] [Driver:radar_sensor] [Device:4eea8eda-61f7-4584-a01a-f3b6df5426d6] ########### Reporting:  tuya.reporting {
  status: 0,
  transid: 0,
  dp: 2,
  datatype: 2,
  length: 4,
  data: <Buffer 00 00 00 0a>
}
  zigbee-clusters:cluster ep: 1, cl: tuya (61184) received frame defaultResponse tuya.defaultResponse { cmdId: 0, status: 'FAILURE' } +101ms
  zigbee-clusters:cluster ep: 1, cl: tuya (61184) received frame reporting tuya.reporting {
  status: 0,
  transid: 0,
  dp: 2,
  datatype: 2,
  length: 4,
  data: <Buffer 00 00 00 0a>
} +1ms
2023-11-20T18:57:56.377Z [log] [ManagerDrivers] [Driver:radar_sensor] [Device:4eea8eda-61f7-4584-a01a-f3b6df5426d6] ########### Reporting:  tuya.reporting {
  status: 0,
  transid: 0,
  dp: 2,
  datatype: 2,
  length: 4,
  data: <Buffer 00 00 00 0a>
}
/app/node_modules/zigbee-clusters/lib/Cluster.js:1062
                throw new Error(response.status);
                      ^

Error: FAILURE
    at TuyaSpecificCluster.datapoint (/app/node_modules/zigbee-clusters/lib/Cluster.js:1062:23)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
───────────────────────────────────────────────────────

@eelco2k
Copy link

eelco2k commented Nov 21, 2023

I made a fork with the working readings of the device. but writing settings still fails...

https://github.com/eelco2k/com.tuya.zigbee/tree/SDK3/drivers/radar_sensor_2

@gooooba
Copy link

gooooba commented Dec 21, 2023

I made a fork with the working readings of the device. but writing settings still fails...

https://github.com/eelco2k/com.tuya.zigbee/tree/SDK3/drivers/radar_sensor_2

@eelco2k I tried your fork and it works OK for reading and setting parameters. Just sensors like breath and small motion are not available in flows. Any idea?

@eelco2k
Copy link

eelco2k commented Dec 28, 2023

@gooooba yes I noticed after installing it as well so it crashes only in debug mode (cli run cmd)
Perhaps because the send functions expect a response but there is none… haven’t really found out why…

I did not have the time to check all the flows, will try to do next week.

@late4marshmellow
Copy link

@eelco2k thank you for your great effort on this device! 👍 it works superb for me, hoping it also could be part of the official app :)

and now i discovered that theres a pull request for a ceiling device that has the same id tags
"ids": {
"modelId": "TS0225",
"manufacturerName": "_TZE200_2aaelwxk"
},
here: #653

difference is this is lacking small, large and breathe presence.
though.. maybe this contains some ideas for you to make your own pull request on this? :)

@eelco2k
Copy link

eelco2k commented Mar 2, 2024

I’ve created a pull request. As this driver has successfully been tested in my environment. #774

@gooooba
Copy link

gooooba commented Mar 8, 2024

I’ve created a pull request. As this driver has successfully been tested in my environment. #774

Great work. Is it possible to get info on current distance to be added to device screen and also in flows? Then automation would be on another level.

@eelco2k
Copy link

eelco2k commented Mar 8, 2024

This device does not offer distance unfortunately :-(

@gooooba
Copy link

gooooba commented Mar 9, 2024

To bad... know sensor that does?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants