RC300/BC400 mode setting

This commit is contained in:
MichaelDvP
2023-11-13 13:54:13 +01:00
parent 8e844550bf
commit 1f8a477939
3 changed files with 16 additions and 9 deletions

View File

@@ -1021,8 +1021,14 @@ void Thermostat::process_RC300Set(std::shared_ptr<const Telegram> telegram) {
// has_update(telegram, hc->selTemp, 8, 1); // single byte conversion, value is * 2 - auto?
// has_update(telegram, hc->selTemp, 10, 1); // single byte conversion, value is * 2 - manual
// check why mode is both in the Monitor and Set for the RC300. It'll be read twice!
// has_update(telegram, hc->mode, 0); // Auto = xFF, Manual = x00 eg. 10 00 FF 08 01 B9 FF
telegram->read_value(hc->mode_new, 21); // 0-off, 1-manual, 2-auto
if (Helpers::hasValue(hc->mode_new)) {
has_update(hc->mode, hc->mode_new);
} else {
uint8_t mode = EMS_VALUE_UINT_NOTSET;
telegram->read_value(mode, 0);
has_update(hc->mode, mode == 0xFF ? 2 : 1);
}
has_update(telegram, hc->daytemp, 2); // is * 2
has_update(telegram, hc->nighttemp, 4); // is * 2
@@ -2552,12 +2558,11 @@ bool Thermostat::set_mode_n(const uint8_t mode, const uint8_t hc_num) {
break;
case EMSdevice::EMS_DEVICE_FLAG_RC300:
case EMSdevice::EMS_DEVICE_FLAG_RC100:
if (Helpers::hasValue(hc->mode_new)) {
offset = EMS_OFFSET_RCPLUSSet_mode;
validate_typeid = monitor_typeids[hc_p];
if (mode == HeatingCircuit::Mode::AUTO) {
set_mode_value = 0xFF; // special value for auto
} else {
set_mode_value = 0; // everything else, like manual/day etc..
offset = 0;
set_mode_value = set_mode_value == 2 ? 0xFF : 0;
}
break;
case EMSdevice::EMS_DEVICE_FLAG_JUNKERS:
@@ -3599,7 +3604,7 @@ void Thermostat::register_device_values() {
&wwDisinfectHour_,
DeviceValueType::UINT,
DeviceValueNumOp::DV_NUMOP_MUL15,
FL_(wwDisinfectTime),
FL_(wwDisinfectHour),
DeviceValueUOM::MINUTES,
MAKE_CF_CB(set_wwDisinfectHour),
0,

View File

@@ -41,6 +41,7 @@ class Thermostat : public EMSdevice {
uint8_t tempautotemp;
int8_t remoteseltemp;
uint8_t mode;
uint8_t mode_new;
uint8_t modetype;
uint8_t summermode;
uint8_t holidaymode;
@@ -318,6 +319,7 @@ class Thermostat : public EMSdevice {
static constexpr uint8_t EMS_OFFSET_RCPLUSStatusMessage_curr = 0; // current temp
static constexpr uint8_t EMS_OFFSET_RCPLUSStatusMessage_currsetpoint = 6; // target setpoint temp
static constexpr uint8_t EMS_OFFSET_RCPLUSSet_mode = 0; // operation mode(Auto=0xFF, Manual=0x00)
static constexpr uint8_t EMS_OFFSET_RCPLUSSet_mode_new = 21; // operation mode(0-off, 1-manual, 2-auto)
static constexpr uint8_t EMS_OFFSET_RCPLUSSet_temp_comfort3 = 1; // comfort3 level
static constexpr uint8_t EMS_OFFSET_RCPLUSSet_temp_comfort2 = 2; // comfort2 level
static constexpr uint8_t EMS_OFFSET_RCPLUSSet_temp_comfort1 = 3; // comfort1 level

View File

@@ -303,7 +303,7 @@ MAKE_ENUM(enum_summer, FL_(winter), FL_(summer))
MAKE_ENUM(enum_operatingstate, FL_(heating), FL_(off), FL_(cooling))
MAKE_ENUM(enum_hpmode, FL_(heating), FL_(cooling), FL_(heatandcool))
MAKE_ENUM(enum_mode, FL_(manual), FL_(auto)) // RC100, RC300, RC310
MAKE_ENUM(enum_mode, FL_(off), FL_(manual), FL_(auto)) // RC100, RC300, RC310
MAKE_ENUM(enum_mode2, FL_(off), FL_(manual), FL_(auto)) // RC20, RC30
MAKE_ENUM(enum_mode3, FL_(night), FL_(day), FL_(auto)) // RC35, RC30_N, RC25, RC20_N
MAKE_ENUM(enum_mode4, FL_(nofrost), FL_(eco), FL_(heat), FL_(auto)) // JUNKERS