Skip to content

Commit

Permalink
fix: Improvements to Tuya ZY-M100-24G ('_TZE204_ijxvkhd0') (#8229)
Browse files Browse the repository at this point in the history
* Improvements to Tuya ZY-M100-24G ('_TZE204_ijxvkhd0')

* Fix prettier complaints
  • Loading branch information
magicus authored Oct 31, 2024
1 parent c4296e0 commit 949b083
Showing 1 changed file with 27 additions and 14 deletions.
41 changes: 27 additions & 14 deletions src/devices/tuya.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10399,36 +10399,49 @@ const definitions: DefinitionWithExtend[] = [
toZigbee: [tuya.tz.datapoints],
configure: tuya.configureMagicPacket,
exposes: [
e.enum('state', ea.STATE, ['none', 'presence', 'move']).withDescription('Presence state sensor'),
e.presence().withDescription('Occupancy'),
e.numeric('distance', ea.STATE).withDescription('Target distance'),
e.illuminance_lux().withDescription('Illuminance sensor'),
e.numeric('move_sensitivity', ea.STATE_SET).withValueMin(1).withValueMax(10).withValueStep(1).withDescription('Motion sensitivity'),
e.numeric('presence_sensitivity', ea.STATE_SET).withValueMin(1).withValueMax(10).withValueStep(1).withDescription('Presence sensitivity'),
e.enum('state', ea.STATE, ['none', 'presence', 'move']).withDescription('Presence state'),
e.occupancy(),
e.numeric('distance', ea.STATE).withUnit('m').withDescription('Target distance'),
e.illuminance_lux(),
e
.numeric('radar_range', ea.STATE_SET)
.numeric('motion_sensitivity', ea.STATE_SET)
.withValueMin(1)
.withValueMax(10)
.withValueStep(1)
.withCategory('config')
.withDescription('Motion sensitivity'),
e
.numeric('occupancy_sensitivity', ea.STATE_SET)
.withValueMin(1)
.withValueMax(10)
.withValueStep(1)
.withCategory('config')
.withDescription('Occupancy sensitivity'),
e
.numeric('max_range', ea.STATE_SET)
.withValueMin(1.5)
.withValueMax(5.5)
.withValueStep(1)
.withUnit('m')
.withCategory('config')
.withDescription('Maximum range'),
e
.numeric('presence_timeout', ea.STATE_SET)
.numeric('occupancy_timeout', ea.STATE_SET)
.withValueMin(1)
.withValueMax(1500)
.withValueStep(1)
.withUnit('s')
.withDescription('Fade time'),
.withDescription('Occupancy timeout'),
],
meta: {
multiEndpoint: true,
tuyaDatapoints: [
[112, 'presence', tuya.valueConverter.trueFalse1],
[106, 'move_sensitivity', tuya.valueConverter.divideBy10FromOnly],
[111, 'presence_sensitivity', tuya.valueConverter.divideBy10FromOnly],
[107, 'radar_range', tuya.valueConverter.divideBy100],
[112, 'occupancy', tuya.valueConverter.trueFalse1],
[106, 'motion_sensitivity', tuya.valueConverter.raw],
[111, 'occupancy_sensitivity', tuya.valueConverter.raw],
[107, 'max_range', tuya.valueConverter.divideBy100],
[109, 'distance', tuya.valueConverter.divideBy100],
[110, 'presence_timeout', tuya.valueConverter.raw],
[110, 'occupancy_timeout', tuya.valueConverter.raw],
[104, 'illuminance_lux', tuya.valueConverter.raw],
[102, 'illuminance_treshold_max', tuya.valueConverter.raw],
[103, 'illuminance_treshold_min', tuya.valueConverter.raw],
Expand Down

0 comments on commit 949b083

Please sign in to comment.