From d0aa601301f74d8fac134b854a79a139b6330dd4 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Sun, 13 Mar 2022 13:29:07 +0100 Subject: [PATCH] add RC35 values #398 --- CHANGELOG_LATEST.md | 1 + src/devices/thermostat.cpp | 66 ++++++++++++++++++++++++++++++++++++-- src/devices/thermostat.h | 17 ++++++++++ src/locale_DE.h | 5 +++ src/locale_EN.h | 5 +++ 5 files changed, 91 insertions(+), 3 deletions(-) diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index 74ecb6350..c449bc8ce 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -26,6 +26,7 @@ - remove MQTT retained configs if discovery is disabled - timeout 10 min for MQTT-QoS wait - Moduline 300 auto-temperatures T1-T4, RC300 romminfluencefactor +- RC35 parameters [#392](https://github.com/emsesp/EMS-ESP32/issues/392)[#398](https://github.com/emsesp/EMS-ESP32/issues/398) ### Fixed diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index 689690e67..a57248c5e 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -1102,12 +1102,16 @@ void Thermostat::process_RC35Set(std::shared_ptr telegram) { has_update(telegram, hc->wwprio, 21); // 0xFF for on has_update(telegram, hc->summertemp, 22); // is * 1 has_update(telegram, hc->nofrosttemp, 23); // is * 1 + has_update(telegram, hc->nofrostmode, 28); // 0-off, 1-outdoor, 2-roomtemp 5°C has_update(telegram, hc->flowtempoffset, 24); // is * 1, only in mixed circuits has_update(telegram, hc->reducemode, 25); // 0-nofrost, 1-reduce, 2-roomhold, 3-outdoorhold has_update(telegram, hc->control, 26); // 0-off, 1-RC20 (remote), 2-RC35 has_update(telegram, hc->controlmode, 33); // 0-outdoortemp, 1-roomtemp has_update(telegram, hc->tempautotemp, 37); - has_update(telegram, hc->noreducetemp, 38); // outdoor temperature for no reduce + has_update(telegram, hc->noreducetemp, 38); // outdoor temperature for no reduce + has_update(telegram, hc->reducetemp, 39); // temperature for off/reduce + has_update(telegram, hc->vacreducetemp, 40); // temperature for off/reduce in vacations + has_update(telegram, hc->vacreducemode, 41); // vacations reduce mode has_update(telegram, hc->minflowtemp, 16); if (hc->heatingtype == 3) { // floor heating @@ -1427,7 +1431,7 @@ bool Thermostat::set_control(const char * value, const int8_t id) { return true; } } else if (Helpers::value2enum(value, ctrl, FL_(enum_control))) { - write_command(set_typeids[hc->hc()], 26, ctrl); + write_command(set_typeids[hc->hc()], EMS_OFFSET_RC35Set_control, ctrl); return true; } @@ -2053,7 +2057,41 @@ bool Thermostat::set_reducemode(const char * value, const int8_t id) { return false; } - write_command(set_typeids[hc->hc()], 25, set, set_typeids[hc->hc()]); + write_command(set_typeids[hc->hc()], EMS_OFFSET_RC35Set_reducemode, set, set_typeids[hc->hc()]); + 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; + std::shared_ptr hc = heating_circuit(hc_num); + if (hc == nullptr) { + return false; + } + + uint8_t set = 0xFF; + if (!Helpers::value2enum(value, set, FL_(enum_reducemode))) { + return false; + } + + write_command(set_typeids[hc->hc()], EMS_OFFSET_RC35Set_vacreducemode, set, set_typeids[hc->hc()]); + return true; +} + +// sets the thermostat nofrost mode for RC35 +bool Thermostat::set_nofrostmode(const char * value, const int8_t id) { + uint8_t hc_num = (id == -1) ? AUTO_HEATING_CIRCUIT : id; + std::shared_ptr hc = heating_circuit(hc_num); + if (hc == nullptr) { + return false; + } + + uint8_t set = 0xFF; + if (!Helpers::value2enum(value, set, FL_(enum_nofrostmode))) { + return false; + } + + write_command(set_typeids[hc->hc()], EMS_OFFSET_RC35Set_nofrostmode, set, set_typeids[hc->hc()]); return true; } @@ -2578,6 +2616,14 @@ bool Thermostat::set_temperature(const float temperature, const uint8_t mode, co offset = EMS_OFFSET_RC35Set_noreducetemp; factor = 1; break; + case HeatingCircuit::Mode::REDUCE: + offset = EMS_OFFSET_RC35Set_reducetemp; + factor = 1; + break; + case HeatingCircuit::Mode::VACREDUCE: + offset = EMS_OFFSET_RC35Set_vacreducetemp; + factor = 1; + break; case HeatingCircuit::Mode::TEMPAUTO: offset = EMS_OFFSET_RC35Set_seltemp; break; @@ -2756,6 +2802,14 @@ bool Thermostat::set_noreducetemp(const char * value, const int8_t id) { return set_temperature_value(value, id, HeatingCircuit::Mode::NOREDUCE); } +bool Thermostat::set_reducetemp(const char * value, const int8_t id) { + return set_temperature_value(value, id, HeatingCircuit::Mode::REDUCE); +} + +bool Thermostat::set_vacreducetemp(const char * value, const int8_t id) { + return set_temperature_value(value, id, HeatingCircuit::Mode::VACREDUCE); +} + bool Thermostat::set_flowtempoffset(const char * value, const int8_t id) { return set_temperature_value(value, id, HeatingCircuit::Mode::FLOWOFFSET, true); } @@ -3303,6 +3357,8 @@ void Thermostat::register_device_values_hc(std::shared_ptrsummermode, DeviceValueType::ENUM, FL_(enum_summer), FL_(summermode), DeviceValueUOM::NONE); register_device_value(tag, &hc->holidaymode, DeviceValueType::BOOL, nullptr, FL_(holidaymode), DeviceValueUOM::NONE); register_device_value(tag, &hc->nofrosttemp, DeviceValueType::INT, nullptr, FL_(nofrosttemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_nofrosttemp)); + register_device_value( + tag, &hc->nofrostmode, DeviceValueType::ENUM, FL_(enum_nofrostmode), FL_(nofrostmode), DeviceValueUOM::NONE, MAKE_CF_CB(set_nofrostmode)); register_device_value(tag, &hc->roominfluence, DeviceValueType::UINT, nullptr, FL_(roominfluence), DeviceValueUOM::DEGREES_R, MAKE_CF_CB(set_roominfluence)); register_device_value(tag, &hc->minflowtemp, DeviceValueType::UINT, nullptr, FL_(minflowtemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_minflowtemp)); register_device_value(tag, &hc->maxflowtemp, DeviceValueType::UINT, nullptr, FL_(maxflowtemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_maxflowtemp)); @@ -3321,6 +3377,10 @@ void Thermostat::register_device_values_hc(std::shared_ptrparty, DeviceValueType::UINT, nullptr, FL_(party), DeviceValueUOM::HOURS, MAKE_CF_CB(set_party)); register_device_value(tag, &hc->tempautotemp, DeviceValueType::UINT, FL_(div2), FL_(tempautotemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_tempautotemp)); 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)); + register_device_value(tag, &hc->vacreducetemp, DeviceValueType::INT, nullptr, FL_(vacreducetemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_vacreducetemp)); + register_device_value( + tag, &hc->vacreducemode, DeviceValueType::ENUM, FL_(enum_reducemode), FL_(vacreducemode), DeviceValueUOM::NONE, MAKE_CF_CB(set_vacreducemode)); register_device_value(tag, &hc->remotetemp, DeviceValueType::SHORT, FL_(div10), FL_(remotetemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_remotetemp)); register_device_value(tag, &hc->wwprio, DeviceValueType::BOOL, nullptr, FL_(wwprio), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwprio)); register_device_value( diff --git a/src/devices/thermostat.h b/src/devices/thermostat.h index 8bd467b46..9793d1645 100644 --- a/src/devices/thermostat.h +++ b/src/devices/thermostat.h @@ -62,12 +62,16 @@ class Thermostat : public EMSdevice { uint8_t minflowtemp; uint8_t maxflowtemp; uint8_t reducemode; + uint8_t nofrostmode; uint8_t program; uint8_t controlmode; uint8_t control; uint8_t pause; uint8_t party; int8_t noreducetemp; // signed -20°C to +10°C + int8_t reducetemp; + int8_t vacreducetemp; + uint8_t vacreducemode; uint8_t wwprio; uint8_t fastHeatup; char holiday[26]; @@ -120,6 +124,8 @@ class Thermostat : public EMSdevice { ROOMINFLUENCE, TEMPAUTO, NOREDUCE, + REDUCE, + VACREDUCE, ON, DAYLOW, DAYMID, @@ -245,6 +251,12 @@ class Thermostat : public EMSdevice { static constexpr uint8_t EMS_OFFSET_RC35Set_targetflowtemp = 14; // target flow temperature static constexpr uint8_t EMS_OFFSET_RC35Set_seltemp = 37; // selected temp static constexpr uint8_t EMS_OFFSET_RC35Set_noreducetemp = 38; // temp to stop reducing + static constexpr uint8_t EMS_OFFSET_RC35Set_reducetemp = 39; // temp reducing/hold + static constexpr uint8_t EMS_OFFSET_RC35Set_vacreducetemp = 40; // temp reducing/hold in vacations + static constexpr uint8_t EMS_OFFSET_RC35Set_vacreducemode = 41; // reduce mode in vacations + static constexpr uint8_t EMS_OFFSET_RC35Set_reducemode = 25; // reduce mode in normal operation + static constexpr uint8_t EMS_OFFSET_RC35Set_nofrostmode = 28; // 0-off, 1-room, 2-outdoor + static constexpr uint8_t EMS_OFFSET_RC35Set_control = 26; // 0-off, 1-RC20, 2-RC3x static constexpr uint8_t EMS_OFFSET_RC35Set_temp_offset = 6; static constexpr uint8_t EMS_OFFSET_RC35Set_temp_flowoffset = 24; static constexpr uint8_t EMS_OFFSET_RC35Set_temp_design = 17; @@ -368,6 +380,11 @@ class Thermostat : public EMSdevice { bool set_manualtemp(const char * value, const int8_t id); bool set_tempautotemp(const char * value, const int8_t id); bool set_noreducetemp(const char * value, const int8_t id); + bool set_reducetemp(const char * value, const int8_t id); + bool set_vacreducetemp(const char * value, const int8_t id); + bool set_vacreducemode(const char * value, const int8_t id); + bool set_nofrostmode(const char * value, const int8_t id); + bool set_remotetemp(const char * value, const int8_t id); bool set_roominfluence(const char * value, const int8_t id); bool set_roominfl_factor(const char * value, const int8_t id); diff --git a/src/locale_DE.h b/src/locale_DE.h index bbc2908cb..f32464a03 100644 --- a/src/locale_DE.h +++ b/src/locale_DE.h @@ -372,6 +372,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_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)) MAKE_PSTR_LIST(enum_controlmode2, F_(outdoor), F_(room)) @@ -636,6 +637,10 @@ MAKE_PSTR_LIST(holidaymode, F("holidaymode"), F("Urlaubsbetrieb")) MAKE_PSTR_LIST(flowtempoffset, F("flowtempoffset"), F("Flusstemperaturanhebung")) MAKE_PSTR_LIST(reducemode, F("reducemode"), F("Absenkmodus")) MAKE_PSTR_LIST(noreducetemp, F("noreducetemp"), F("Absenkung unterbrechen unter Temperatur")) +MAKE_PSTR_LIST(reducetemp, F("reducetemp"), F("Absenkmodus unter Temperatur")) +MAKE_PSTR_LIST(vacreducetemp, F("vacreducetemp"), F("Urlaub Absenkmodus unter Temperatur")) +MAKE_PSTR_LIST(vacreducemode, F("vacreducemode"), F("Urlaub Absenkmodus")) +MAKE_PSTR_LIST(nofrostmode, F("nofrostmode"), F("Frostschutz Modus")) MAKE_PSTR_LIST(remotetemp, F("remotetemp"), F("Raumtemperatur der Fernsteuerung")) MAKE_PSTR_LIST(reducehours, F("reducehours"), F("duration for nighttemp")) MAKE_PSTR_LIST(reduceminutes, F("reduceminutes"), F("remaining time for nightmode")) diff --git a/src/locale_EN.h b/src/locale_EN.h index 001bdd596..2939a63f7 100644 --- a/src/locale_EN.h +++ b/src/locale_EN.h @@ -372,6 +372,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_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)) MAKE_PSTR_LIST(enum_controlmode2, F_(outdoor), F_(room)) @@ -626,6 +627,10 @@ 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(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")) +MAKE_PSTR_LIST(vacreducemode, F("vacreducemode"), F("vacations reduce mode")) +MAKE_PSTR_LIST(nofrostmode, F("nofrostmode"), F("nofrost mode")) MAKE_PSTR_LIST(remotetemp, F("remotetemp"), F("room temperature from remote")) MAKE_PSTR_LIST(reducehours, F("reducehours"), F("duration for nighttemp")) MAKE_PSTR_LIST(reduceminutes, F("reduceminutes"), F("remaining time for nightmode"))