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

Added command for ZG-204ZM battery human millimeter wave #7553

Merged
merged 14 commits into from
May 31, 2024
18 changes: 16 additions & 2 deletions src/devices/tuya.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6212,18 +6212,23 @@ const definitions: Definition[] = [
},
},
{
fingerprint: tuya.fingerprint('TS0601', ['_TZE200_8isdky6j']),
fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_8isdky6j'}, {modelID: 'TS0225', manufacturerName: '_TZE200_p6fuhvez'}],
model: 'ZG-225Z',
vendor: 'TuYa',
description: 'Gas sensor',
fromZigbee: [tuya.fz.datapoints],
toZigbee: [tuya.tz.datapoints],
configure: tuya.configureMagicPacket,
exposes: [e.gas(), tuya.exposes.gasValue().withUnit('ppm')],
exposes: [e.gas(), tuya.exposes.gasValue().withUnit('ppm'),
e.enum('sensitivity', ea.STATE_SET, ['low', 'medium', 'high']).withDescription('Gas sensor sensitivity'),
e.enum('ring', ea.STATE_SET, ['ring1', 'ring2']).withDescription('Ring'),
],
meta: {
tuyaDatapoints: [
[1, 'gas', tuya.valueConverter.trueFalse0],
[2, 'gas_value', tuya.valueConverter.raw],
[101, 'sensitivity', tuya.valueConverterBasic.lookup({'low': tuya.enum(0), 'medium': tuya.enum(1), 'high': tuya.enum(2)})],
[6, 'ring', tuya.valueConverterBasic.lookup({'ring1': tuya.enum(0), 'ring2': tuya.enum(1)})],
],
},
},
Expand Down Expand Up @@ -6333,6 +6338,10 @@ const definitions: Definition[] = [
e.numeric('static_detection_sensitivity', ea.STATE_SET).withValueMin(0).withValueMax(10).withValueStep(1).withUnit('x')
.withDescription('Static detection sensitivity'),
e.binary('indicator', ea.STATE_SET, 'ON', 'OFF').withDescription('LED indicator mode'),
e.enum('motion_detection_mode', ea.STATE_SET, ['Only PIR', 'PIR+Dadar', 'Only Dadar'])
.withDescription('Motion detection mode (Firmware version>=0122052017)'),
e.numeric('motion_detection_sensitivity', ea.STATE_SET).withValueMin(0).withValueMax(10).withValueStep(1).withUnit('x')
.withDescription('Motion detection sensitivity (Firmware version>=0122052017)'),
],
meta: {
tuyaDatapoints: [
Expand All @@ -6346,6 +6355,11 @@ const definitions: Definition[] = [
[2, 'static_detection_sensitivity', tuya.valueConverter.raw],
[107, 'indicator', tuya.valueConverter.onOff],
[121, 'battery', tuya.valueConverter.raw],
[122, 'motion_detection_mode', tuya.valueConverterBasic.lookup({
'only_pir': tuya.enum(0), 'pir_and_dadar': tuya.enum(1), 'only_dadar': tuya.enum(2),
})],
[123, 'motion_detection_sensitivity', tuya.valueConverter.raw],

],
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/lib/tuya.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ const tuyaTz = {
'buzzer_feedback', 'rf_pairing', 'max_temperature_alarm', 'min_temperature_alarm', 'max_humidity_alarm', 'min_humidity_alarm',
'temperature_periodic_report', 'humidity_periodic_report', 'temperature_sensitivity', 'humidity_sensitivity', 'temperature_alarm',
'humidity_alarm', 'move_sensitivity', 'radar_range', 'presence_timeout', 'update_frequency', 'remote_pair', 'motor_working_mode',
'restart_mode', 'rf_remote_control',
'restart_mode', 'rf_remote_control', 'motion_detection_sensitivity', 'motion_detection_mode',
],
convertSet: async (entity, key, value, meta) => {
// A set converter is only called once; therefore we need to loop
Expand Down
Loading