Skip to content

Commit

Permalink
feat(add): TS0601_temperature_humidity_sensor_3 (#7505)
Browse files Browse the repository at this point in the history
* Move _TZE200_s1xgth2u to its own block

* remove temperature unit since it was not correct yet

* add temperature unit back, now switches display between C or F

* Update tuya.ts

---------

Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
  • Loading branch information
vivalton and Koenkk committed May 10, 2024
1 parent bb2bdee commit 83f8551
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion src/devices/tuya.ts
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,6 @@ const definitions: Definition[] = [
{modelID: 'TS0601', manufacturerName: '_TZE200_bjawzodf'},
{modelID: 'TS0601', manufacturerName: '_TZE200_qyflbnbj'},
{modelID: 'TS0601', manufacturerName: '_TZE200_vs0skpuc'},
{modelID: 'TS0601', manufacturerName: '_TZE200_s1xgth2u'},
{modelID: 'TS0601', manufacturerName: '_TZE200_44af8vyi'},
{modelID: 'TS0601', manufacturerName: '_TZE200_zl1kmjqx'}],
model: 'TS0601_temperature_humidity_sensor_1',
Expand Down Expand Up @@ -1061,6 +1060,30 @@ const definitions: Definition[] = [
tuya.whitelabel('TuYa', 'ZTH08-E', 'Temperature and humidity sensor', ['_TZE200_cirvgep4', '_TZE204_cirvgep4']),
],
},
{
fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_s1xgth2u'}],
model: 'TS0601_temperature_humidity_sensor_3',
vendor: 'TuYa',
description: 'Temperature & humidity sensor',
fromZigbee: [tuya.fz.datapoints],
configure: async (device, coordinatorEndpoint) => {
await tuya.configureMagicPacket(device, coordinatorEndpoint);
// Required to get the device to start reporting (-- Maybe needed? Copied this from another humidity sensor configuration)
await device.getEndpoint(1).command('manuSpecificTuya', 'dataQuery', {});
},
toZigbee: [tuya.tz.datapoints],
onEvent: tuya.onEventSetLocalTime,
exposes: [e.temperature(), e.humidity(), e.battery(), tuya.exposes.temperatureUnit()],
meta: {
tuyaDatapoints: [
[1, 'temperature', tuya.valueConverter.divideBy10],
[2, 'humidity', tuya.valueConverter.raw],
[4, 'battery', tuya.valueConverter.raw], // maybe?
[9, 'temperature_unit', tuya.valueConverter.temperatureUnitEnum],
[19, 'temperature_sensitivity', tuya.valueConverter.raw], // maybe? commented this out for now
],
},
},
{
fingerprint: tuya.fingerprint('TS0601', ['_TZE200_vvmbj46n']),
model: 'ZTH05Z',
Expand Down

0 comments on commit 83f8551

Please sign in to comment.