@@ -4708,7 +4708,6 @@ const definitions: DefinitionWithExtend[] = [
4708
4708
'_TZE200_jkfbph7l' /* model: 'ME167', vendor: 'AVATTO' */,
4709
4709
'_TZE200_p3dbf6qs' /* model: 'ME168', vendor: 'AVATTO' */,
4710
4710
'_TZE200_rxntag7i' /* model: 'ME168', vendor: 'AVATTO' */,
4711
- '_TZE200_ybsqljjg' /* model: 'ME168', vendor: 'AVATTO' */,
4712
4711
'_TZE200_yqgbrdyo',
4713
4712
'_TZE284_p3dbf6qs',
4714
4713
'_TZE200_rxq4iti9',
@@ -4730,7 +4729,7 @@ const definitions: DefinitionWithExtend[] = [
4730
4729
'_TZE200_9xfjixap',
4731
4730
'_TZE200_jkfbph7l',
4732
4731
]),
4733
- tuya.whitelabel('AVATTO', 'ME168', 'Thermostatic radiator valve', ['_TZE200_rxntag7i', '_TZE200_ybsqljjg' ]),
4732
+ tuya.whitelabel('AVATTO', 'ME168', 'Thermostatic radiator valve', ['_TZE200_rxntag7i']),
4734
4733
tuya.whitelabel('AVATTO', 'TRV06_1', 'Thermostatic radiator valve', ['_TZE200_hvaxb2tc', '_TZE284_o3x45p96']),
4735
4734
tuya.whitelabel('EARU', 'TRV06', 'Smart thermostat module', ['_TZE200_yqgbrdyo', '_TZE200_rxq4iti9']),
4736
4735
tuya.whitelabel('AVATTO', 'AVATTO_TRV06', 'Thermostatic radiator valve', ['_TZE284_c6wv4xyo', '_TZE204_o3x45p96']),
@@ -5517,6 +5516,140 @@ const definitions: DefinitionWithExtend[] = [
5517
5516
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
5518
5517
},
5519
5518
},
5519
+ {
5520
+ fingerprint: tuya.fingerprint('TS0601', ['_TZE200_ybsqljjg' /* model: 'ME168', vendor: 'AVATTO' */]),
5521
+ model: 'TS0601_thermostat_5',
5522
+ vendor: 'Tuya',
5523
+ description: 'Thermostatic radiator valve',
5524
+ fromZigbee: [tuya.fz.datapoints],
5525
+ toZigbee: [tuya.tz.datapoints],
5526
+ whiteLabel: [tuya.whitelabel('AVATTO', 'ME168', 'Thermostatic radiator valve', ['_TZE200_ybsqljjg'])],
5527
+ onEvent: tuya.onEventSetTime,
5528
+ configure: tuya.configureMagicPacket,
5529
+ ota: true,
5530
+ exposes: [
5531
+ e.battery(),
5532
+ //! to fix as the exposed format is bitmap
5533
+ e.numeric('error', ea.STATE).withDescription('If NTC is damaged, "Er" will be on the TRV display.'),
5534
+ e.child_lock(),
5535
+
5536
+ e
5537
+ .enum('running_mode', ea.STATE, ['auto', 'manual', 'off', 'eco', 'comfort', 'rapid'])
5538
+ .withDescription('Actual TRV running mode')
5539
+ .withCategory('diagnostic'),
5540
+ e
5541
+ .climate()
5542
+ .withSystemMode(['off', 'heat', 'auto'], ea.STATE_SET, 'Basic modes')
5543
+ .withPreset(['eco', 'comfort', 'boost'], 'Additional heat modes')
5544
+ .withRunningState(['idle', 'heat'], ea.STATE)
5545
+ .withSetpoint('current_heating_setpoint', 4, 35, 1, ea.STATE_SET)
5546
+ .withLocalTemperature(ea.STATE)
5547
+ .withLocalTemperatureCalibration(-30, 30, 1, ea.STATE_SET),
5548
+
5549
+ e.window_detection(),
5550
+ e.window_open(),
5551
+
5552
+ e
5553
+ .binary('frost_protection', ea.STATE_SET, 'ON', 'OFF')
5554
+ .withDescription(
5555
+ 'When the room temperature is lower than 5 °C, the valve opens; when the temperature rises to 8 °C, the valve closes.',
5556
+ ),
5557
+ e
5558
+ .binary('scale_protection', ea.STATE_SET, 'ON', 'OFF')
5559
+ .withDescription(
5560
+ 'If the heat sink is not fully opened within ' +
5561
+ '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 ' +
5562
+ 'able to be used. To ensure normal use of the heat sink, the controller will automatically open the valve fully every ' +
5563
+ 'two weeks. It will run for 30 seconds per time with the screen displaying "Ad", then return to its normal working state ' +
5564
+ 'again.',
5565
+ ),
5566
+
5567
+ e.numeric('boost_time', ea.STATE_SET).withUnit('min').withDescription('Boost running time').withValueMin(0).withValueMax(255),
5568
+ e.numeric('boost_timeset_countdown', ea.STATE).withUnit('min').withDescription('Boost time remaining'),
5569
+
5570
+ e.eco_temperature().withValueMin(5).withValueMax(35).withValueStep(1),
5571
+ e.comfort_temperature().withValueMin(5).withValueMax(35).withValueStep(1),
5572
+
5573
+ ...tuya.exposes.scheduleAllDays(ea.STATE_SET, '06:00/21.0 08:00/16.0 12:00/21.0 14:00/16.0 18:00/21.0 22:00/16.0'),
5574
+ ],
5575
+ meta: {
5576
+ tuyaDatapoints: [
5577
+ // mode (RW Enum [0=auto, 1=manual, 2=off, 3=eco, 4=comfort, 5=rapid])
5578
+ [2, null, tuya.valueConverter.thermostatME168_systemModeAndPreset(null)],
5579
+ [2, 'preset', tuya.valueConverter.thermostatME168_systemModeAndPreset('preset')],
5580
+ [2, 'system_mode', tuya.valueConverter.thermostatME168_systemModeAndPreset('system_mode')],
5581
+
5582
+ // work_state (RO Enum [0=opened, 1=closed])
5583
+ [3, 'running_state', tuya.valueConverterBasic.lookup({heat: tuya.enum(0), idle: tuya.enum(1)})],
5584
+
5585
+ // temp_set (RW Integer, 40-350 C, scale 1 step 10)
5586
+ [4, 'current_heating_setpoint', tuya.valueConverter.divideBy10],
5587
+
5588
+ // temp_current (RO Integer, -0-500 C, scale 1 step 10)
5589
+ [5, 'local_temperature', tuya.valueConverter.divideBy10],
5590
+
5591
+ // battery_percentage (RO, Integer, 0-100 %, scale 0 step 1)
5592
+ [6, 'battery', tuya.valueConverter.raw],
5593
+
5594
+ // child_lock (RW Boolean)
5595
+ [7, 'child_lock', tuya.valueConverter.lockUnlock],
5596
+
5597
+ //! load_status (RW, Enum, range [0=closed, 1=opened]) - Non-functional
5598
+ // [13, 'load_status', tuya.valueConverterBasic.lookup({CLOSE: tuya.enum(0), OPEN: tuya.enum(1)})],
5599
+
5600
+ // window_check (RW Boolean)
5601
+ [14, 'window_detection', tuya.valueConverter.onOff],
5602
+
5603
+ // window_state (RO Enum, range [0=opened, 1=closed])
5604
+ [15, 'window_open', tuya.valueConverter.trueFalseEnum0],
5605
+
5606
+ // week_program_13_(1-7) (RW Raw, maxlen 128, special binary-in-base64 format)
5607
+ [28, 'schedule_monday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(1, 6)],
5608
+ [29, 'schedule_tuesday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(2, 6)],
5609
+ [30, 'schedule_wednesday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(3, 6)],
5610
+ [31, 'schedule_thursday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(4, 6)],
5611
+ [32, 'schedule_friday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(5, 6)],
5612
+ [33, 'schedule_saturday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(6, 6)],
5613
+ [34, 'schedule_sunday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(7, 6)],
5614
+
5615
+ //? error (RO Bitmap, maxlen 2, label [0x=low_battery, x0=sensor_fault]?)
5616
+ [35, null, tuya.valueConverter.errorOrBatteryLow],
5617
+
5618
+ // frost (RW Boolean)
5619
+ [36, 'frost_protection', tuya.valueConverter.onOff],
5620
+
5621
+ //! rapid_switch (RW Boolean) - Non-functional
5622
+ // [37, 'rapid_switch', tuya.valueConverter.onOff],
5623
+
5624
+ //! rapid_countdown (RW Integer, 1-12 h, scale 0 step 1) - Non-functional
5625
+ // [38, 'rapid_countdown', tuya.valueConverter.raw],
5626
+
5627
+ // scale_switch (RW Boolean)
5628
+ [39, 'scale_protection', tuya.valueConverter.onOff],
5629
+
5630
+ // temp_correction (RW Integer, -10-10 C, scale 0 step 1)
5631
+ [47, 'local_temperature_calibration', tuya.valueConverter.localTempCalibration2],
5632
+
5633
+ // comfort_temp (RW Integer, 100-250 C, scale 1 step 10)
5634
+ [101, 'comfort_temperature', tuya.valueConverter.divideBy10],
5635
+
5636
+ //! switch (RW Boolean) - Non-functional
5637
+ // [102, 'switch', tuya.valueConverter.onOff],
5638
+
5639
+ // rapid_time_set (RW Integer, 0-180 min, scale 0 step 1)
5640
+ [103, 'boost_time', tuya.valueConverter.raw],
5641
+
5642
+ // heating_countdown (RO Integer, 0-3600 min, scale 0 step 1)
5643
+ [104, 'boost_timeset_countdown', tuya.valueConverter.countdown],
5644
+
5645
+ // eco_temp (RW Integer, 100-200 C, scale 1 step 10)
5646
+ [105, 'eco_temperature', tuya.valueConverter.divideBy10],
5647
+
5648
+ //! eco (RW Boolean) - Non-functional
5649
+ // [106, 'eco', tuya.valueConverter.onOff],
5650
+ ],
5651
+ },
5652
+ },
5520
5653
{
5521
5654
fingerprint: [
5522
5655
{modelID: 'TS011F', applicationVersion: 160, priority: -1},
0 commit comments