zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

[New device support]: TS0601 _TZE204_7gclukjs

Open ayasystems opened this issue 3 months ago β€’ 32 comments

Link

https://es.aliexpress.com/item/1005004704966668.html?spm=a2g0o.order_list.order_list_main.39.2d6d194dDYF1wq&gatewayAdapt=glo2esp

Database entry

{"id":12,"type":"Router","ieeeAddr":"0xa4c1385c2518322c","nwkAddr":57339,"manufId":4417,"manufName":"_TZE204_7gclukjs","powerSource":"Mains (single phase)","modelId":"TS0601","epList":[1,242],"endpoints":{"1":{"profId":260,"epId":1,"devId":81,"inClusterList":[4,5,61184,0],"outClusterList":[25,10],"clusters":{"genBasic":{"attributes":{"modelId":"TS0601","manufacturerName":"_TZE204_7gclukjs","powerSource":1,"zclVersion":3,"appVersion":74,"stackVersion":0,"hwVersion":1,"dateCode":""}}},"binds":[],"configuredReportings":[],"meta":{}},"242":{"profId":41440,"epId":242,"devId":97,"inClusterList":[],"outClusterList":[33],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":74,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{},"lastSeen":1710022644573}

Comments

Version Zigbee 24G manufacturerName _TZE204_7gclukjs

I don't have tuya brigde to get the correct datapoints

2024-03-09 23:29:10Datapoint 104 not defined for '_TZE204_7gclukjs' with value 1 2024-03-09 23:29:10Datapoint 104 not defined for '_TZE204_7gclukjs' with value 1 2024-03-09 23:29:10Datapoint 9 not defined for '_TZE204_7gclukjs' with value 13 2024-03-09 23:29:10Datapoint 103 not defined for '_TZE204_7gclukjs' with value 5 2024-03-09 23:29:10Datapoint 2 not defined for '_TZE204_7gclukjs' with value 0 2024-03-09 23:29:10Datapoint 102 not defined for '_TZE204_7gclukjs' with value 0 2024-03-09 23:29:11Datapoint 3 not defined for '_TZE204_7gclukjs' with value 75 2024-03-09 23:29:11Datapoint 4 not defined for '_TZE204_7gclukjs' with value 750 2024-03-09 23:29:11Datapoint 105 not defined for '_TZE204_7gclukjs' with value 5 2024-03-09 23:29:11Datapoint 9 not defined for '_TZE204_7gclukjs' with value 12 2024-03-09 23:29:11Datapoint 9 not defined for '_TZE204_7gclukjs' with value 12 2024-03-09 23:29:11Datapoint 9 not defined for '_TZE204_7gclukjs' with value 12 2024-03-09 23:29:11Datapoint 9 not defined for '_TZE204_7gclukjs' with value 12 2024-03-09 23:29:11Datapoint 9 not defined for '_TZE204_7gclukjs' with value 12 2024-03-09 23:29:12Datapoint 9 not defined for '_TZE204_7gclukjs' with value 12 2024-03-09 23:29:13Datapoint 9 not defined for '_TZE204_7gclukjs' with value 12 2024-03-09 23:29:14Datapoint 255 not defined for '_TZE204_7gclukjs' with value false 2024-03-09 23:29:14Datapoint 255 not defined for '_TZE204_7gclukjs' with value false 2024-03-09 23:29:14Datapoint 1 not defined for '_TZE204_7gclukjs' with value 1 2024-03-09 23:29:14Datapoint 104 not defined for '_TZE204_7gclukjs' with value 1 2024-03-09 23:29:14Datapoint 9 not defined for '_TZE204_7gclukjs' with value 12 2024-03-09 23:29:14Datapoint 103 not defined for '_TZE204_7gclukjs' with value 5 2024-03-09 23:29:14Datapoint 2 not defined for '_TZE204_7gclukjs' with value 0 2024-03-09 23:29:14Datapoint 2 not defined for '_TZE204_7gclukjs' with value 0 2024-03-09 23:29:14Datapoint 102 not defined for '_TZE204_7gclukjs' with value 0 2024-03-09 23:29:14Datapoint 3 not defined for '_TZE204_7gclukjs' with value 75

External definition

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 extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;
const ea = exposes.access;
const tuya = require('zigbee-herdsman-converters/lib/tuya');

const definition = {
    // Since a lot of TuYa devices use the same modelID, but use different datapoints
    // it's necessary to provide a fingerprint instead of a zigbeeModel
    fingerprint: [
        {
            // The model ID from: Device with modelID 'TS0601' is not supported
            // You may need to add \u0000 at the end of the name in some cases
            modelID: 'TS0601',
            // The manufacturer name from: Device with modelID 'TS0601' is not supported.
            manufacturerName: '_TZE204_7gclukjs',
        },
    ],
    model: 'TS0601',
    vendor: 'TuYa',
    description: 'RadarTuya',
    fromZigbee: [tuya.fz.datapoints],
    toZigbee: [tuya.tz.datapoints],
    onEvent: tuya.onEventSetTime, // Add this if you are getting no converter for 'commandMcuSyncTime'
    configure: tuya.configureMagicPacket,
        fromZigbee: [tuya.fz.datapoints],
        toZigbee: [tuya.tz.datapoints],
        exposes: [
            e.presence(), e.illuminance_lux(), 
        ],
        meta: {
            tuyaDatapoints: [
     
            ],
    },
};

module.exports = definition;

ayasystems avatar Mar 09 '24 22:03 ayasystems

Atacched an excel with all datapoints registered in debug mode

image

datapoints_debug.xlsx

DataPOint 1 has 0 1 2 values DataPoint 2 is always 0 DataPoint 3 is always 75 DataPoint 4 is always 750 DataPoint 9 seems be distance DataPoint 102 always 0 DataPoint 103 seems be other distance DataPoint 104 has 0 and 1 value DataPoint 105 is always 5 Datapoint 255 is always false

I hope it can be usefull to create the conversion.

Regards!

ayasystems avatar Mar 09 '24 22:03 ayasystems

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 extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;
const ea = exposes.access;
const tuya = require('zigbee-herdsman-converters/lib/tuya');

const definition = {
    // Since a lot of TuYa devices use the same modelID, but use different datapoints
    // it's necessary to provide a fingerprint instead of a zigbeeModel
    fingerprint: [
        {
            // The model ID from: Device with modelID 'TS0601' is not supported
            // You may need to add \u0000 at the end of the name in some cases
            modelID: 'TS0601',
            // The manufacturer name from: Device with modelID 'TS0601' is not supported.
            manufacturerName: '_TZE204_7gclukjs',
        },
    ],
    model: 'TS0601',
    vendor: 'TuYa',
    description: 'RadarTuya',
    fromZigbee: [tuya.fz.datapoints],
    toZigbee: [tuya.tz.datapoints],
    onEvent: tuya.onEventSetTime, // Add this if you are getting no converter for 'commandMcuSyncTime'
    configure: tuya.configureMagicPacket,
        fromZigbee: [tuya.fz.datapoints],
        toZigbee: [tuya.tz.datapoints],
        exposes: [
				exposes.enum('approach_distance', ea.STATE, ['none', 'small_movement', 'large_movement'])
					.withDescription('traffic of movement from the point of view of the radar'),
				e.presence(), 
				 exposes.numeric('current_distance', ea.STATE).withDescription('Distance to target').withUnit('cm'),
				 exposes.numeric('current_distance2', ea.STATE).withDescription('Distance to target 2').withUnit('cm'),
        ],
        meta: {
            tuyaDatapoints: [
				[104, 'presence', tuya.valueConverter.trueFalse1],
				[1, 'approach_distance', tuya.valueConverterBasic.lookup({'none': 0, 'small_movement': 1, 'large_movement': 2})],
				[103, 'current_distance', tuya.valueConverter.raw],
				[9, 'current_distance2', tuya.valueConverter.raw],
            ],
    },
};

module.exports = definition;

I've tested this settings and here is the result:

image

ayasystems avatar Mar 10 '24 07:03 ayasystems

I have bought a zigbee bridge to extract all datapoints. I will back soon

ayasystems avatar Mar 15 '24 11:03 ayasystems

hi, DP103 its illuminance

yarik-m avatar Mar 18 '24 16:03 yarik-m

Updated it a little. Can't determine delay datapoint, but in other parameters I am sure (have tuya gateway).

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 extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;
const ea = exposes.access;
const tuya = require('zigbee-herdsman-converters/lib/tuya');

const definition = {
    // Since a lot of TuYa devices use the same modelID, but use different datapoints
    // it's necessary to provide a fingerprint instead of a zigbeeModel
    fingerprint: [
        {
            // The model ID from: Device with modelID 'TS0601' is not supported
            // You may need to add \u0000 at the end of the name in some cases
            modelID: 'TS0601',
            // The manufacturer name from: Device with modelID 'TS0601' is not supported.
            manufacturerName: '_TZE204_7gclukjs',
        },
    ],
    model: 'TS0601',
    vendor: 'TuYa',
    description: 'RadarTuya',
    fromZigbee: [tuya.fz.datapoints],
    toZigbee: [tuya.tz.datapoints],
    onEvent: tuya.onEventSetTime, // Add this if you are getting no converter for 'commandMcuSyncTime'
    configure: tuya.configureMagicPacket,
        fromZigbee: [tuya.fz.datapoints],
        toZigbee: [tuya.tz.datapoints],
        exposes: [
				exposes.enum('state', ea.STATE, ['none', 'presence', 'move']),
				e.presence(), 
				 exposes.numeric('current_distance', ea.STATE).withDescription('Distance to target').withUnit('cm'),
				 exposes.numeric('illuminance_lux', ea.STATE).withDescription('Illuminance').withUnit('lux'),
				 exposes.numeric('radar_sensitivity', ea.STATE_SET).withValueMin(0).withValueMax(9).withValueStep(1).withDescription('sensitivity of the radar'),
				 exposes.numeric('minimum_range', ea.STATE_SET).withValueMin(0).withValueMax(825).withValueStep(75).withDescription('Minimum range').withUnit('cm'),
				 exposes.numeric('maximum_range', ea.STATE_SET).withValueMin(75).withValueMax(900).withValueStep(75).withDescription('Maximum range').withUnit('cm'),
        ],
        meta: {
            tuyaDatapoints: [
				[104, 'presence', tuya.valueConverter.trueFalse1],
				[1, 'state', tuya.valueConverterBasic.lookup({'none': 0, 'presence': 1, 'move': 2})],
				[103, 'illuminance_lux', tuya.valueConverter.raw],
				[9, 'current_distance', tuya.valueConverter.raw],
                		[105, 'radar_sensitivity', tuya.valueConverter.raw],
                		[3, 'minimum_range', tuya.valueConverter.raw],
                		[4, 'maximum_range', tuya.valueConverter.raw],
                
            ],
    },
};

module.exports = definition;

Vallefor avatar Mar 19 '24 22:03 Vallefor

I can see these values with tuya bridge on iot.tuya cloud

{"1":"Induction state" ,"2":"Motion Sensitivity" ,"3":"Near Detection" ,"4":"Far Detection" ,"9":"Target distance" ,"102":"Presence Sensitivity" ,"103":"Illuminance Value" ,"104":"ζœ‰ζ— δΊΊηŠΆζ€" ,"105":"Delay Time"}

and these options to set values

image

image

So i think this is correct.

Note that state has beed changed to none/presence/Move and presence and seems works fine


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 extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;
const ea = exposes.access;
const tuya = require('zigbee-herdsman-converters/lib/tuya');

const definition = {
    // Since a lot of TuYa devices use the same modelID, but use different datapoints
    // it's necessary to provide a fingerprint instead of a zigbeeModel
    fingerprint: [
        {
            // The model ID from: Device with modelID 'TS0601' is not supported
            // You may need to add \u0000 at the end of the name in some cases
            modelID: 'TS0601',
            // The manufacturer name from: Device with modelID 'TS0601' is not supported.
            manufacturerName: '_TZE204_7gclukjs',
        },
    ],
    model: 'TS0601',
    vendor: 'TuYa',
    description: 'RadarTuya',
    fromZigbee: [tuya.fz.datapoints],
    toZigbee: [tuya.tz.datapoints],
    onEvent: tuya.onEventSetTime, // Add this if you are getting no converter for 'commandMcuSyncTime'
    configure: tuya.configureMagicPacket,
        fromZigbee: [tuya.fz.datapoints],
        toZigbee: [tuya.tz.datapoints],
        exposes: [
				e.enum('state', ea.STATE, ['none', 'Presence', 'Move and presence']).withDescription('state of taget'),
				e.presence(), 
				exposes.numeric('illuminance_lux', ea.STATE).withDescription('Illuminance').withUnit('lux'),
				exposes.numeric('current_distance', ea.STATE).withDescription('Distance to target').withUnit('cm'),
				exposes.numeric('delay_time', ea.STATE_SET).withValueMin(0).withValueMax(600).withValueStep(5).withDescription('Delay time').withUnit('s'),
				exposes.numeric('minimum_range', ea.STATE_SET).withValueMin(0).withValueMax(825).withValueStep(75).withDescription('Near Detection').withUnit('cm'),		
				exposes.numeric('maximum_range', ea.STATE_SET).withValueMin(75).withValueMax(900).withValueStep(75).withDescription('Far Detection').withUnit('cm'),
				exposes.numeric('motion_sensitivity', ea.STATE_SET).withDescription('Motion Sensitivity').withValueMin(0).withValueMax(10).withValueStep(1).withDescription('Motion Sensitivity'),		
        ],
        meta: {
            tuyaDatapoints: [
				[104, 'presence', tuya.valueConverter.trueFalse1],
				[1, 'state', tuya.valueConverterBasic.lookup({'none': 0, 'Presence': 1, 'Move and presence': 2})],
				[103, 'illuminance_lux', tuya.valueConverter.raw],
				[9, 'current_distance', tuya.valueConverter.raw],
				[105, 'delay_time',   tuya.valueConverter.raw],
                [3, 'minimum_range', tuya.valueConverter.raw],
                [4, 'maximum_range', tuya.valueConverter.raw],
                [2, 'motion_sensitivity', tuya.valueConverter.raw],
				
            ],
    },
};

module.exports = definition;

ayasystems avatar Mar 22 '24 11:03 ayasystems

looks good, could you make a pull request?

Koenkk avatar Mar 23 '24 09:03 Koenkk

I can see these values with tuya bridge on iot.tuya cloud

{"1":"Induction state" ,"2":"Motion Sensitivity" ,"3":"Near Detection" ,"4":"Far Detection" ,"9":"Target distance" ,"102":"Presence Sensitivity" ,"103":"Illuminance Value" ,"104":"ζœ‰ζ— δΊΊηŠΆζ€" ,"105":"Delay Time"}

and these options to set values

image

image

So i think this is correct.

Note that state has beed changed to none/presence/Move and presence and seems works fine


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 extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;
const ea = exposes.access;
const tuya = require('zigbee-herdsman-converters/lib/tuya');

const definition = {
    // Since a lot of TuYa devices use the same modelID, but use different datapoints
    // it's necessary to provide a fingerprint instead of a zigbeeModel
    fingerprint: [
        {
            // The model ID from: Device with modelID 'TS0601' is not supported
            // You may need to add \u0000 at the end of the name in some cases
            modelID: 'TS0601',
            // The manufacturer name from: Device with modelID 'TS0601' is not supported.
            manufacturerName: '_TZE204_7gclukjs',
        },
    ],
    model: 'TS0601',
    vendor: 'TuYa',
    description: 'RadarTuya',
    fromZigbee: [tuya.fz.datapoints],
    toZigbee: [tuya.tz.datapoints],
    onEvent: tuya.onEventSetTime, // Add this if you are getting no converter for 'commandMcuSyncTime'
    configure: tuya.configureMagicPacket,
        fromZigbee: [tuya.fz.datapoints],
        toZigbee: [tuya.tz.datapoints],
        exposes: [
				e.enum('state', ea.STATE, ['none', 'Presence', 'Move and presence']).withDescription('state of taget'),
				e.presence(), 
				exposes.numeric('illuminance_lux', ea.STATE).withDescription('Illuminance').withUnit('lux'),
				exposes.numeric('current_distance', ea.STATE).withDescription('Distance to target').withUnit('cm'),
				exposes.numeric('delay_time', ea.STATE_SET).withValueMin(0).withValueMax(600).withValueStep(5).withDescription('Delay time').withUnit('s'),
				exposes.numeric('minimum_range', ea.STATE_SET).withValueMin(0).withValueMax(825).withValueStep(75).withDescription('Near Detection').withUnit('cm'),		
				exposes.numeric('maximum_range', ea.STATE_SET).withValueMin(75).withValueMax(900).withValueStep(75).withDescription('Far Detection').withUnit('cm'),
				exposes.numeric('motion_sensitivity', ea.STATE_SET).withDescription('Motion Sensitivity').withValueMin(0).withValueMax(10).withValueStep(1).withDescription('Motion Sensitivity'),		
        ],
        meta: {
            tuyaDatapoints: [
				[104, 'presence', tuya.valueConverter.trueFalse1],
				[1, 'state', tuya.valueConverterBasic.lookup({'none': 0, 'Presence': 1, 'Move and presence': 2})],
				[103, 'illuminance_lux', tuya.valueConverter.raw],
				[9, 'current_distance', tuya.valueConverter.raw],
				[105, 'delay_time',   tuya.valueConverter.raw],
                [3, 'minimum_range', tuya.valueConverter.raw],
                [4, 'maximum_range', tuya.valueConverter.raw],
                [2, 'motion_sensitivity', tuya.valueConverter.raw],
				
            ],
    },
};

module.exports = definition;

I can't change any value like sensitivity.....

justicepng avatar Mar 23 '24 11:03 justicepng

I am trying to integrate exact this device. Is it already possible to add it with an external convertor? Or should I wait a bit? Could you please give me instructions how to?

BartCardan avatar Apr 05 '24 09:04 BartCardan

I've also just bought this device & trying to understand where I can find the latest appropriate external converter to try?

smithbill17 avatar Apr 05 '24 10:04 smithbill17

I just bought one of these devices on AliExpress & discovered that Zigbee2MQTT didn't recognise it. Google brought me here & using the details that the clever guys above posted, I've got it working now - thank you!

Just to help others that Google brings here, I simply copied the code ayasystems posted above pasted it into a file I named _TZE204_7gclukjs.js (I don't know if I needed to, but I removed the 'const extend' line mentioned in issue #22026 ), then saved the file in my zigbee2mqtt folder within HomeAssistant.

Then I went to the Zigbee2MQTT frontend & within the menu there I selected Settings > External converters and then added the _TZE204_7gclukjs.js file I saved earlier.

Restarted HomeAssistant & now my Presence sensor seems to be working fine 😁

I'm not sure about all the various available parameters as essentially I'm just using presence yes/no, but it works fine, so I'm happy.

Thank you guys πŸ‘

smithbill17 avatar Apr 05 '24 13:04 smithbill17

This converter works fine for me. I used all from @ayasystems comment and changed delay_time to delay. Do not know why but delay_time everytime throw an error. May be it some kind of reserved property...

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 extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;
const ea = exposes.access;
const tuya = require('zigbee-herdsman-converters/lib/tuya');

const definition = {
    // Since a lot of TuYa devices use the same modelID, but use different datapoints
    // it's necessary to provide a fingerprint instead of a zigbeeModel
    fingerprint: [
        {
            // The model ID from: Device with modelID 'TS0601' is not supported
            // You may need to add \u0000 at the end of the name in some cases
            modelID: 'TS0601',
            // The manufacturer name from: Device with modelID 'TS0601' is not supported.
            manufacturerName: '_TZE204_7gclukjs',
        },
    ],
    model: 'TS0601',
    vendor: 'TuYa',
    description: 'RadarTuya',
    fromZigbee: [tuya.fz.datapoints],
    toZigbee: [tuya.tz.datapoints],
    onEvent: tuya.onEventSetTime, // Add this if you are getting no converter for 'commandMcuSyncTime'
    configure: tuya.configureMagicPacket,
        fromZigbee: [tuya.fz.datapoints],
        toZigbee: [tuya.tz.datapoints],
        exposes: [
				e.enum('state', ea.STATE, ['none', 'Presence', 'Move and presence']).withDescription('state of taget'),
				e.presence(), 
				exposes.numeric('illuminance_lux', ea.STATE).withDescription('Illuminance').withUnit('lux'),
				exposes.numeric('current_distance', ea.STATE).withDescription('Distance to target').withUnit('cm'),
				exposes.numeric('delay', ea.STATE_SET).withValueMin(0).withValueMax(600).withValueStep(1).withDescription('Delay time').withUnit('s'),
				exposes.numeric('minimum_range', ea.STATE_SET).withValueMin(0).withValueMax(825).withValueStep(75).withDescription('Near Detection').withUnit('cm'),		
				exposes.numeric('maximum_range', ea.STATE_SET).withValueMin(75).withValueMax(900).withValueStep(75).withDescription('Far Detection').withUnit('cm'),
				exposes.numeric('motion_sensitivity', ea.STATE_SET).withDescription('Motion Sensitivity').withValueMin(0).withValueMax(10).withValueStep(1).withDescription('Motion Sensitivity'),		
        ],
        meta: {
            tuyaDatapoints: [
				[104, 'presence', tuya.valueConverter.trueFalse1],
				[1, 'state', tuya.valueConverterBasic.lookup({'none': 0, 'Presence': 1, 'Move and presence': 2})],
				[103, 'illuminance_lux', tuya.valueConverter.raw],
				[9, 'current_distance', tuya.valueConverter.raw],
				[105, 'delay', tuya.valueConverter.raw],
                [3, 'minimum_range', tuya.valueConverter.raw],
                [4, 'maximum_range', tuya.valueConverter.raw],
                [2, 'motion_sensitivity', tuya.valueConverter.raw],
				
            ],
    },
};

module.exports = definition;

Vallefor avatar Apr 05 '24 13:04 Vallefor

I just bought one of these devices on AliExpress & discovered that Zigbee2MQTT didn't recognise it. Google brought me here & using the details that the clever guys above posted, I've got it working now - thank you!

Just to help others that Google brings here, I simply copied the code ayasystems posted above pasted it into a file I named _TZE204_7gclukjs.js (I don't know if I needed to, but I removed the 'const extend' line mentioned in issue #22026 ), then saved the file in my zigbee2mqtt folder within HomeAssistant.

Then I went to the Zigbee2MQTT frontend & within the menu there I selected Settings > External converters and then added the _TZE204_7gclukjs.js file I saved earlier.

Restarted HomeAssistant & now my Presence sensor seems to be working fine 😁

I'm not sure about all the various available parameters as essentially I'm just using presence yes/no, but it works fine, so I'm happy.

Thank you guys πŸ‘

Thanks for taking the time to write these helpful step by step instructions, my sensor appears to be working fine now πŸ‘. Just to note. I did need to remove the 'const extend' line mentioned in issue #22026 for it to work (didnt work if I left it in).

And thanks to all the other posters above for their work on getting this supported!

anushian avatar Apr 06 '24 14:04 anushian

This one appears to work correctly:

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 e = exposes.presets;
const ea = exposes.access;
const tuya = require('zigbee-herdsman-converters/lib/tuya');

const definition = {
    // Since a lot of TuYa devices use the same modelID, but use different datapoints
    // it's necessary to provide a fingerprint instead of a zigbeeModel
    fingerprint: [
        {
            // The model ID from: Device with modelID 'TS0601' is not supported
            // You may need to add \u0000 at the end of the name in some cases
            modelID: 'TS0601',
            // The manufacturer name from: Device with modelID 'TS0601' is not supported.
            manufacturerName: '_TZE204_7gclukjs',
        },
    ],
    model: 'TS0601',
    vendor: 'TuYa',
    description: 'RadarTuya',
    fromZigbee: [tuya.fz.datapoints],
    toZigbee: [tuya.tz.datapoints],
    onEvent: tuya.onEventSetTime, // Add this if you are getting no converter for 'commandMcuSyncTime'
    configure: tuya.configureMagicPacket,
        fromZigbee: [tuya.fz.datapoints],
        toZigbee: [tuya.tz.datapoints],
        exposes: [
				e.enum('state', ea.STATE, ['none', 'Presence', 'Move and presence']).withDescription('state of taget'),
				e.presence(),
				exposes.numeric('illuminance_lux', ea.STATE).withDescription('Illuminance').withUnit('lux'),
				exposes.numeric('current_distance', ea.STATE).withDescription('Distance to target').withUnit('cm'),
				exposes.numeric('delay', ea.STATE_SET).withValueMin(0).withValueMax(600).withValueStep(5).withDescription('Delay time').withUnit('s'),
				exposes.numeric('minimum_range', ea.STATE_SET).withValueMin(0).withValueMax(825).withValueStep(75).withDescription('Near Detection').withUnit('cm'),
				exposes.numeric('maximum_range', ea.STATE_SET).withValueMin(75).withValueMax(900).withValueStep(75).withDescription('Far Detection').withUnit('cm'),
				exposes.numeric('motion_sensitivity', ea.STATE_SET).withDescription('Motion Sensitivity').withValueMin(0).withValueMax(10).withValueStep(1).withDescription('Motion Sensitivity'),
        ],
        meta: {
            tuyaDatapoints: [
				[104, 'presence', tuya.valueConverter.trueFalse1],
				[1, 'state', tuya.valueConverterBasic.lookup({'none': 0, 'Presence': 1, 'Move and presence': 2})],
				[103, 'illuminance_lux', tuya.valueConverter.raw],
				[9, 'current_distance', tuya.valueConverter.raw],
				[105, 'delay',   tuya.valueConverter.raw],
                [3, 'minimum_range', tuya.valueConverter.raw],
                [4, 'maximum_range', tuya.valueConverter.raw],
                [2, 'motion_sensitivity', tuya.valueConverter.raw],

            ],
    },
};

module.exports = definition;

(i.e. without the const extend = ... and delay_time -> delay)

However, the problem is that it's triggering the presence sensor when nobody's around. I tried tuning the motion_sensitivity - both with low and high values, and it's still detecting motion. I have another sensor, but of 5GHz type and that one works just fine.

May this be a case of a faulty unit, or is there something I can try to fix this?

shalak avatar Apr 11 '24 11:04 shalak

I have same device. Upon first plugin and registering I got a whole lot of error messages in z2m. With initial instructions from https://github.com/Koenkk/zigbee2mqtt/issues/21738#issuecomment-2039818205 and file from https://github.com/Koenkk/zigbee2mqtt/issues/21738#issuecomment-2049511623 (I had to place the file within docker_data_dir/data) errors are gone now. But I only get linkquality messages and no motion. Also when I check the exposes tab in the device I only see "Empty exposes definition". Is this to be expected?

anno73 avatar Apr 11 '24 15:04 anno73

I have same device. Upon first plugin and registering I got a whole lot of error messages in z2m. With initial instructions from #21738 (comment) and file from #21738 (comment) (I had to place the file within docker_data_dir/data) errors are gone now. But I only get linkquality messages and no motion. Also when I check the exposes tab in the device I only see "Empty exposes definition". Is this to be expected?

Did you set external_converter into yaml ?

image

ayasystems avatar Apr 11 '24 16:04 ayasystems

Yes it is there. I moved the file to the same directory as configuration.yaml and after a restart the Exposes tab shows a lot entries. And so do the mqtt messages. Seems to work now :-)

anno73 avatar Apr 11 '24 17:04 anno73

Thank you, this has been very helpful!

I've been able to integrate z2m successfully and it's working quite well within iobroker. I'm running z2m separately without any issues. However, I'm encountering a single problem: the current_distance value consistently displays between 10-50cm, while my actual distance is around 300-400cm.

iobroker_radarr

heiko1988 avatar Apr 11 '24 17:04 heiko1988

Hi, this in log zigbee2mqtt "Note that external converters are not meant for long term usage, it's meant for local testing after which a pull request should be created to add out-of-the-box support for the device"

yarik-m avatar Apr 12 '24 08:04 yarik-m

Does everyone's external converter fall off?

yarik-m avatar Apr 12 '24 08:04 yarik-m

Hello, I have the issue, that the vendor: _TZE204_7gclukjs is unknown at Homeassistant/zigbee2mqtt for zigbeemodel TS0601 I found your code here at this page to let the radar sensor run - how I have to implement it into zigbe2mqtt in homeassistant? thank you in advance for help :-)

thombec avatar Apr 12 '24 08:04 thombec

Hello, I have the issue, that the vendor: _TZE204_7gclukjs is unknown at Homeassistant/zigbee2mqtt for zigbeemodel TS0601 I found your code here at this page to let the radar sensor run - how I have to implement it into zigbe2mqtt in homeassistant? thank you in advance for help :-)

See my comment above for basic instructions.

smithbill17 avatar Apr 12 '24 08:04 smithbill17

Hello, I have the issue, that the vendor: _TZE204_7gclukjs is unknown at Homeassistant/zigbee2mqtt for zigbeemodel TS0601 I found your code here at this page to let the radar sensor run - how I have to implement it into zigbe2mqtt in homeassistant? thank you in advance for help :-)

You need to:

  1. Create a file with e.g. _TZE204_7gclukjs.js in /share/zigbee2mqtt folder in Home Assistant and paste the content there
  2. Add the _TZE204_7gclukjs.js via the zigbee2mqtt Settings -> Settings -> External Converters -> "+"
  3. Restart zigbee2mqtt via the Add-On panel

shalak avatar Apr 12 '24 09:04 shalak

looks good, could you make a pull request?

I dont know the steps to do it. Could you do it?

Regards

ayasystems avatar Apr 12 '24 09:04 ayasystems

Can I use this converter code for ZHA by adding the code as a new quirk file? I do not use zigbee2mqtt

casa3c avatar Apr 13 '24 07:04 casa3c

After implementing the code above via "external converters" my device now shows the right parameters. Perfect - thank you!

But a problem was discovered after adding the device. Battery-powered sensors nearby have lost connection to the server after start running the device. A large number of errors from this devices suddenly appear in the log from Zigbee2MQTT.

one example of the errors: grafik

After deleting of the device this problem was gone. It seems that the repeater functionality does not work properly. Did you also notice this behaviour?

thombec avatar Apr 13 '24 08:04 thombec

For people struggling to make this thing work stable: I found this setup working good.

  • Sensitivity 8/10
  • Detection range 375 to 675 cm
  • Delay 1s

It looks like value decoding is some way wrong, so these values don't make sense, but actually it works perfectly fine in 3*4 meters kitchen (both motion and presence detection). Distance detection is a mess (showing 20ish cm while I'm 2.5 meters away). UPD: I have 24Ghz version of this sensor UPD2: I'm using the external converter from @Vallefor https://github.com/Koenkk/zigbee2mqtt/issues/21738#issuecomment-2039849157

opravdin avatar Apr 25 '24 10:04 opravdin

For people struggling to make this thing work stable: I found this setup working good.

  • Sensitivity 8/10
  • Detection range 375 to 675 cm
  • Delay 1s

It looks like value decoding is some way wrong, so these values don't make sense, but actually it works perfectly fine in 3*4 meters kitchen (both motion and presence detection). Distance detection is a mess (showing 20ish cm while I'm 2.5 meters away). UPD: I have 24Ghz version of this sensor

With your advices the sensor is extremely fast to react. I couldn't believe it. Thank you so much!

matte-a avatar Apr 28 '24 18:04 matte-a

looks good, could you make a pull request?

Hello! Where I need place file with this converter to make pull request ?

Aksenov3000 avatar May 07 '24 20:05 Aksenov3000

I'm trying to get this working on my haos on my rpi5 I've got the file in the right place with the content from one of the above comments , but it still says unsupported device image

Warning 2024-05-08 15:04:54Device '0xa4c138522d992e20' with Zigbee model 'TS0601' and manufacturer name '_TZE204_7gclukjs' is NOT supported, please follow https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html

gabriel403 avatar May 08 '24 14:05 gabriel403