diff --git a/src/devices/tuya.ts b/src/devices/tuya.ts index 56f15787426de..750ccdbfa1d4b 100644 --- a/src/devices/tuya.ts +++ b/src/devices/tuya.ts @@ -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)})], ], }, }, @@ -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: [ @@ -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], + ], }, }, diff --git a/src/lib/tuya.ts b/src/lib/tuya.ts index 84d970ccccfae..fa1ba36fd0cf5 100644 --- a/src/lib/tuya.ts +++ b/src/lib/tuya.ts @@ -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