Open djdevil opened 3 months ago
And me too
Also following this one
Following
Following
i have the same presence detector too, following
In order to add support for this Tuya device, we need to figure out what datapoints it uses. See this guide on how to do that
Not able to figure out the datapoints, but following!
I found here the datapoints for the ZY-HPS01-5.8G https://github.com/make-all/tuya-local/blob/main/custom_components/tuya_local/devices/zyhps01_human_presence_sensor.yaml
Got this device working with illuminance and presence states, other parameters can be set but not read at first
Edit Added fix from https://github.com/Koenkk/zigbee2mqtt/issues/23705#issuecomment-2345003744 and https://github.com/Koenkk/zigbee2mqtt/issues/23705#issuecomment-2345832981
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 modernExtend = require('zigbee-herdsman-converters/lib/modernExtend');
const e = exposes.presets;
const ea = exposes.access;
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const definition = {
fingerprint: [
{
modelID: 'TS0601',
manufacturerName: '_TZE204_ex3rcdha',
},
],
model: 'TS0601_?',
vendor: 'Tuya',
description: 'mmWave radar ZY_HPS01 V1.2',
fromZigbee: [tuya.fz.datapoints],
toZigbee: [tuya.tz.datapoints],
configure: tuya.configureMagicPacket,
extend: [ ],
exposes: [
e.illuminance_lux(),
e.occupancy(),
exposes.numeric('presence_timeout', ea.STATE_SET).withValueMin(0).withValueMax(180).withValueStep(1)
.withDescription('Presence timeout').withUnit('s'),
exposes.numeric('move_sensitivity', ea.STATE_SET).withValueMin(0).withValueMax(10).withValueStep(1)
.withDescription('sensitivity of the radar').withUnit('X'),
exposes.numeric('move_minimum_range', ea.STATE_SET).withValueMin(0).withValueMax(600).withValueStep(10)
.withDescription('Movement minimum range').withUnit('cm'),
exposes.numeric('move_maximum_range', ea.STATE_SET).withValueMin(0).withValueMax(600).withValueStep(10)
.withDescription('Movement maximum range').withUnit('cm'),
exposes.numeric('breath_sensitivity', ea.STATE_SET).withValueMin(0).withValueMax(10).withValueStep(1)
.withDescription('Breath sensitivity of the radar').withUnit('X'),
exposes.numeric('breath_minimum_range', ea.STATE_SET).withValueMin(0).withValueMax(600).withValueStep(10)
.withDescription('Breath minimum range').withUnit('cm'),
exposes.numeric('breath_maximum_range', ea.STATE_SET).withValueMin(0).withValueMax(600).withValueStep(10)
.withDescription('Breath maximum range').withUnit('cm'),
],
meta: {
tuyaDatapoints: [
[12, 'illuminance_lux', tuya.valueConverter.raw],
[101, 'occupancy', tuya.valueConverter.trueFalse0],
[104, 'presence_timeout', tuya.valueConverter.raw],
[105, 'move_sensitivity', tuya.valueConverter.raw],
[107, 'breath_sensitivity', tuya.valueConverter.raw],
[109, 'move_maximum_range', tuya.valueConverter.raw],
[110, 'move_minimum_range', tuya.valueConverter.raw],
[111, 'breath_maximum_range', tuya.valueConverter.raw],
[112, 'breath_minimum_range', tuya.valueConverter.raw],
],
}
};
module.exports = definition;
Sorry I missed one edition on tuyaDatapoints
where is: [105, 'movesensitivity', tuya.valueConverter.raw],
should be: [105, 'move_sensitivity', tuya.valueConverter.raw],
I will fix on the post
Em qua., 11 de set. de 2024 às 14:35, djdevil @.***> escreveu:
Got this device working with illuminance and presence states, other parameters can be set but not read at first
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 modernExtend = require('zigbee-herdsman-converters/lib/modernExtend'); const e = exposes.presets; const ea = exposes.access; const tuya = require('zigbee-herdsman-converters/lib/tuya');
const definition = { fingerprint: [ { modelID: 'TS0601', manufacturerName: '_TZE204ex3rcdha', }, ], model: 'TS0601?', vendor: 'Tuya', description: 'mmWave radar ZY_HPS01 V1.2', fromZigbee: [tuya.fz.datapoints], toZigbee: [tuya.tz.datapoints], configure: tuya.configureMagicPacket, extend: [ ], exposes: [ e.illuminance_lux(), e.presence(), exposes.numeric('presence_timeout', ea.STATE_SET).withValueMin(0).withValueMax(180).withValueStep(1) .withDescription('Presence timeout').withUnit('s'), exposes.numeric('move_sensitivity', ea.STATE_SET).withValueMin(0).withValueMax(10).withValueStep(1) .withDescription('sensitivity of the radar').withUnit('X'), exposes.numeric('move_minimum_range', ea.STATE_SET).withValueMin(0).withValueMax(600).withValueStep(10) .withDescription('Movement minimum range').withUnit('cm'), exposes.numeric('move_maximum_range', ea.STATE_SET).withValueMin(0).withValueMax(600).withValueStep(10) .withDescription('Movement maximum range').withUnit('cm'), exposes.numeric('breath_sensitivity', ea.STATE_SET).withValueMin(0).withValueMax(10).withValueStep(1) .withDescription('Breath sensitivity of the radar').withUnit('X'), exposes.numeric('breath_minimum_range', ea.STATE_SET).withValueMin(0).withValueMax(600).withValueStep(10) .withDescription('Breath minimum range').withUnit('cm'), exposes.numeric('breath_maximum_range', ea.STATE_SET).withValueMin(0).withValueMax(600).withValueStep(10) .withDescription('Breath maximum range').withUnit('cm'),
], meta: { tuyaDatapoints: [ [12, 'illuminance_lux', tuya.valueConverter.raw], [101, 'presence', tuya.valueConverter.trueFalse0], [104, 'presence_timeout', tuya.valueConverter.raw], [105, 'movesensitivity', tuya.valueConverter.raw], [107, 'breath_sensitivity', tuya.valueConverter.raw], [109, 'move_maximum_range', tuya.valueConverter.raw], [110, 'move_minimum_range', tuya.valueConverter.raw], [111, 'breath_maximum_range', tuya.valueConverter.raw], [112, 'breath_minimum_range', tuya.valueConverter.raw], ], }
};
the code gives me a syntax error and doesn't seem to function, as if we are missing
data const tzDatapoints = { ...tuya.tz.datapoints, key: Array.isArray(tuya.tz.datapoints.key) ? [...tuya.tz.datapoints.key, 'minimum_range', 'maximum_range', 'detection_delay', 'fading_time'] : ['minimum_range', 'maximum_range', 'detection_delay', 'fading_time'] };
— Reply to this email directly, view it on GitHub https://github.com/Koenkk/zigbee2mqtt/issues/23705#issuecomment-2344290398, or unsubscribe https://github.com/notifications/unsubscribe-auth/AW2H7KXONOU62DX36XUA6JTZWB5MNAVCNFSM6AAAAABM6UCOBKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBUGI4TAMZZHA . You are receiving this because you commented.Message ID: @.***>
I add this line for an external *.js script
module.exports = definition;
and now the code works fine!
@motezuki Thank you very much for the work. It works fine for me. Is there any way to change the icon? edit: the illuminance don't work
@Javisen maybe you have a slightly different device, with a different data point for illuminance. Could you verify the datapoints using these instructions?
The icons can be changed directly on the configuration of the entity card
@Javisen maybe you have a slightly different device, with a different data point for illuminance. Could you verify the datapoints using these instructions?
The icons can be changed directly on the configuration of the entity card
I think it might be the device. When you bring a flashlight close to the sensor you get lux values but very low (25 lux). Also, I don't know how I can find the device on yours if I'm using it locally.
Thanks for al the work. It works but cant use the distance settings, getting an error like this "z2m: No converter available for 'move_minimum_range' (340)"
following. I was looking at my TS0601 quirk, and I do not see how I can add this code in.
Link
https://it.aliexpress.com/item/1005007335061248.html?gatewayAdapt=glo2ita
Database entry
{"id":54,"type":"Router","ieeeAddr":"0xa4c13887abb15e5d","nwkAddr":37763,"manufId":4417,"manufName":"_TZE204_ex3rcdha","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":{"stackVersion":0,"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":1724348619720}
Comments
I purchased this new sensor, but even by modifying the converter it doesn't seem to work, is there anyone who can help me, thanks
External definition