@@ -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,153 @@ 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', '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().withCategory('config'),
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
5550
+ .binary('window_detection', ea.STATE_SET, 'ON', 'OFF')
5551
+ .withDescription('Enables/disables window detection on the device')
5552
+ .withCategory('config'),
5553
+ e.window_open(),
5554
+
5555
+ e
5556
+ .binary('frost_protection', ea.STATE_SET, 'ON', 'OFF')
5557
+ .withDescription(
5558
+ 'When the room temperature is lower than 5 °C, the valve opens; when the temperature rises to 8 °C, the valve closes.',
5559
+ )
5560
+ .withCategory('config'),
5561
+ e
5562
+ .binary('scale_protection', ea.STATE_SET, 'ON', 'OFF')
5563
+ .withDescription(
5564
+ 'If the heat sink is not fully opened within ' +
5565
+ '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 ' +
5566
+ 'able to be used. To ensure normal use of the heat sink, the controller will automatically open the valve fully every ' +
5567
+ 'two weeks. It will run for 30 seconds per time with the screen displaying "Ad", then return to its normal working state ' +
5568
+ 'again.',
5569
+ )
5570
+ .withCategory('config'),
5571
+
5572
+ e
5573
+ .numeric('boost_time', ea.STATE_SET)
5574
+ .withUnit('min')
5575
+ .withDescription('Boost running time')
5576
+ .withValueMin(0)
5577
+ .withValueMax(255)
5578
+ .withCategory('config'),
5579
+ e.numeric('boost_timeset_countdown', ea.STATE).withUnit('min').withDescription('Boost time remaining'),
5580
+
5581
+ e.eco_temperature().withValueMin(5).withValueMax(35).withValueStep(1).withCategory('config'),
5582
+ e.comfort_temperature().withValueMin(5).withValueMax(35).withValueStep(1).withCategory('config'),
5583
+
5584
+ ...tuya.exposes
5585
+ .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')
5586
+ .map((text) => text.withCategory('config')),
5587
+ ],
5588
+ meta: {
5589
+ tuyaDatapoints: [
5590
+ // mode (RW Enum [0=auto, 1=manual, 2=off, 3=eco, 4=comfort, 5=rapid])
5591
+ [2, null, tuya.valueConverter.thermostatME168_systemModeAndPreset(null)],
5592
+ [2, 'preset', tuya.valueConverter.thermostatME168_systemModeAndPreset('preset')],
5593
+ [2, 'system_mode', tuya.valueConverter.thermostatME168_systemModeAndPreset('system_mode')],
5594
+
5595
+ // work_state (RO Enum [0=opened, 1=closed])
5596
+ [3, 'running_state', tuya.valueConverterBasic.lookup({heat: tuya.enum(0), idle: tuya.enum(1)})],
5597
+
5598
+ // temp_set (RW Integer, 40-350 C, scale 1 step 10)
5599
+ [4, 'current_heating_setpoint', tuya.valueConverter.divideBy10],
5600
+
5601
+ // temp_current (RO Integer, -0-500 C, scale 1 step 10)
5602
+ [5, 'local_temperature', tuya.valueConverter.divideBy10],
5603
+
5604
+ // battery_percentage (RO, Integer, 0-100 %, scale 0 step 1)
5605
+ [6, 'battery', tuya.valueConverter.raw],
5606
+
5607
+ // child_lock (RW Boolean)
5608
+ [7, 'child_lock', tuya.valueConverter.lockUnlock],
5609
+
5610
+ //! load_status (RW, Enum, range [0=closed, 1=opened]) - Non-functional
5611
+ // [13, 'load_status', tuya.valueConverterBasic.lookup({CLOSE: tuya.enum(0), OPEN: tuya.enum(1)})],
5612
+
5613
+ // window_check (RW Boolean)
5614
+ [14, 'window_detection', tuya.valueConverter.onOff],
5615
+
5616
+ // window_state (RO Enum, range [0=opened, 1=closed])
5617
+ [15, 'window_open', tuya.valueConverter.trueFalseEnum0],
5618
+
5619
+ // week_program_13_(1-7) (RW Raw, maxlen 128, special binary-in-base64 format)
5620
+ [28, 'schedule_monday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(1, 6)],
5621
+ [29, 'schedule_tuesday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(2, 6)],
5622
+ [30, 'schedule_wednesday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(3, 6)],
5623
+ [31, 'schedule_thursday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(4, 6)],
5624
+ [32, 'schedule_friday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(5, 6)],
5625
+ [33, 'schedule_saturday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(6, 6)],
5626
+ [34, 'schedule_sunday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(7, 6)],
5627
+
5628
+ //? error (RO Bitmap, maxlen 2, label [0x=low_battery, x0=sensor_fault]?)
5629
+ [35, null, tuya.valueConverter.errorOrBatteryLow],
5630
+
5631
+ // frost (RW Boolean)
5632
+ [36, 'frost_protection', tuya.valueConverter.onOff],
5633
+
5634
+ //! rapid_switch (RW Boolean) - Non-functional
5635
+ // [37, 'rapid_switch', tuya.valueConverter.onOff],
5636
+
5637
+ //! rapid_countdown (RW Integer, 1-12 h, scale 0 step 1) - Non-functional
5638
+ // [38, 'rapid_countdown', tuya.valueConverter.raw],
5639
+
5640
+ // scale_switch (RW Boolean)
5641
+ [39, 'scale_protection', tuya.valueConverter.onOff],
5642
+
5643
+ // temp_correction (RW Integer, -10-10 C, scale 0 step 1)
5644
+ [47, 'local_temperature_calibration', tuya.valueConverter.localTempCalibration2],
5645
+
5646
+ // comfort_temp (RW Integer, 100-250 C, scale 1 step 10)
5647
+ [101, 'comfort_temperature', tuya.valueConverter.divideBy10],
5648
+
5649
+ //! switch (RW Boolean) - Non-functional
5650
+ // [102, 'switch', tuya.valueConverter.onOff],
5651
+
5652
+ // rapid_time_set (RW Integer, 0-180 min, scale 0 step 1)
5653
+ [103, 'boost_time', tuya.valueConverter.raw],
5654
+
5655
+ // heating_countdown (RO Integer, 0-3600 min, scale 0 step 1)
5656
+ [104, 'boost_timeset_countdown', tuya.valueConverter.countdown],
5657
+
5658
+ // eco_temp (RW Integer, 100-200 C, scale 1 step 10)
5659
+ [105, 'eco_temperature', tuya.valueConverter.divideBy10],
5660
+
5661
+ //! eco (RW Boolean) - Non-functional
5662
+ // [106, 'eco', tuya.valueConverter.onOff],
5663
+ ],
5664
+ },
5665
+ },
5520
5666
{
5521
5667
fingerprint: [
5522
5668
{modelID: 'TS011F', applicationVersion: 160, priority: -1},
0 commit comments