@@ -5518,13 +5518,12 @@ const definitions: DefinitionWithExtend[] = [
5518
5518
},
5519
5519
},
5520
5520
{
5521
- fingerprint: tuya.fingerprint('TS0601', ['_TZE200_ybsqljjg' /* model: 'ME168', vendor: 'AVATTO' */ ]),
5522
- model: 'TS0601_thermostat_5 ',
5523
- vendor: 'Tuya ',
5521
+ fingerprint: tuya.fingerprint('TS0601', ['_TZE200_ybsqljjg']),
5522
+ model: 'AVATTO_ME168 ',
5523
+ vendor: 'AVATTO ',
5524
5524
description: 'Thermostatic radiator valve',
5525
5525
fromZigbee: [tuya.fz.datapoints],
5526
5526
toZigbee: [tuya.tz.datapoints],
5527
- whiteLabel: [tuya.whitelabel('AVATTO', 'AVATTO_ME168', 'Thermostatic radiator valve', ['_TZE200_ybsqljjg'])],
5528
5527
onEvent: tuya.onEventSetTime,
5529
5528
configure: tuya.configureMagicPacket,
5530
5529
ota: true,
@@ -5533,9 +5532,8 @@ const definitions: DefinitionWithExtend[] = [
5533
5532
//! to fix as the exposed format is bitmap
5534
5533
e.numeric('error', ea.STATE).withDescription('If NTC is damaged, "Er" will be on the TRV display.'),
5535
5534
e.child_lock().withCategory('config'),
5536
-
5537
5535
e
5538
- .enum('running_mode', ea.STATE, ['auto', 'manual', 'off', 'eco', 'comfort', 'rapid '])
5536
+ .enum('running_mode', ea.STATE, ['auto', 'manual', 'off', 'eco', 'comfort', 'boost '])
5539
5537
.withDescription('Actual TRV running mode')
5540
5538
.withCategory('diagnostic'),
5541
5539
e
@@ -5546,13 +5544,11 @@ const definitions: DefinitionWithExtend[] = [
5546
5544
.withSetpoint('current_heating_setpoint', 4, 35, 1, ea.STATE_SET)
5547
5545
.withLocalTemperature(ea.STATE)
5548
5546
.withLocalTemperatureCalibration(-30, 30, 1, ea.STATE_SET),
5549
-
5550
5547
e
5551
5548
.binary('window_detection', ea.STATE_SET, 'ON', 'OFF')
5552
5549
.withDescription('Enables/disables window detection on the device')
5553
5550
.withCategory('config'),
5554
5551
e.window_open(),
5555
-
5556
5552
e
5557
5553
.binary('frost_protection', ea.STATE_SET, 'ON', 'OFF')
5558
5554
.withDescription(
@@ -5569,7 +5565,6 @@ const definitions: DefinitionWithExtend[] = [
5569
5565
'again.',
5570
5566
)
5571
5567
.withCategory('config'),
5572
-
5573
5568
e
5574
5569
.numeric('boost_time', ea.STATE_SET)
5575
5570
.withUnit('min')
@@ -5578,45 +5573,65 @@ const definitions: DefinitionWithExtend[] = [
5578
5573
.withValueMax(255)
5579
5574
.withCategory('config'),
5580
5575
e.numeric('boost_timeset_countdown', ea.STATE).withUnit('min').withDescription('Boost time remaining'),
5581
-
5582
5576
e.eco_temperature().withValueMin(5).withValueMax(35).withValueStep(1).withCategory('config'),
5583
5577
e.comfort_temperature().withValueMin(5).withValueMax(35).withValueStep(1).withCategory('config'),
5584
-
5585
5578
...tuya.exposes
5586
5579
.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')
5587
5580
.map((text) => text.withCategory('config')),
5588
5581
],
5589
5582
meta: {
5590
5583
tuyaDatapoints: [
5591
- // mode (RW Enum [0=auto, 1=manual, 2=off, 3=eco, 4=comfort, 5=rapid])
5592
- [2, null, tuya.valueConverter.thermostatME168_systemModeAndPreset(null)],
5593
- [2, 'preset', tuya.valueConverter.thermostatME168_systemModeAndPreset('preset')],
5594
- [2, 'system_mode', tuya.valueConverter.thermostatME168_systemModeAndPreset('system_mode')],
5595
-
5584
+ // mode (RW Enum [0=auto, 1=manual, 2=off, 3=eco, 4=comfort, 5=boost])
5585
+ [
5586
+ 2,
5587
+ null,
5588
+ tuya.valueConverter.thermostatSystemModeAndPresetMap(
5589
+ {
5590
+ 0: {device_mode: 'auto', system_mode: 'auto', preset: 'none'},
5591
+ 1: {device_mode: 'manual', system_mode: 'heat', preset: 'none'},
5592
+ 2: {device_mode: 'off', system_mode: 'off', preset: 'none'},
5593
+ 3: {device_mode: 'eco', system_mode: 'heat', preset: 'eco'},
5594
+ 4: {device_mode: 'comfort', system_mode: 'heat', preset: 'comfort'},
5595
+ 5: {device_mode: 'boost', system_mode: 'heat', preset: 'boost'},
5596
+ },
5597
+ null,
5598
+ ),
5599
+ ],
5600
+ [
5601
+ 2,
5602
+ 'system_mode',
5603
+ tuya.valueConverter.thermostatSystemModeAndPresetMap(null, {
5604
+ auto: new tuya.Enum(0), // auto
5605
+ heat: new tuya.Enum(1), // manual
5606
+ off: new tuya.Enum(2), // off
5607
+ }),
5608
+ ],
5609
+ [
5610
+ 2,
5611
+ 'preset',
5612
+ tuya.valueConverter.thermostatSystemModeAndPresetMap(null, {
5613
+ none: new tuya.Enum(1), // manual
5614
+ eco: new tuya.Enum(3), // eco
5615
+ comfort: new tuya.Enum(4), // comfort
5616
+ boost: new tuya.Enum(5), // boost
5617
+ }),
5618
+ ],
5596
5619
// work_state (RO Enum [0=opened, 1=closed])
5597
5620
[3, 'running_state', tuya.valueConverterBasic.lookup({heat: tuya.enum(0), idle: tuya.enum(1)})],
5598
-
5599
5621
// temp_set (RW Integer, 40-350 C, scale 1 step 10)
5600
5622
[4, 'current_heating_setpoint', tuya.valueConverter.divideBy10],
5601
-
5602
5623
// temp_current (RO Integer, -0-500 C, scale 1 step 10)
5603
5624
[5, 'local_temperature', tuya.valueConverter.divideBy10],
5604
-
5605
5625
// battery_percentage (RO, Integer, 0-100 %, scale 0 step 1)
5606
5626
[6, 'battery', tuya.valueConverter.raw],
5607
-
5608
5627
// child_lock (RW Boolean)
5609
5628
[7, 'child_lock', tuya.valueConverter.lockUnlock],
5610
-
5611
5629
//! load_status (RW, Enum, range [0=closed, 1=opened]) - Non-functional
5612
5630
// [13, 'load_status', tuya.valueConverterBasic.lookup({CLOSE: tuya.enum(0), OPEN: tuya.enum(1)})],
5613
-
5614
5631
// window_check (RW Boolean)
5615
5632
[14, 'window_detection', tuya.valueConverter.onOff],
5616
-
5617
5633
// window_state (RO Enum, range [0=opened, 1=closed])
5618
5634
[15, 'window_open', tuya.valueConverter.trueFalseEnum0],
5619
-
5620
5635
// week_program_13_(1-7) (RW Raw, maxlen 128, special binary-in-base64 format)
5621
5636
[28, 'schedule_monday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(1, 6)],
5622
5637
[29, 'schedule_tuesday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(2, 6)],
@@ -5625,40 +5640,28 @@ const definitions: DefinitionWithExtend[] = [
5625
5640
[32, 'schedule_friday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(5, 6)],
5626
5641
[33, 'schedule_saturday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(6, 6)],
5627
5642
[34, 'schedule_sunday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(7, 6)],
5628
-
5629
5643
//? error (RO Bitmap, maxlen 2, label [0x=low_battery, x0=sensor_fault]?)
5630
5644
[35, null, tuya.valueConverter.errorOrBatteryLow],
5631
-
5632
5645
// frost (RW Boolean)
5633
5646
[36, 'frost_protection', tuya.valueConverter.onOff],
5634
-
5635
5647
//! rapid_switch (RW Boolean) - Non-functional
5636
5648
// [37, 'rapid_switch', tuya.valueConverter.onOff],
5637
-
5638
5649
//! rapid_countdown (RW Integer, 1-12 h, scale 0 step 1) - Non-functional
5639
5650
// [38, 'rapid_countdown', tuya.valueConverter.raw],
5640
-
5641
5651
// scale_switch (RW Boolean)
5642
5652
[39, 'scale_protection', tuya.valueConverter.onOff],
5643
-
5644
5653
// temp_correction (RW Integer, -10-10 C, scale 0 step 1)
5645
5654
[47, 'local_temperature_calibration', tuya.valueConverter.localTempCalibration2],
5646
-
5647
5655
// comfort_temp (RW Integer, 100-250 C, scale 1 step 10)
5648
5656
[101, 'comfort_temperature', tuya.valueConverter.divideBy10],
5649
-
5650
5657
//! switch (RW Boolean) - Non-functional
5651
5658
// [102, 'switch', tuya.valueConverter.onOff],
5652
-
5653
5659
// rapid_time_set (RW Integer, 0-180 min, scale 0 step 1)
5654
5660
[103, 'boost_time', tuya.valueConverter.raw],
5655
-
5656
5661
// heating_countdown (RO Integer, 0-3600 min, scale 0 step 1)
5657
5662
[104, 'boost_timeset_countdown', tuya.valueConverter.countdown],
5658
-
5659
5663
// eco_temp (RW Integer, 100-200 C, scale 1 step 10)
5660
5664
[105, 'eco_temperature', tuya.valueConverter.divideBy10],
5661
-
5662
5665
//! eco (RW Boolean) - Non-functional
5663
5666
// [106, 'eco', tuya.valueConverter.onOff],
5664
5667
],
0 commit comments