Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
11.84k stars 1.65k forks source link

[New device support]: TuYa 24GHz Human Presence Sensor TS0225_TZE200_2aaelwxk #18612

Closed chewth91 closed 1 year ago

chewth91 commented 1 year ago

Link

https://www.aliexpress.com/item/1005005909540714.html?gps-id=pcStoreNewArrivals&scm=1007.23409.271287.0&scm_id=1007.23409.271287.0&scm-url=1007.23409.271287.0&pvid=5175abbe-b739-46df-8ec7-c2c2a8f4c801&_t=gps-id:pcStoreNewArrivals,scm-url:1007.23409.271287.0,pvid:5175abbe-b739-46df-8ec7-c2c2a8f4c801,tpp_buckets:668%232846%238114%231999&pdp_npi=4%40dis%21MYR%21107.42%2175.21%21%21%2122.84%21%21%402101c59816919999368335919e0b96%2112000034805127430%21rec%21MY%21%21A&spm=a2g0o.store_pc_home.smartNewArrivals_2002856433204.1005005909540714

Database entry

{"id":67,"type":"Router","ieeeAddr":"0xa4c138f81e577a0c","nwkAddr":64592,"manufId":4417,"manufName":"_TZE200_2aaelwxk","powerSource":"DC Source","modelId":"TS0225","epList":[1,242],"endpoints":{"1":{"profId":260,"epId":1,"devId":1026,"inClusterList":[0,3,1280,57346,61184,60928,57344,1024],"outClusterList":[],"clusters":{"genBasic":{"attributes":{"zclVersion":3}},"ssIasZone":{"attributes":{"iasCieAddr":"0x00124b00257cc7da","zoneState":0}},"msIlluminanceMeasurement":{"attributes":{"measuredValue":32770}}},"binds":[],"configuredReportings":[],"meta":{}},"242":{"profId":41440,"epId":242,"devId":97,"inClusterList":[],"outClusterList":[33],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":130,"stackVersion":2,"hwVersion":1,"swBuildId":"0122052017","zclVersion":3,"interviewCompleted":true,"meta":{},"lastSeen":1691999105436,"defaultSendRequestWhen":"immediate"}

Comments

Hi, just got this device from aliexpress recently and found that it is not supported in Z2M.

External converter

const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const legacy = require('zigbee-herdsman-converters/lib/legacy');
const extend = require('zigbee-herdsman-converters/lib/extend');
const ota = require('zigbee-herdsman-converters/lib/ota');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const utils = require('zigbee-herdsman-converters/lib/utils');
const globalStore = require('zigbee-herdsman-converters/lib/store');
const e = exposes.presets;
const ea = exposes.access;

const tzDatapoints = {
    ...tuya.tz.datapoints,
    key: [...tuya.tz.datapoints.key, 'alarm', 'alarm_time', 'alarm_volume', 'type', 'volume', 'ringtone', 'duration','indicator',
    'motion_detection_distance', 'motion_detection_sensitivity', 'small_motion_detection_distance',
    'small_motion_detection_sensitivity', 'static_detection_distance', 'static_detection_sensitivity','motion_false_detection','fading_time',
    'breathe_false_detection','working_mode']
}

const definition = {
    fingerprint: tuya.fingerprint('TS0225', ['_TZE200_2aaelwxk']),
    model: 'ZG-205Z/A',
    vendor: 'TuYa',
    description: '24GHz Human Presence Sensor',
    fromZigbee: [tuya.fz.datapoints],
    toZigbee: [tzDatapoints],
    exposes: [
        e.presence(),
        //e.enum('presence_state', ea.STATE, ['none', 'presence']).withDescription('Presence'),
        e.enum('human_motion_state', ea.STATE, ['none', 'large', 'small', 'breathe']).withDescription('Human Motion state'),
        e.numeric('illuminance_value', ea.STATE).withDescription('Illuminance').withUnit('lux'),      
        e.numeric('fading_time', ea.STATE_SET).withValueMin(0).withValueMax(28800).withValueStep(1).withUnit('s')
            .withDescription('Presence keep time'),
        e.numeric('motion_detection_distance', ea.STATE_SET).withValueMin(0).withValueMax(10).withValueStep(0.01).withUnit('m')
            .withDescription('Motion detection distance'),
        e.numeric('motion_detection_sensitivity', ea.STATE_SET).withValueMin(0).withValueMax(10).withValueStep(1).withUnit('x')
            .withDescription('Motion detection sensitivity'),
        e.numeric('small_motion_detection_distance', ea.STATE_SET).withValueMin(0).withValueMax(6).withValueStep(0.01).withUnit('m')
            .withDescription('Small motion detection distance'),
        e.numeric('small_motion_detection_sensitivity', ea.STATE_SET).withValueMin(0).withValueMax(10).withValueStep(1).withUnit('x')
            .withDescription('Small motion detection sensitivity'),
        e.numeric('static_detection_distance', ea.STATE_SET).withValueMin(0).withValueMax(6).withValueStep(0.01).withUnit('m')
            .withDescription('Static detection distance'),
        e.numeric('static_detection_sensitivity', ea.STATE_SET).withValueMin(0).withValueMax(10).withValueStep(1).withUnit('x')
            .withDescription('Static detection sensitivity'),
        e.numeric('motion_false_detection', ea.STATE_SET).withValueMin(0).withValueMax(10).withValueStep(1).withUnit('x')
            .withDescription('Motion false detection'),            
        //e.enum('working_mode', ea.STATE_SET, ['off', 'arm', 'alarm']).withDescription('Alarm mode'),
        //e.enum('alarm_volume', ea.STATE_SET, ['mute', 'low', 'medium', 'high']).withDescription('Alarm volume'),
        //e.numeric('alarm_time', ea.STATE_SET).withValueMin(1).withValueMax(60).withValueStep(1).withUnit('m').withDescription('Alarm time'),
        e.binary('indicator', ea.STATE_SET, 'ON', 'OFF').withDescription('LED Indicator'),
        e.binary('breathe_false_detection', ea.STATE_SET, 'ON', 'OFF').withDescription('Breathe False Detection'),
    ],
    meta: {
        tuyaDatapoints: [
            //[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],                  
        ],
    },
};

module.exports = definition;

Supported color modes

No response

Color temperature range

No response

13717033460 commented 1 year ago

This is pir

发自我的iPhone

------------------ Original ------------------ From: Alex Valtchev @.> Date: Wed,Aug 30,2023 1:25 AM To: Koenkk/zigbee2mqtt @.> Cc: jomders @.>, Mention @.> Subject: Re: [Koenkk/zigbee2mqtt] [New device support]: TuYa 24GHz HumanPresence Sensor TS0225_TZE200_2aaelwxk (Issue #18612)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

13717033460 commented 1 year ago

发自我的iPhone

------------------ Original ------------------ From: Alex Valtchev @.> Date: Wed,Aug 30,2023 1:25 AM To: Koenkk/zigbee2mqtt @.> Cc: jomders @.>, Mention @.> Subject: Re: [Koenkk/zigbee2mqtt] [New device support]: TuYa 24GHz HumanPresence Sensor TS0225_TZE200_2aaelwxk (Issue #18612)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

alexvaltchev commented 1 year ago

I mean this is just the stand. Its nit a sensor. It can be maunted on any sensor to angel it.

alexvaltchev commented 1 year ago

LINK for purchasing this stand: https://www.aliexpress.com/item/1005005943524259.html

Screenshot_2023-08-29-20-45-42-537_com alibaba aliexpresshd-edit -894897513-1512213029

@13717033460 this is another senaor holder to angel the sensor into the right direction.

kkossev commented 1 year ago

@alexvaltchev that's a very good idea (using the Aqara sensor holder) - the precise aiming to the direction where the stationary/breath sensing is expected is of critical importance for achieving the best results. Precise aiming also helps a lot to avoid interference from ceiling of floor-standing fans, air conditioners, etc.

alexvaltchev commented 1 year ago

Yes I already purchased. Waiting on it. I can send you a link for the second one when I get home if you want.

kkossev commented 1 year ago

Yes, please.

alexvaltchev commented 1 year ago

Here is the link for the mounting bracket for pretty much any sensor, so it can be fixed and modified and angled at any direction for better results: It can be used for all older and newer models.

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

@kkossev @13717033460

magicmellon commented 11 months ago

Appologies for joining a stale chat - I just wanted to confirm what this device actually is - I have the Zigbee Model: TS0225, Zigbee Manufacturer: _TZE200_2aaelwxk, is this a 5.8GHz or 28GHz device? If 5.8, is it worth updating the Zigbee2MQTT description to reflect that?

Hammerhand17 commented 10 months ago

One more question. Bought several of these devices, which are now detected as soon as I add them in z2mqtt:

image

Besides, illuminance value is not detected from Home Assistant:

image

Any clue?

Hammerhand17 commented 10 months ago

One more question. Bought several of these devices, which are now detected as soon as I add them in z2mqtt:

image

Besides, illuminance value is not detected from Home Assistant:

image

Any clue?

Just in case anyone needs it; just have to go to sensor page and enable this entity.

HNKNTA commented 9 months ago

I know this ticket is closed, so I'd appreciate any recommendations on what could I do with the following: I've ordered a few devices on aliexpress recently, like the ones mentioned on many sources as 5.8GHz device, like this image https://www.amazon.com/Presence-Millimeter-Detection-Zigbee2mqtt-Assistant%C2%A1%C2%AD/dp/B0CFHL81P8?th=1

It works currently as _TZE200_2aaelwxk via zigbee2mqtt, described as 5.8Ghz Human presence sensor.

And looking at this issue, I started a dispute on aliexpress, as advised above (and on some other forum) where guys prove this is 5.8GHz device by taking pictures of the disassembled device.

So, I've disassembled mine, as what I see: it's actually 24GHz! Revision V2.1, 24000MHz quartz: DSC09232 Antenna: DSC09231

Should I open a new issue for this? So far it works as is, but the illuminance values are crazy high, not sure if it's possible to calibrate it.

GitTheFOuttaHere commented 9 months ago

Should I open a new issue for this? So far it works as is, but the illuminance values are crazy high, not sure if it's possible to calibrate it.

What value do you get & do you have another luminance sensor to compare the values at the same location?

A tuya.valueConverter.divideByxx (xx being the value you set) can be added to an external converter.

So if you have one luminance sensor showing 48 & you have the one with high values showing 480, 4800, 48000 or the likes, you can then use the above to divide by 10, 100, 1000 respectively.

HNKNTA commented 9 months ago

Should I open a new issue for this? So far it works as is, but the illuminance values are crazy high, not sure if it's possible to calibrate it.

What value do you get & do you have another luminance sensor to compare the values at the same location?

A tuya.valueConverter.divideByxx (xx being the value you set) can be added to an external converter.

So if you have one luminance sensor showing 48 & you have the one with high values showing 480, 4800, 48000 or the likes, you can then use the above to divide by 10, 100, 1000 respectively.

Yeah, I got like 10x values right now in one room, my other luminance sensors also not perfect though. The other room shows 56 vs 2134 on tuya sensor 🫤

I guess you are referring to this, I will try to look into it on weekends, and see what I can do with it, thanks for the help!

GitTheFOuttaHere commented 9 months ago

Yeah, I got like 10x values right now in one room, my other luminance sensors also not perfect though. The other room shows 56 vs 2134 on tuya sensor 🫤

I guess you are referring to this, I will try to look into it on weekends, and see what I can do with it, thanks for the help!

I have the exact same sensor with same id code. It is automatically recognized in z2mqtt & no external converter is required.

Mine went up to over 3000lm almost every time there was motion. Found it was the led indicator on the front panel causing it.

Turned off, problem solved.

GitTheFOuttaHere commented 9 months ago

And as for the external converter, there is some in this thread.

HNKNTA commented 9 months ago

@GitTheFOuttaHere I have the LED turned off, but the values are still high. image

And it's really higher than it should be, according to the description on the wiki and my other sensors: https://en.wikipedia.org/wiki/Lux image

Do you have normally accurate values for your device?

GitTheFOuttaHere commented 9 months ago

Depends what "normally accurate" entails. My sensor (specifically TS0225_TZE200_2aaelwxk) would only go higher than 2000lm if I shine a bright led torch directly at it. I only have one of these and have mounted it under a cupboard. I have it there so it does not detect movement from the ceiling fan. And won't pickup my animals most times because there is a bench below it as well. It's also a good way to know how much actual sunlight there is. The values aren't super accurate, but it works enough for me to use the readings I'm given.

A led torch I have which has a 1000lm output (on high) shining directly at it, shows over 3000lm.

The photo sensitive component isn't exposed, it's hidden under the plastic case. So not sure how accurate you will need it to be.

If your need for lumens value is critical, you may need a dedicated lux sensor.

Having said that, the lumens value for mine seems to be on par with the wiki. Had mostly overcast days and the value didn't go much higher than 1000lm.

The other sensors I have have different outputs, not in lumens. Their reading goes from 0 to 50 only.

I've ordered another one of these and I'll post the results for you.

HNKNTA commented 9 months ago

@GitTheFOuttaHere appreciate your extended response, I guess I need some dedicated sensor to be able to directly compare with my existing ones, integrated with presence and motion sensors. Tuya's values seems too high, but according to your response this might be quite accurate, so the other sensors make me doubt as well.

GitTheFOuttaHere commented 9 months ago

@GitTheFOuttaHere appreciate your extended response, I guess I need some dedicated sensor to be able to directly compare with my existing ones, integrated with presence and motion sensors. Tuya's values seems too high, but according to your response this might be quite accurate, so the other sensors make me doubt as well.

Always welcome.

I myself am interested in the values I can use. All my sensors being in different locations give different readings. I find the values required for that area & write the automation to suit. Lights on values, sunny day values, overcast.

When setting up a sensor, I keep track of the brightness in the room via sight, then when it's just too dark I record the values.

You are probably aware of how to set up a sensor, so I'll wait until I get the next unit & compare them for you.

I do have an Aqara luminance sensor, somewhere. I'll dig it out and compare it to that.

Bear in mind I have 2 x Aqara devices with luminance. One is dedicated to luminance only, the other is a aqara pir sensor with built in luminance.

The luminace sensor gives values of around 1000 on daybreak & can go all the way up to 60000 in full sunlight.

But while this sensor might show 900-1200, the pir one shows only 8-13.

GitTheFOuttaHere commented 8 months ago

Received the new sensor today, along with a ceiling type (still shows up as _TZE200_2aaelwxk) & all report roughly the same values.

I say "roughly" because they are not all exact, but definitely in the same sort of range.

1st sensor I received: 927 2nd: 938 Ceiling: 1028

The first two have the photoresistor behind the shell.

The ceiling one has a hole to let the light in. Which probably explains the different reading.

All tested in the same location.

UPDATE....... I received another sensor this afternoon (5.8g model _TZE204_qasjif9e) and the reading in the same location is 120.

I'm no expert on luminous flux.

And it would appear there is no "standard' across manufacturers. 3 x 24g of the same model sensors show around 1000 1 x 5.8g shows 120 2 x Xiaomi luminance sensor shows 11-12 1 x Aqara PIR sensor with in built lux shows 9

So if we presume the Xiaomi/Aqara Sensors are correct, the others are ten to 100 times that value.

In saying all that, they work for my application. I only need to know if it's too dark during daytime or if the light has been left on.

The values are recorded in HA & I just use the numbers from the sensor in that area to create the automations.

Good luck with yours.

MichalLytek commented 8 months ago

I know this ticket is closed, so I'd appreciate any recommendations on what could I do with the following: I've ordered a few devices on aliexpress recently, like the ones mentioned on many sources as 5.8GHz device, like this

It works currently as _TZE200_2aaelwxk via zigbee2mqtt, described as 5.8Ghz Human presence sensor.

And looking at this issue, I started a dispute on aliexpress, as advised above (and on some other forum) where guys prove this is 5.8GHz device by taking pictures of the disassembled device.

So, I've disassembled mine, as what I see: it's actually 24GHz! Revision V2.1, 24000MHz quartz:

@HNKNTA

This is 24 MHz quartz, used by the TeLink MCU: https://wiki.telink-semi.cn/doc/ds/PB_TLSR8258-E_Product%20Brief%20for%20Telink%20BLE%20IEEE802.15.4%20Multi-Standard%20Wireless%20SoC%20TLSR8258.pdf

Not 24 000 MHz for the radar - you need to unsolder the second pcb with the mmwave sensor to make sure it's 5.8 or 24 GHz.

GitTheFOuttaHere commented 8 months ago

How could someone confuse 24.000mhz with 24ghz. Maybe they didn't see the dot (.) in 24.000 mhz?

There is 24ghz version & 5.8ghz version. Some sellers pass off the 5.8g as 24g.

hknkbp commented 6 months ago

Hi, first time poster on git. I have bought the same sensor as @HNKNTA and Z2M identifies it wrongly as ZG-205Z/A 5.8Ghz Human presence sensor. This is definitely different as I've seen multiple pictures of the /A board. I've opened it and see "ZG-205Z v2.1" written on the board. 20240314_112738 20240314_112544 I'm no expert, but the board looks more like a 24Ghz than the 5.8Ghz. I also have a ZY-M100-L. Screenshot_20240316_230858_Home Assistant I would've liked to see distance etc on the ZG-205Z too. Screenshot_20240316_230805_Home Assistant

elmaswebon commented 5 months ago

Hi!

I also have a pair of ZG-205Z v2.1 that I bought to replace two ZY-M100-24G that were saturating the Zigbee network with 3-4 messages every second, each.

These new ones send much fewer messages, but even though Z2M does show the illuminance value, I can't use the sensor value for automations/scripts. It´s not available in the entity states.

Is there any way to fix this?

Also, as @hknkbp says, it would be great to see (an be able to use in automations) the distance, if possible.

Hammerhand17 commented 5 months ago

Hi!

I also have a pair of ZG-205Z v2.1 that I bought to replace two ZY-M100-24G that were saturating the Zigbee network with 3-4 messages every second, each.

These new ones send much fewer messages, but even though Z2M does show the illuminance value, I can't use the sensor value for automations/scripts. It´s not available in the entity states.

Is there any way to fix this?

Also, as @hknkbp says, it would be great to see (an be able to use in automations) the distance, if possible.

For me it was disabled, so I went to sensors, pressed "+8 entities not shown" and then enabled Iluminance. However, mine were ZY-M100-24G, so don't know if those new ones of yours will suffer the same.

elmaswebon commented 5 months ago

For me it was disabled, so I went to sensors, pressed "+8 entities not shown" and then enabled Iluminance. However, mine were ZY-M100-24G, so don't know if those new ones of yours will suffer the same.

Yep, that was it! Thanks!