From 6f32ce3579a11aba42274f2c8a2e81ae30349264 Mon Sep 17 00:00:00 2001 From: XS400DOHC <63352197+xs400dohc@users.noreply.github.com> Date: Thu, 14 Dec 2023 14:23:15 +0100 Subject: [PATCH 1/7] Update tuya.ts for TH05Z aka _TZE200_vvmbj46n New Device TH05Z, another temperature/humidity sensor with display and clock. Similar to JM-TRH-ZGB-V1 / SZ-T04 / TH01Z. Exposes same datapoints like SZ-T04 by NOUS. Still need to be updated in the list of supported devices of zigbee2mqtt.io. --- src/devices/tuya.ts | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/devices/tuya.ts b/src/devices/tuya.ts index 1fa8df8c1a9a4..9899f620115b0 100644 --- a/src/devices/tuya.ts +++ b/src/devices/tuya.ts @@ -4929,7 +4929,37 @@ const definitions: Definition[] = [ .withDescription('Alarm humidity min'), ], }, - + { + fingerprint: [{ modelID: 'TS0601', manufacturerName: '_TZE200_vvmbj46n' }], + model: 'TH05Z', + vendor: 'TuYa', + description: 'Zigbee Temperature & Humidity Sensor with clock', + fromZigbee: [legacy.fromZigbee.nous_lcd_temperature_humidity_sensor, fz.ignore_tuya_set_time], + toZigbee: [legacy.toZigbee.nous_lcd_temperature_humidity_sensor], + onEvent: tuya.onEventSetLocalTime, + configure: async (device, coordinatorEndpoint, logger) => { + const endpoint = device.getEndpoint(1); + await reporting.bind(endpoint, coordinatorEndpoint, ['genBasic']); + }, + exposes: [ + e.temperature(), e.humidity(), e.battery(), + e.numeric('temperature_report_interval', ea.STATE_SET).withUnit('min').withValueMin(5).withValueMax(60).withValueStep(5) + .withDescription('Temperature Report interval'), + e.enum('temperature_unit_convert', ea.STATE_SET, ['celsius', 'fahrenheit']).withDescription('Current display unit'), + e.enum('temperature_alarm', ea.STATE, ['canceled', 'lower_alarm', 'upper_alarm']) + .withDescription('Temperature alarm status'), + e.numeric('max_temperature', ea.STATE_SET).withUnit('°C').withValueMin(-20).withValueMax(60) + .withDescription('Alarm temperature max'), + e.numeric('min_temperature', ea.STATE_SET).withUnit('°C').withValueMin(-20).withValueMax(60) + .withDescription('Alarm temperature min'), + e.enum('humidity_alarm', ea.STATE, ['canceled', 'lower_alarm', 'upper_alarm']) + .withDescription('Humidity alarm status'), + e.numeric('max_humidity', ea.STATE_SET).withUnit('%').withValueMin(0).withValueMax(100) + .withDescription('Alarm humidity max'), + e.numeric('min_humidity', ea.STATE_SET).withUnit('%').withValueMin(0).withValueMax(100) + .withDescription('Alarm humidity min'), + ], + } { fingerprint: [{modelID: 'TS004F', manufacturerName: '_TZ3000_kjfzuycl'}, {modelID: 'TS004F', manufacturerName: '_TZ3000_ja5osu5g'}], From 3e2bff3cd25e2d59ab7b565a48c8520869d095b8 Mon Sep 17 00:00:00 2001 From: XS400DOHC <63352197+xs400dohc@users.noreply.github.com> Date: Thu, 14 Dec 2023 14:27:36 +0100 Subject: [PATCH 2/7] Update tuya.ts changed errors marked by test --- src/devices/tuya.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/tuya.ts b/src/devices/tuya.ts index 9899f620115b0..516b21fc40a82 100644 --- a/src/devices/tuya.ts +++ b/src/devices/tuya.ts @@ -4959,7 +4959,7 @@ const definitions: Definition[] = [ e.numeric('min_humidity', ea.STATE_SET).withUnit('%').withValueMin(0).withValueMax(100) .withDescription('Alarm humidity min'), ], - } + }, { fingerprint: [{modelID: 'TS004F', manufacturerName: '_TZ3000_kjfzuycl'}, {modelID: 'TS004F', manufacturerName: '_TZ3000_ja5osu5g'}], From a291fbe09867b55779e1242387243175bf743d8f Mon Sep 17 00:00:00 2001 From: XS400DOHC <63352197+xs400dohc@users.noreply.github.com> Date: Thu, 14 Dec 2023 14:30:43 +0100 Subject: [PATCH 3/7] Update tuya.ts --- src/devices/tuya.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/devices/tuya.ts b/src/devices/tuya.ts index 516b21fc40a82..86a37eb42ab48 100644 --- a/src/devices/tuya.ts +++ b/src/devices/tuya.ts @@ -4929,8 +4929,7 @@ const definitions: Definition[] = [ .withDescription('Alarm humidity min'), ], }, - { - fingerprint: [{ modelID: 'TS0601', manufacturerName: '_TZE200_vvmbj46n' }], + {fingerprint: [{ modelID: 'TS0601', manufacturerName: '_TZE200_vvmbj46n' }], model: 'TH05Z', vendor: 'TuYa', description: 'Zigbee Temperature & Humidity Sensor with clock', @@ -4958,8 +4957,7 @@ const definitions: Definition[] = [ .withDescription('Alarm humidity max'), e.numeric('min_humidity', ea.STATE_SET).withUnit('%').withValueMin(0).withValueMax(100) .withDescription('Alarm humidity min'), - ], - }, + ],}, { fingerprint: [{modelID: 'TS004F', manufacturerName: '_TZ3000_kjfzuycl'}, {modelID: 'TS004F', manufacturerName: '_TZ3000_ja5osu5g'}], From d30beab239d3f5882ecf50b1acd79bfa9de00484 Mon Sep 17 00:00:00 2001 From: XS400DOHC <63352197+xs400dohc@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:13:11 +0100 Subject: [PATCH 4/7] Update tuya.ts --- src/devices/tuya.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/devices/tuya.ts b/src/devices/tuya.ts index 86a37eb42ab48..19a8e724690b0 100644 --- a/src/devices/tuya.ts +++ b/src/devices/tuya.ts @@ -4929,7 +4929,7 @@ const definitions: Definition[] = [ .withDescription('Alarm humidity min'), ], }, - {fingerprint: [{ modelID: 'TS0601', manufacturerName: '_TZE200_vvmbj46n' }], + {fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_vvmbj46n'}], model: 'TH05Z', vendor: 'TuYa', description: 'Zigbee Temperature & Humidity Sensor with clock', @@ -4956,8 +4956,7 @@ const definitions: Definition[] = [ e.numeric('max_humidity', ea.STATE_SET).withUnit('%').withValueMin(0).withValueMax(100) .withDescription('Alarm humidity max'), e.numeric('min_humidity', ea.STATE_SET).withUnit('%').withValueMin(0).withValueMax(100) - .withDescription('Alarm humidity min'), - ],}, + .withDescription('Alarm humidity min'),],}, { fingerprint: [{modelID: 'TS004F', manufacturerName: '_TZ3000_kjfzuycl'}, {modelID: 'TS004F', manufacturerName: '_TZ3000_ja5osu5g'}], From c7e8c22aa9d4348a89f4cf1fe7aa7b7615afd61b Mon Sep 17 00:00:00 2001 From: XS400DOHC <63352197+xs400dohc@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:26:28 +0100 Subject: [PATCH 5/7] Update tuya.ts --- src/devices/tuya.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/devices/tuya.ts b/src/devices/tuya.ts index 19a8e724690b0..8c756e0ff247a 100644 --- a/src/devices/tuya.ts +++ b/src/devices/tuya.ts @@ -4956,7 +4956,9 @@ const definitions: Definition[] = [ e.numeric('max_humidity', ea.STATE_SET).withUnit('%').withValueMin(0).withValueMax(100) .withDescription('Alarm humidity max'), e.numeric('min_humidity', ea.STATE_SET).withUnit('%').withValueMin(0).withValueMax(100) - .withDescription('Alarm humidity min'),],}, + .withDescription('Alarm humidity min'), + ], + }, { fingerprint: [{modelID: 'TS004F', manufacturerName: '_TZ3000_kjfzuycl'}, {modelID: 'TS004F', manufacturerName: '_TZ3000_ja5osu5g'}], From acd38c07deb5478609b8671557f7e03313d0db9b Mon Sep 17 00:00:00 2001 From: XS400DOHC <63352197+xs400dohc@users.noreply.github.com> Date: Fri, 15 Dec 2023 21:28:27 +0100 Subject: [PATCH 6/7] TH05Z merged with JM-TRH-ZGN-V1 using tuya.whitelabel --- src/devices/tuya.ts | 31 ++----------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/src/devices/tuya.ts b/src/devices/tuya.ts index 8c756e0ff247a..3f7ca4957dc5c 100644 --- a/src/devices/tuya.ts +++ b/src/devices/tuya.ts @@ -4928,35 +4928,8 @@ const definitions: Definition[] = [ e.numeric('min_humidity', ea.STATE_SET).withUnit('%').withValueMin(0).withValueMax(100) .withDescription('Alarm humidity min'), ], - }, - {fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_vvmbj46n'}], - model: 'TH05Z', - vendor: 'TuYa', - description: 'Zigbee Temperature & Humidity Sensor with clock', - fromZigbee: [legacy.fromZigbee.nous_lcd_temperature_humidity_sensor, fz.ignore_tuya_set_time], - toZigbee: [legacy.toZigbee.nous_lcd_temperature_humidity_sensor], - onEvent: tuya.onEventSetLocalTime, - configure: async (device, coordinatorEndpoint, logger) => { - const endpoint = device.getEndpoint(1); - await reporting.bind(endpoint, coordinatorEndpoint, ['genBasic']); - }, - exposes: [ - e.temperature(), e.humidity(), e.battery(), - e.numeric('temperature_report_interval', ea.STATE_SET).withUnit('min').withValueMin(5).withValueMax(60).withValueStep(5) - .withDescription('Temperature Report interval'), - e.enum('temperature_unit_convert', ea.STATE_SET, ['celsius', 'fahrenheit']).withDescription('Current display unit'), - e.enum('temperature_alarm', ea.STATE, ['canceled', 'lower_alarm', 'upper_alarm']) - .withDescription('Temperature alarm status'), - e.numeric('max_temperature', ea.STATE_SET).withUnit('°C').withValueMin(-20).withValueMax(60) - .withDescription('Alarm temperature max'), - e.numeric('min_temperature', ea.STATE_SET).withUnit('°C').withValueMin(-20).withValueMax(60) - .withDescription('Alarm temperature min'), - e.enum('humidity_alarm', ea.STATE, ['canceled', 'lower_alarm', 'upper_alarm']) - .withDescription('Humidity alarm status'), - e.numeric('max_humidity', ea.STATE_SET).withUnit('%').withValueMin(0).withValueMax(100) - .withDescription('Alarm humidity max'), - e.numeric('min_humidity', ea.STATE_SET).withUnit('%').withValueMin(0).withValueMax(100) - .withDescription('Alarm humidity min'), + whiteLabel: [ + tuya.whitelabel('TuYa', 'TH05Z', 'Zigbee Temperature & Humidity Sensor with clock', ['_TZE200_vvmbj46n']), ], }, { From 63a2588febc199d55dea9e45c67c6980cacfa4e0 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 16 Dec 2023 09:07:48 +0100 Subject: [PATCH 7/7] Update tuya.ts --- src/devices/tuya.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/devices/tuya.ts b/src/devices/tuya.ts index 3f7ca4957dc5c..913fa4e6f2250 100644 --- a/src/devices/tuya.ts +++ b/src/devices/tuya.ts @@ -4899,7 +4899,7 @@ const definitions: Definition[] = [ }, }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_whkgqxse'}], + fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_whkgqxse'}, {modelID: 'TS0601', manufacturerName: '_TZE200_vvmbj46n'}], model: 'JM-TRH-ZGB-V1', vendor: 'TuYa', description: 'Temperature & humidity sensor with clock', @@ -4929,7 +4929,7 @@ const definitions: Definition[] = [ .withDescription('Alarm humidity min'), ], whiteLabel: [ - tuya.whitelabel('TuYa', 'TH05Z', 'Zigbee Temperature & Humidity Sensor with clock', ['_TZE200_vvmbj46n']), + tuya.whitelabel('TuYa', 'TH05Z', 'Temperature & humidity sensor with clock', ['_TZE200_vvmbj46n']), ], }, {