Skip to content

Commit

Permalink
Support system_mode and running_state for Moes BRT-100-TRV (#4832)
Browse files Browse the repository at this point in the history
* BRT-100-TRV: add constant system_mode

* BRT-100-TRV: duplicate valve_state to running_state

* BRT-100-TRV: improve accuracy of temperature limits

* BRT-100-TRV: change temperature step to 1

While the TRV supports half degree temperature setpoints, the Zigbee
protocol only supports integer values, both for setting and reporting.
  • Loading branch information
xworld21 committed Oct 30, 2022
1 parent a1f9265 commit 245b66e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions converters/fromZigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -4039,7 +4039,7 @@ const converters = {
const presetLookup = {0: 'programming', 1: 'manual', 2: 'temporary_manual', 3: 'holiday'};
switch (dp) {
case tuya.dataPoints.moesSsystemMode:
return {preset: presetLookup[value]};
return {preset: presetLookup[value], system_mode: 'heat'};
case tuya.dataPoints.moesSheatingSetpoint:
return {current_heating_setpoint: value};
case tuya.dataPoints.moesSlocalTemp:
Expand All @@ -4049,7 +4049,7 @@ const converters = {
case tuya.dataPoints.moesSboostHeatingCountdown:
return {boost_heating_countdown: value};
case tuya.dataPoints.moesSreset:
return {valve_state: value ? 'CLOSED' : 'OPEN'};
return {running_state: value ? 'idle' : 'heat', valve_state: value ? 'CLOSED' : 'OPEN'};
case tuya.dataPoints.moesSwindowDetectionFunktion_A2:
return {window_detection: value ? 'ON' : 'OFF'};
case tuya.dataPoints.moesSwindowDetection:
Expand Down
2 changes: 1 addition & 1 deletion converters/toZigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -3420,7 +3420,7 @@ const converters = {
return tuya.sendDataPointRaw(entity, tuya.dataPoints.moesSchedule, payload);
},
},
moesS_thermostat_system_mode: {
moesS_thermostat_preset: {
key: ['preset'],
convertSet: async (entity, key, value, meta) => {
const lookup = {'programming': 0, 'manual': 1, 'temporary_manual': 2, 'holiday': 3};
Expand Down
9 changes: 6 additions & 3 deletions devices/moes.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,14 +299,17 @@ module.exports = [
tz.moesS_thermostat_boost_heating, tz.moesS_thermostat_boostHeatingCountdownTimeSet,
tz.moesS_thermostat_eco_temperature, tz.moesS_thermostat_max_temperature,
tz.moesS_thermostat_min_temperature, tz.moesS_thermostat_moesSecoMode,
tz.moesS_thermostat_system_mode, tz.moesS_thermostat_schedule_programming],
tz.moesS_thermostat_preset, tz.moesS_thermostat_schedule_programming],
exposes: [
e.battery(), e.child_lock(), e.eco_mode(), e.eco_temperature(), e.max_temperature().withValueMax(45), e.min_temperature(),
e.battery(), e.child_lock(), e.eco_mode(),
e.eco_temperature().withValueMin(5), e.max_temperature().withValueMax(45), e.min_temperature().withValueMin(5),
e.valve_state(), e.position(), e.window_detection(),
exposes.binary('window', ea.STATE, 'OPEN', 'CLOSED').withDescription('Window status closed or open '),
exposes.climate()
.withLocalTemperature(ea.STATE).withSetpoint('current_heating_setpoint', 5, 35, 0.5, ea.STATE_SET)
.withLocalTemperature(ea.STATE).withSetpoint('current_heating_setpoint', 5, 35, 1, ea.STATE_SET)
.withLocalTemperatureCalibration(-9, 9, 1, ea.STATE_SET)
.withSystemMode(['heat'], ea.STATE)
.withRunningState(['idle', 'heat'], ea.STATE)
.withPreset(['programming', 'manual', 'temporary_manual', 'holiday'],
'MANUAL MODE ☝ - In this mode, the device executes manual temperature setting. '+
'When the set temperature is lower than the "minimum temperature", the valve is closed (forced closed). ' +
Expand Down

0 comments on commit 245b66e

Please sign in to comment.