Skip to content

Commit

Permalink
feat(add): TS0225 (#6036)
Browse files Browse the repository at this point in the history
* feat(add): _TZE200_hl0ss9oa

* Update tuya.ts

---------

Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
  • Loading branch information
makstech and Koenkk authored Aug 3, 2023
1 parent 4b94f1b commit d64badb
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
53 changes: 53 additions & 0 deletions src/devices/tuya.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4271,6 +4271,59 @@ const definitions: Definition[] = [
],
},
},
{
fingerprint: tuya.fingerprint('TS0225', ['_TZE200_hl0ss9oa']),
model: 'TS0225',
vendor: 'TuYa',
description: '24Ghz human presence sensor',
fromZigbee: [tuya.fz.datapoints],
toZigbee: [tuya.tz.datapoints],
exposes: [
e.presence(),
e.enum('motion_state', ea.STATE, ['none', 'large', 'small', 'static']).withDescription('Motion state'),
e.illuminance_lux(),
e.numeric('fading_time', ea.STATE_SET).withValueMin(0).withValueMax(600).withValueStep(1).withUnit('s')
.withDescription('Presence keep time'),
e.numeric('large_motion_detection_distance', ea.STATE_SET).withValueMin(0).withValueMax(10).withValueStep(0.01).withUnit('m')
.withDescription('Large motion detection distance'),
e.numeric('large_motion_detection_sensitivity', ea.STATE_SET).withValueMin(0).withValueMax(10).withValueStep(1).withUnit('x')
.withDescription('Large 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.enum('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('light_mode', ea.STATE_SET, 'ON', 'OFF').withDescription('LED indicator mode'),
],
meta: {
tuyaDatapoints: [
[1, 'presence', tuya.valueConverter.trueFalse1],
[20, 'illuminance_lux', tuya.valueConverter.raw],
[11, 'motion_state', tuya.valueConverterBasic.lookup({
'none': tuya.enum(0), 'large': tuya.enum(1), 'small': tuya.enum(2), 'static': tuya.enum(3),
})],
[12, 'fading_time', tuya.valueConverter.raw],
[13, 'large_motion_detection_distance', tuya.valueConverter.divideBy100],
[15, 'large_motion_detection_sensitivity', tuya.valueConverter.raw],
[14, 'small_motion_detection_distance', tuya.valueConverter.divideBy100],
[16, 'small_motion_detection_sensitivity', tuya.valueConverter.raw],
[103, 'static_detection_distance', tuya.valueConverter.divideBy100],
[104, 'static_detection_sensitivity', tuya.valueConverter.raw],
[105, 'mode', tuya.valueConverterBasic.lookup({'arm': tuya.enum(0), 'off': tuya.enum(1), 'alarm': tuya.enum(2)})],
[102, 'alarm_volume', tuya.valueConverterBasic.lookup({
'low': tuya.enum(0), 'medium': tuya.enum(1), 'high': tuya.enum(2), 'mute': tuya.enum(3),
})],
[101, 'alarm_time', tuya.valueConverter.raw],
[24, 'light_mode', tuya.valueConverter.onOff],
],
},
},
{
fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_whkgqxse'}],
model: 'JM-TRH-ZGB-V1',
Expand Down
4 changes: 3 additions & 1 deletion src/lib/tuya.ts
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,9 @@ const tuyaTz = {
'motor_speed', 'timer', 'reset_frost_lock', 'schedule_periodic', 'schedule_weekday', 'backlight_mode', 'calibration', 'motor_steering',
'mode', 'lower', 'upper', 'delay', 'reverse', 'touch', 'program', 'light_mode', 'switch_mode',
...[1, 2, 3, 4, 5, 6].map((no) => `schedule_slot_${no}`), 'minimum_range', 'maximum_range', 'detection_delay', 'fading_time',
'alarm', 'type', 'volume', 'ringtone', 'duration',
'alarm', 'alarm_time', 'alarm_volume', 'type', 'volume', 'ringtone', 'duration',
'large_motion_detection_distance', 'large_motion_detection_sensitivity', 'small_motion_detection_distance',
'small_motion_detection_sensitivity', 'static_detection_distance', 'static_detection_sensitivity',
],
convertSet: async (entity, key, value, meta) => {
// A set converter is only called once; therefore we need to loop
Expand Down

0 comments on commit d64badb

Please sign in to comment.