From 3a948abc5cc94c0a4be2ede464834431d4cd4148 Mon Sep 17 00:00:00 2001 From: dyx052612 <64580168+dyx052612@users.noreply.github.com> Date: Wed, 16 Aug 2023 02:09:34 +0800 Subject: [PATCH] feat: Support schedule for TuYa TS0601_thermostat_3 and add `_TZE200_p3dbf6qs` and `_TZE200_rxntag7i` (#6067) * Update tuya.ts add ME168 * Update tuya.ts --------- Co-authored-by: Koen Kanters --- src/devices/tuya.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/devices/tuya.ts b/src/devices/tuya.ts index ae4b131860a35..f2bd651612b26 100644 --- a/src/devices/tuya.ts +++ b/src/devices/tuya.ts @@ -2645,13 +2645,18 @@ const definitions: Definition[] = [ '_TZE200_bvu2wnxz', /* model: 'ME167', vendor: 'Avatto' */ '_TZE200_6rdj8dzm', /* model: 'ME167', vendor: 'Avatto' */ '_TZE200_gd4rvykv', // Sanico + '_TZE200_p3dbf6qs', /* model: 'ME168', vendor: 'Avatto' */ + '_TZE200_rxntag7i', /* model: 'ME168', vendor: 'Avatto' */ ]), model: 'TS0601_thermostat_3', vendor: 'TuYa', description: 'Thermostatic radiator valve', fromZigbee: [tuya.fz.datapoints], toZigbee: [tuya.tz.datapoints], - whiteLabel: [{vendor: 'Avatto', model: 'ME167'}], + whiteLabel: [ + tuya.whitelabel('Avatto', 'ME167', 'Thermostatic radiator valve', ['_TZE200_bvu2wnxz', '_TZE200_6rdj8dzm']), + tuya.whitelabel('Avatto', 'ME168', 'Thermostatic radiator valve', ['_TZE200_p3dbf6qs', '_TZE200_rxntag7i']), + ], onEvent: tuya.onEventSetTime, configure: tuya.configureMagicPacket, exposes: [ @@ -2662,6 +2667,7 @@ const definitions: Definition[] = [ .withSystemMode(['auto', 'heat', 'off'], ea.STATE_SET) .withRunningState(['idle', 'heat'], ea.STATE) .withLocalTemperatureCalibration(-3, 3, 1, ea.STATE_SET), + ...tuya.exposes.scheduleAllDays(ea.STATE_SET, 'HH:MM/C HH:MM/C HH:MM/C HH:MM/C HH:MM/C HH:MM/C'), e.binary('scale_protection', ea.STATE_SET, 'ON', 'OFF').withDescription('If the heat sink is not fully opened within ' + 'two weeks or is not used for a long time, the valve will be blocked due to silting up and the heat sink will not be ' + 'able to be used. To ensure normal use of the heat sink, the controller will automatically open the valve fully every ' + @@ -2678,6 +2684,13 @@ const definitions: Definition[] = [ [4, 'current_heating_setpoint', tuya.valueConverter.divideBy10], [5, 'local_temperature', tuya.valueConverter.divideBy10], [7, 'child_lock', tuya.valueConverter.lockUnlock], + [28, 'schedule_monday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(1)], + [29, 'schedule_tuesday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(2)], + [30, 'schedule_wednesday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(3)], + [31, 'schedule_thursday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(4)], + [32, 'schedule_friday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(5)], + [33, 'schedule_saturday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(6)], + [34, 'schedule_sunday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(7)], [35, null, tuya.valueConverter.errorOrBatteryLow], [36, 'frost_protection', tuya.valueConverter.onOff], [39, 'scale_protection', tuya.valueConverter.onOff],