Skip to content

Commit

Permalink
reducemode1, reducetemp and noreducetemp for RC310
Browse files Browse the repository at this point in the history
  • Loading branch information
tp1de committed May 24, 2022
1 parent 472b97e commit 9d34268
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/devices/thermostat.cpp
Expand Up @@ -959,6 +959,10 @@ void Thermostat::process_RC300Set(std::shared_ptr<const Telegram> telegram) {

has_update(telegram, hc->manualtemp, 10); // is * 2
has_enumupdate(telegram, hc->program, 11, 1); // timer program 1 or 2

has_enumupdate(telegram, hc->reducemode1, 5, 1); // 1-outdoor temp threshold, 2-room temp threshold, 3-reduced mode
has_update(telegram, hc->reducetemp, 9);
has_update(telegram, hc->noreducetemp, 12);
}

// types 0x2AF ff
Expand Down Expand Up @@ -2399,6 +2403,27 @@ bool Thermostat::set_reducemode(const char * value, const int8_t id) {
return true;
}

// sets the thermostat reducemode1 for RC310
bool Thermostat::set_reducemode1(const char * value, const int8_t id) {
uint8_t hc_num = (id == -1) ? AUTO_HEATING_CIRCUIT : id;
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(hc_num);
if (hc == nullptr) {
return false;
}

uint8_t set = 0xFF;
if (model() == EMS_DEVICE_FLAG_RC300 || model() == EMS_DEVICE_FLAG_RC100) {
if (Helpers::value2enum(value, set, FL_(enum_reducemode1))) {
write_command(set_typeids[hc->hc()], 5, set + 1, set_typeids[hc->hc()]);
}
}

if (set == 0xFF) {
return false;
}
return true;
}

// sets the thermostat reducemode for RC35 vacations
bool Thermostat::set_vacreducemode(const char * value, const int8_t id) {
uint8_t hc_num = (id == -1) ? AUTO_HEATING_CIRCUIT : id;
Expand Down Expand Up @@ -2894,6 +2919,14 @@ bool Thermostat::set_temperature(const float temperature, const uint8_t mode, co
offset = 0;
factor = 1;
break;
case HeatingCircuit::Mode::NOREDUCE:
offset = 12;
factor = 1;
break;
case HeatingCircuit::Mode::REDUCE:
offset = 9;
factor = 1;
break;
default:
// HeatingCircuit::Mode::AUTO:
uint8_t mode_ = hc->get_mode();
Expand Down Expand Up @@ -3849,6 +3882,9 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
register_device_value(
tag, &hc->tempautotemp, DeviceValueType::INT, FL_(div2), FL_(tempautotemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_tempautotemp), -1, 30);
register_device_value(tag, &hc->fastHeatup, DeviceValueType::UINT, nullptr, FL_(fastheatup), DeviceValueUOM::PERCENT, MAKE_CF_CB(set_fastheatup));
register_device_value(tag, &hc->reducemode1, DeviceValueType::ENUM, FL_(enum_reducemode1), FL_(reducemode1), DeviceValueUOM::NONE, MAKE_CF_CB(set_reducemode1));
register_device_value(tag, &hc->noreducetemp, DeviceValueType::INT, nullptr, FL_(noreducetemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_noreducetemp));
register_device_value(tag, &hc->reducetemp, DeviceValueType::INT, nullptr, FL_(reducetemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_reducetemp));
break;
case EMS_DEVICE_FLAG_CRF:
register_device_value(tag, &hc->mode, DeviceValueType::ENUM, FL_(enum_mode5), FL_(mode), DeviceValueUOM::NONE);
Expand Down
3 changes: 3 additions & 0 deletions src/devices/thermostat.h
Expand Up @@ -63,6 +63,7 @@ class Thermostat : public EMSdevice {
uint8_t minflowtemp;
uint8_t maxflowtemp;
uint8_t reducemode;
uint8_t reducemode1; // for RC310
uint8_t nofrostmode;
uint8_t program;
uint8_t controlmode;
Expand All @@ -71,6 +72,7 @@ class Thermostat : public EMSdevice {
uint8_t party;
int8_t noreducetemp; // signed -20°C to +10°C
int8_t reducetemp;
int8_t reducetemp1;
int8_t vacreducetemp;
uint8_t vacreducemode;
uint8_t wwprio;
Expand Down Expand Up @@ -420,6 +422,7 @@ class Thermostat : public EMSdevice {
bool set_minflowtemp(const char * value, const int8_t id);
bool set_maxflowtemp(const char * value, const int8_t id);
bool set_reducemode(const char * value, const int8_t id);
bool set_reducemode1(const char * value, const int8_t id); // for RC310
bool set_switchtime1(const char * value, const int8_t id);
bool set_switchtime2(const char * value, const int8_t id);
bool set_program(const char * value, const int8_t id);
Expand Down
2 changes: 2 additions & 0 deletions src/locale_EN.h
Expand Up @@ -383,6 +383,7 @@ MAKE_PSTR_LIST(enum_modetype4, F_(nofrost), F_(eco), F_(heat))
MAKE_PSTR_LIST(enum_modetype5, F_(off), F_(on))

MAKE_PSTR_LIST(enum_reducemode, F_(nofrost), F_(reduce), F_(room), F_(outdoor))
MAKE_PSTR_LIST(enum_reducemode1, F_(outdoor), F_(room), F_(reduce)) // RC310 values: 1-3
MAKE_PSTR_LIST(enum_nofrostmode, F_(off), F_(room), F_(outdoor))

MAKE_PSTR_LIST(enum_controlmode, F_(off), F_(optimized), F_(simple), F_(mpc), F_(room), F_(power), F_(constant))
Expand Down Expand Up @@ -659,6 +660,7 @@ MAKE_PSTR_LIST(summermode, F("summermode"), F("summer mode"))
MAKE_PSTR_LIST(holidaymode, F("holidaymode"), F("holiday mode"))
MAKE_PSTR_LIST(flowtempoffset, F("flowtempoffset"), F("flow temperature offset for mixer"))
MAKE_PSTR_LIST(reducemode, F("reducemode"), F("reduce mode"))
MAKE_PSTR_LIST(reducemode1, F("reducemode1"), F("reduce/setback mode")) // RC310
MAKE_PSTR_LIST(noreducetemp, F("noreducetemp"), F("no reduce below temperature"))
MAKE_PSTR_LIST(reducetemp, F("reducetemp"), F("off/reduce switch temperature"))
MAKE_PSTR_LIST(vacreducetemp, F("vacreducetemp"), F("vacations off/reduce switch temperature"))
Expand Down

0 comments on commit 9d34268

Please sign in to comment.