From 9d3426877d2d0c849a8933fd7e15f1c9944b3388 Mon Sep 17 00:00:00 2001 From: tp1de Date: Tue, 24 May 2022 16:53:01 +0200 Subject: [PATCH 01/12] reducemode1, reducetemp and noreducetemp for RC310 --- src/devices/thermostat.cpp | 36 ++++++++++++++++++++++++++++++++++++ src/devices/thermostat.h | 3 +++ src/locale_EN.h | 2 ++ 3 files changed, 41 insertions(+) diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index 7be718f9b..e9d68fcee 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -959,6 +959,10 @@ void Thermostat::process_RC300Set(std::shared_ptr 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 @@ -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 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; @@ -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(); @@ -3849,6 +3882,9 @@ void Thermostat::register_device_values_hc(std::shared_ptrtempautotemp, 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); diff --git a/src/devices/thermostat.h b/src/devices/thermostat.h index 2fde27634..fa214cf24 100644 --- a/src/devices/thermostat.h +++ b/src/devices/thermostat.h @@ -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; @@ -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; @@ -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); diff --git a/src/locale_EN.h b/src/locale_EN.h index 5ddf6dc1e..a375976cc 100644 --- a/src/locale_EN.h +++ b/src/locale_EN.h @@ -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)) @@ -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")) From 94c45891b4477768c1152eb0c990e699e3cc3b72 Mon Sep 17 00:00:00 2001 From: tp1de Date: Tue, 24 May 2022 19:51:37 +0200 Subject: [PATCH 02/12] add nofrostmode1 for RC310 --- src/devices/thermostat.cpp | 19 +++++++++++++++++++ src/devices/thermostat.h | 2 ++ src/locale_EN.h | 3 +++ 3 files changed, 24 insertions(+) diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index e9d68fcee..7a51cf30f 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -1010,6 +1010,7 @@ void Thermostat::process_RC300Curve(std::shared_ptr telegram) { has_update(telegram, hc->controlmode, 0); // 1-outdoor, 2-simple, 3-MPC, 4-room, 5-power, 6-const has_update(telegram, hc->heatingtype, 1); // 1=radiator, 2=convector, 3=floor + has_enumupdate(telegram, hc->nofrostmode1, 5, 1); // 1-room, 2-outdoor, 3- room & outdoor has_update(telegram, hc->nofrosttemp, 6); if (hc->heatingtype < 3) { @@ -2458,6 +2459,22 @@ bool Thermostat::set_nofrostmode(const char * value, const int8_t id) { return true; } +bool Thermostat::set_nofrostmode1(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_nofrostmode1))) { + return false; + } + + write_command(curve_typeids[hc->hc()], 5, set + 1, curve_typeids[hc->hc()]); + return true; +} + // sets the thermostat heatingtype for RC35, RC300 bool Thermostat::set_heatingtype(const char * value, const int8_t id) { uint8_t hc_num = (id == -1) ? AUTO_HEATING_CIRCUIT : id; @@ -3862,6 +3879,8 @@ void Thermostat::register_device_values_hc(std::shared_ptrroominfl_factor, DeviceValueType::UINT, FL_(div10), FL_(roominfl_factor), DeviceValueUOM::NONE, MAKE_CF_CB(set_roominfl_factor)); register_device_value(tag, &hc->curroominfl, DeviceValueType::SHORT, FL_(div10), FL_(curroominfl), DeviceValueUOM::DEGREES_R); + register_device_value( + tag, &hc->nofrostmode1, DeviceValueType::ENUM, FL_(enum_nofrostmode1), FL_(nofrostmode1), DeviceValueUOM::NONE, MAKE_CF_CB(set_nofrostmode1)); register_device_value(tag, &hc->nofrosttemp, DeviceValueType::INT, nullptr, FL_(nofrosttemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_nofrosttemp)); register_device_value(tag, &hc->targetflowtemp, DeviceValueType::UINT, nullptr, FL_(targetflowtemp), DeviceValueUOM::DEGREES); register_device_value( diff --git a/src/devices/thermostat.h b/src/devices/thermostat.h index fa214cf24..d9ea04b61 100644 --- a/src/devices/thermostat.h +++ b/src/devices/thermostat.h @@ -65,6 +65,7 @@ class Thermostat : public EMSdevice { uint8_t reducemode; uint8_t reducemode1; // for RC310 uint8_t nofrostmode; + uint8_t nofrostmode1; // for RC310 uint8_t program; uint8_t controlmode; uint8_t control; @@ -414,6 +415,7 @@ class Thermostat : public EMSdevice { 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_nofrostmode1(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); diff --git a/src/locale_EN.h b/src/locale_EN.h index a375976cc..9d53f60ad 100644 --- a/src/locale_EN.h +++ b/src/locale_EN.h @@ -313,6 +313,7 @@ MAKE_PSTR_WORD(winter) MAKE_PSTR_WORD(outdoor) MAKE_PSTR_WORD(mpc) MAKE_PSTR_WORD(room) +MAKE_PSTR_WORD(room_outdoor) MAKE_PSTR_WORD(power) MAKE_PSTR_WORD(constant) MAKE_PSTR_WORD(simple) @@ -385,6 +386,7 @@ 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_nofrostmode1, F_(room), F_(outdoor), F_(room_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)) @@ -666,6 +668,7 @@ 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(nofrostmode1, F("nofrostmode1"), F("nofrost mode")) // RC310 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")) From c1598f3d4ed8624b697a3cf88235da94e24fb518 Mon Sep 17 00:00:00 2001 From: tp1de Date: Tue, 24 May 2022 20:08:10 +0200 Subject: [PATCH 03/12] changelog --- CHANGELOG_LATEST.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index 0ec10fa91..9c8ebf8c1 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -4,6 +4,8 @@ ### Added +- Added nofrostmode1, reducemode1,reducetemp & noreducetemp for RC310 +- Added emergencyops and emergencytemp, wwmaxtemp, wwflowtempoffset and wwcomfort1 for RC310 - WebUI optimizations, updated look&feel and better performance [#124](https://github.com/emsesp/EMS-ESP32/issues/124) - Auto refresh of WebUI after successful firmware upload [#178](https://github.com/emsesp/EMS-ESP32/issues/178) - New Customization Service in WebUI. First feature is the ability to enable/disabled Enitites (device values) from EMS devices [#206](https://github.com/emsesp/EMS-ESP32/issues/206) From 3115fae80707bc155faaf447136d3c529160ca12 Mon Sep 17 00:00:00 2001 From: tp1de Date: Wed, 25 May 2022 13:38:50 +0200 Subject: [PATCH 04/12] Added enum_controlmode1 - Adjusted enum list for RC310 --- CHANGELOG_LATEST.md | 1 + src/devices/thermostat.cpp | 11 ++++++++--- src/locale_EN.h | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index 9c8ebf8c1..b7f7965d7 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -4,6 +4,7 @@ ### Added +- Added enum_controlmode1 for RC310 (enum list) - Added nofrostmode1, reducemode1,reducetemp & noreducetemp for RC310 - Added emergencyops and emergencytemp, wwmaxtemp, wwflowtempoffset and wwcomfort1 for RC310 - WebUI optimizations, updated look&feel and better performance [#124](https://github.com/emsesp/EMS-ESP32/issues/124) diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index 7a51cf30f..e2f8e556f 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -1008,7 +1008,7 @@ void Thermostat::process_RC300Curve(std::shared_ptr telegram) { return; } - has_update(telegram, hc->controlmode, 0); // 1-outdoor, 2-simple, 3-MPC, 4-room, 5-power, 6-const + has_enumupdate(telegram, hc->controlmode, 0, 1); // 1-weather_compensated, 2-outside_footpoint,3-n/a, 4-room -- RC310 has_update(telegram, hc->heatingtype, 1); // 1=radiator, 2=convector, 3=floor has_enumupdate(telegram, hc->nofrostmode1, 5, 1); // 1-room, 2-outdoor, 3- room & outdoor has_update(telegram, hc->nofrosttemp, 6); @@ -2509,11 +2509,16 @@ bool Thermostat::set_controlmode(const char * value, const int8_t id) { } uint8_t set = 0xFF; - if (model() == EMS_DEVICE_FLAG_RC300 || model() == EMS_DEVICE_FLAG_RC100) { + if (model() == EMS_DEVICE_FLAG_RC100) { if (Helpers::value2enum(value, set, FL_(enum_controlmode))) { write_command(curve_typeids[hc->hc()], 0, set, curve_typeids[hc->hc()]); return true; } + } else if (model() == EMS_DEVICE_FLAG_RC300) { + if (Helpers::value2enum(value, set, FL_(enum_controlmode1))) { + write_command(curve_typeids[hc->hc()], 0, set + 1, curve_typeids[hc->hc()]); + return true; + } } else if (model() == EMS_DEVICE_FLAG_RC30) { if (Helpers::value2enum(value, set, FL_(enum_controlmode2))) { write_command(curve_typeids[hc->hc()], 1, set, curve_typeids[hc->hc()]); @@ -3896,7 +3901,7 @@ void Thermostat::register_device_values_hc(std::shared_ptrsummermode, DeviceValueType::ENUM, FL_(enum_summer), FL_(summermode), DeviceValueUOM::NONE); register_device_value( - tag, &hc->controlmode, DeviceValueType::ENUM, FL_(enum_controlmode), FL_(controlmode), DeviceValueUOM::NONE, MAKE_CF_CB(set_controlmode)); + tag, &hc->controlmode, DeviceValueType::ENUM, FL_(enum_controlmode1), FL_(controlmode), DeviceValueUOM::NONE, MAKE_CF_CB(set_controlmode)); register_device_value(tag, &hc->program, DeviceValueType::ENUM, FL_(enum_progMode), FL_(program), DeviceValueUOM::NONE, MAKE_CF_CB(set_program)); register_device_value( tag, &hc->tempautotemp, DeviceValueType::INT, FL_(div2), FL_(tempautotemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_tempautotemp), -1, 30); diff --git a/src/locale_EN.h b/src/locale_EN.h index 9d53f60ad..914f38db9 100644 --- a/src/locale_EN.h +++ b/src/locale_EN.h @@ -389,6 +389,7 @@ MAKE_PSTR_LIST(enum_nofrostmode, F_(off), F_(room), F_(outdoor)) MAKE_PSTR_LIST(enum_nofrostmode1, F_(room), F_(outdoor), F_(room_outdoor)) MAKE_PSTR_LIST(enum_controlmode, F_(off), F_(optimized), F_(simple), F_(mpc), F_(room), F_(power), F_(constant)) +MAKE_PSTR_LIST(enum_controlmode1, F("weather-compensated") ,F("outside-basepoint"), F("n/a"), F_(room)) // RC310 1-4 MAKE_PSTR_LIST(enum_controlmode2, F_(outdoor), F_(room)) // MAKE_PSTR_LIST(enum_controlmode3, F_(off), F_(room), F_(outdoor), F("room+outdoor")) MAKE_PSTR_LIST(enum_control, F_(off), F_(rc20), F_(rc3x)) From 60e1a9396662435af1b3e147aa9418a75f890eae Mon Sep 17 00:00:00 2001 From: tp1de Date: Wed, 25 May 2022 14:22:12 +0200 Subject: [PATCH 05/12] correct nofrostmodet1 & reducemode1 - just change enums ! --- CHANGELOG_LATEST.md | 4 +-- src/devices/thermostat.cpp | 69 ++++++++++++-------------------------- src/devices/thermostat.h | 5 --- src/locale_EN.h | 1 - 4 files changed, 24 insertions(+), 55 deletions(-) diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index b7f7965d7..3a93bd74c 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -4,8 +4,8 @@ ### Added -- Added enum_controlmode1 for RC310 (enum list) -- Added nofrostmode1, reducemode1,reducetemp & noreducetemp for RC310 +- Added enum_controlmode for RC310 (new enum list) +- Added nofrostmode, reducemode, reducetemp & noreducetemp for RC310 - Added emergencyops and emergencytemp, wwmaxtemp, wwflowtempoffset and wwcomfort1 for RC310 - WebUI optimizations, updated look&feel and better performance [#124](https://github.com/emsesp/EMS-ESP32/issues/124) - Auto refresh of WebUI after successful firmware upload [#178](https://github.com/emsesp/EMS-ESP32/issues/178) diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index e2f8e556f..7ce7cdb6b 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -960,7 +960,7 @@ void Thermostat::process_RC300Set(std::shared_ptr 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_enumupdate(telegram, hc->reducemode, 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); } @@ -1010,7 +1010,7 @@ void Thermostat::process_RC300Curve(std::shared_ptr telegram) { has_enumupdate(telegram, hc->controlmode, 0, 1); // 1-weather_compensated, 2-outside_footpoint,3-n/a, 4-room -- RC310 has_update(telegram, hc->heatingtype, 1); // 1=radiator, 2=convector, 3=floor - has_enumupdate(telegram, hc->nofrostmode1, 5, 1); // 1-room, 2-outdoor, 3- room & outdoor + has_enumupdate(telegram, hc->nofrostmode, 5, 1); // 1-room, 2-outdoor, 3- room & outdoor has_update(telegram, hc->nofrosttemp, 6); if (hc->heatingtype < 3) { @@ -2387,7 +2387,7 @@ bool Thermostat::set_fastheatup(const char * value, const int8_t id) { return true; } -// sets the thermostat reducemode for RC35 +// sets the thermostat reducemode for RC35 and RC310 bool Thermostat::set_reducemode(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); @@ -2396,35 +2396,21 @@ bool Thermostat::set_reducemode(const char * value, const int8_t id) { } uint8_t set = 0xFF; - if (!Helpers::value2enum(value, set, FL_(enum_reducemode))) { - return false; - } - - write_command(set_typeids[hc->hc()], EMS_OFFSET_RC35Set_reducemode, set, set_typeids[hc->hc()]); - 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 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 (model() == EMS_DEVICE_FLAG_RC300 ) { 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; + else { + if (Helpers::value2enum(value, set, FL_(enum_reducemode))) { + write_command(set_typeids[hc->hc()], EMS_OFFSET_RC35Set_reducemode, set, set_typeids[hc->hc()]); + return true; + } } 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; @@ -2449,29 +2435,18 @@ bool Thermostat::set_nofrostmode(const char * value, const int8_t id) { if (hc == nullptr) { return false; } - uint8_t set = 0xFF; - if (!Helpers::value2enum(value, set, FL_(enum_nofrostmode))) { - return false; + if (model() == EMS_DEVICE_FLAG_RC300) { + if (Helpers::value2enum(value, set, FL_(enum_controlmode1))) { + write_command(curve_typeids[hc->hc()], 5, set + 1, curve_typeids[hc->hc()]); + return true; + } + } else { + if (Helpers::value2enum(value, set, FL_(enum_controlmode))) { + write_command(set_typeids[hc->hc()], EMS_OFFSET_RC35Set_nofrostmode, set, set_typeids[hc->hc()]); + return true; + } } - - write_command(set_typeids[hc->hc()], EMS_OFFSET_RC35Set_nofrostmode, set, set_typeids[hc->hc()]); - return true; -} - -bool Thermostat::set_nofrostmode1(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_nofrostmode1))) { - return false; - } - - write_command(curve_typeids[hc->hc()], 5, set + 1, curve_typeids[hc->hc()]); return true; } @@ -3885,7 +3860,7 @@ void Thermostat::register_device_values_hc(std::shared_ptrroominfl_factor, DeviceValueType::UINT, FL_(div10), FL_(roominfl_factor), DeviceValueUOM::NONE, MAKE_CF_CB(set_roominfl_factor)); register_device_value(tag, &hc->curroominfl, DeviceValueType::SHORT, FL_(div10), FL_(curroominfl), DeviceValueUOM::DEGREES_R); register_device_value( - tag, &hc->nofrostmode1, DeviceValueType::ENUM, FL_(enum_nofrostmode1), FL_(nofrostmode1), DeviceValueUOM::NONE, MAKE_CF_CB(set_nofrostmode1)); + tag, &hc->nofrostmode, DeviceValueType::ENUM, FL_(enum_nofrostmode1), FL_(nofrostmode), DeviceValueUOM::NONE, MAKE_CF_CB(set_nofrostmode)); register_device_value(tag, &hc->nofrosttemp, DeviceValueType::INT, nullptr, FL_(nofrosttemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_nofrosttemp)); register_device_value(tag, &hc->targetflowtemp, DeviceValueType::UINT, nullptr, FL_(targetflowtemp), DeviceValueUOM::DEGREES); register_device_value( @@ -3906,7 +3881,7 @@ void Thermostat::register_device_values_hc(std::shared_ptrtempautotemp, 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->reducemode, DeviceValueType::ENUM, FL_(enum_reducemode1), FL_(reducemode), DeviceValueUOM::NONE, MAKE_CF_CB(set_reducemode)); 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; diff --git a/src/devices/thermostat.h b/src/devices/thermostat.h index d9ea04b61..db2cad313 100644 --- a/src/devices/thermostat.h +++ b/src/devices/thermostat.h @@ -63,9 +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 nofrostmode1; // for RC310 uint8_t program; uint8_t controlmode; uint8_t control; @@ -415,8 +413,6 @@ class Thermostat : public EMSdevice { 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_nofrostmode1(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); @@ -424,7 +420,6 @@ 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); diff --git a/src/locale_EN.h b/src/locale_EN.h index 914f38db9..8ed5594a2 100644 --- a/src/locale_EN.h +++ b/src/locale_EN.h @@ -663,7 +663,6 @@ 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")) From 570588f498d2bc930995c5a06ed5de8ca7a60ea8 Mon Sep 17 00:00:00 2001 From: tp1de Date: Wed, 25 May 2022 20:01:56 +0200 Subject: [PATCH 06/12] delete obsolete reducetemp1 --- src/devices/thermostat.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/devices/thermostat.h b/src/devices/thermostat.h index db2cad313..516af32c8 100644 --- a/src/devices/thermostat.h +++ b/src/devices/thermostat.h @@ -71,7 +71,6 @@ 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; From 53d3bda3266b2a388b9386a401f725abbd0290bc Mon Sep 17 00:00:00 2001 From: tp1de Date: Wed, 25 May 2022 21:20:32 +0200 Subject: [PATCH 07/12] Added switchonoptimization for RC310 --- CHANGELOG_LATEST.md | 1 + src/devices/thermostat.cpp | 20 ++++++++++++++++++++ src/devices/thermostat.h | 2 ++ src/locale_EN.h | 1 + 4 files changed, 24 insertions(+) diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index 3a93bd74c..f4b7ddf98 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -4,6 +4,7 @@ ### Added +- Added switchonoptimization for RC310 - Added enum_controlmode for RC310 (new enum list) - Added nofrostmode, reducemode, reducetemp & noreducetemp for RC310 - Added emergencyops and emergencytemp, wwmaxtemp, wwflowtempoffset and wwcomfort1 for RC310 diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index 7ce7cdb6b..d4ce46fec 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -1010,6 +1010,7 @@ void Thermostat::process_RC300Curve(std::shared_ptr telegram) { has_enumupdate(telegram, hc->controlmode, 0, 1); // 1-weather_compensated, 2-outside_footpoint,3-n/a, 4-room -- RC310 has_update(telegram, hc->heatingtype, 1); // 1=radiator, 2=convector, 3=floor + has_update(telegram, hc->switchonoptimization, 4); has_enumupdate(telegram, hc->nofrostmode, 5, 1); // 1-room, 2-outdoor, 3- room & outdoor has_update(telegram, hc->nofrosttemp, 6); @@ -2387,6 +2388,24 @@ bool Thermostat::set_fastheatup(const char * value, const int8_t id) { return true; } +// Set switchonoptimization RC310 +bool Thermostat::set_switchonoptimization(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; + } + + bool b = false; + + if (!Helpers::value2bool(value, b)) { + return false; + } + write_command(curve_typeids[hc->hc()], 4, b ? 0xFF : 0x00, curve_typeids[hc->hc()]); + return true; +} + + // sets the thermostat reducemode for RC35 and RC310 bool Thermostat::set_reducemode(const char * value, const int8_t id) { uint8_t hc_num = (id == -1) ? AUTO_HEATING_CIRCUIT : id; @@ -3881,6 +3900,7 @@ void Thermostat::register_device_values_hc(std::shared_ptrtempautotemp, 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->switchonoptimization, DeviceValueType::BOOL, nullptr, FL_(switchonoptimization), DeviceValueUOM::NONE, MAKE_CF_CB(set_switchonoptimization)); register_device_value(tag, &hc->reducemode, DeviceValueType::ENUM, FL_(enum_reducemode1), FL_(reducemode), DeviceValueUOM::NONE, MAKE_CF_CB(set_reducemode)); 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)); diff --git a/src/devices/thermostat.h b/src/devices/thermostat.h index 516af32c8..bc1d3483a 100644 --- a/src/devices/thermostat.h +++ b/src/devices/thermostat.h @@ -80,6 +80,7 @@ class Thermostat : public EMSdevice { char switchtime1[16]; char switchtime2[16]; uint8_t climate; + uint8_t switchonoptimization; // RC 10 uint8_t reducehours; // night reduce duration @@ -425,6 +426,7 @@ class Thermostat : public EMSdevice { bool set_controlmode(const char * value, const int8_t id); bool set_wwprio(const char * value, const int8_t id); bool set_fastheatup(const char * value, const int8_t id); + bool set_switchonoptimization(const char * value, const int8_t id); // set functions - these don't use the id/hc, the parameters are ignored bool set_wwmode(const char * value, const int8_t id); diff --git a/src/locale_EN.h b/src/locale_EN.h index 8ed5594a2..0c1ae03e5 100644 --- a/src/locale_EN.h +++ b/src/locale_EN.h @@ -672,6 +672,7 @@ MAKE_PSTR_LIST(nofrostmode1, F("nofrostmode1"), F("nofrost mode")) // RC310 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")) +MAKE_PSTR_LIST(switchonoptimization, F("switchonoptimization"), F("switch-on optimization")) // heatpump MAKE_PSTR_LIST(airHumidity, F("airhumidity"), F("relative air humidity")) From 622a5db8d11a6e3a6f777df64600a24568891649 Mon Sep 17 00:00:00 2001 From: tp1de Date: Fri, 27 May 2022 11:07:21 +0200 Subject: [PATCH 08/12] wwprio for RC310 thermostat --- CHANGELOG_LATEST.md | 5 +++-- src/devices/thermostat.cpp | 44 ++++++++++++++++++++++++++++++++++++-- src/devices/thermostat.h | 2 ++ src/emsesp.cpp | 4 +++- 4 files changed, 50 insertions(+), 5 deletions(-) diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index f4b7ddf98..e1ae6a508 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -4,9 +4,10 @@ ### Added -- Added switchonoptimization for RC310 +- Added wwprio for RC310 heating circuits +- Added switchonoptimization for RC310 heating circuits - Added enum_controlmode for RC310 (new enum list) -- Added nofrostmode, reducemode, reducetemp & noreducetemp for RC310 +- Added nofrostmode, reducemode, reducetemp & noreducetemp for RC310 - Added emergencyops and emergencytemp, wwmaxtemp, wwflowtempoffset and wwcomfort1 for RC310 - WebUI optimizations, updated look&feel and better performance [#124](https://github.com/emsesp/EMS-ESP32/issues/124) - Auto refresh of WebUI after successful firmware upload [#178](https://github.com/emsesp/EMS-ESP32/issues/178) diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index d4ce46fec..63ba0ed81 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -135,6 +135,7 @@ Thermostat::Thermostat(uint8_t device_type, uint8_t device_id, uint8_t product_i } else if ((model == EMSdevice::EMS_DEVICE_FLAG_RC300) || (model == EMSdevice::EMS_DEVICE_FLAG_RC100)) { monitor_typeids = {0x02A5, 0x02A6, 0x02A7, 0x02A8, 0x02A9, 0x02AA, 0x02AB, 0x02AC}; set_typeids = {0x02B9, 0x02BA, 0x02BB, 0x02BC, 0x02BD, 0x02BE, 0x02BF, 0x02C0}; + set2_typeids = {0x02CC, 0x02CE, 0x02D0, 0x02D2}; // max. 4 heating circuits supported ny RC310 summer_typeids = {0x02AF, 0x02B0, 0x02B1, 0x02B2, 0x02B3, 0x02B4, 0x02B5, 0x02B6}; curve_typeids = {0x029B, 0x029C, 0x029D, 0x029E, 0x029F, 0x02A0, 0x02A1, 0x02A2}; summer2_typeids = {0x0471, 0x0472, 0x0473, 0x0474, 0x0475, 0x0476, 0x0477, 0x0478}; @@ -145,6 +146,9 @@ Thermostat::Thermostat(uint8_t device_type, uint8_t device_id, uint8_t product_i register_telegram_type(curve_typeids[i], F("RC300Curves"), false, MAKE_PF_CB(process_RC300Curve)); register_telegram_type(summer2_typeids[i], F("RC300Summer2"), false, MAKE_PF_CB(process_RC300Summer2)); } + for (uint8_t i = 0; i < set2_typeids.size(); i++) { + register_telegram_type(set2_typeids[i], F("RC300Set2"), false, MAKE_PF_CB(process_RC300Set2)); + } register_telegram_type(0x2F5, F("RC300WWmode"), true, MAKE_PF_CB(process_RC300WWmode)); register_telegram_type(0x31B, F("RC300WWtemp"), true, MAKE_PF_CB(process_RC300WWtemp)); register_telegram_type(0x31D, F("RC300WWmode2"), false, MAKE_PF_CB(process_RC300WWmode2)); @@ -253,6 +257,16 @@ std::shared_ptr Thermostat::heating_circuit(std::sha } } + // not found, search set2 types + if (hc_num == 0) { + for (uint8_t i = 0; i < set2_typeids.size(); i++) { + if (set2_typeids[i] == telegram->type_id) { + hc_num = i + 1; + break; + } + } + } + // not found, search summer message types if (hc_num == 0) { for (uint8_t i = 0; i < summer_typeids.size(); i++) { @@ -365,6 +379,9 @@ std::shared_ptr Thermostat::heating_circuit(std::sha if (set_typeids.size()) { toggle_fetch(set_typeids[hc_num - 1], toggle_); } + if (set2_typeids.size()) { + toggle_fetch(set2_typeids[hc_num - 1], toggle_); + } if (summer_typeids.size()) { toggle_fetch(summer_typeids[hc_num - 1], toggle_); } @@ -1069,6 +1086,19 @@ void Thermostat::process_RC300Settings(std::shared_ptr telegram) has_update(telegram, ibaMinExtTemperature_, 10); } +// 0x2CC - e.g. wwprio for RC310 hcx parameter +void Thermostat::process_RC300Set2(std::shared_ptr telegram) { + // typeids are not in a raw. hc:0x2CC, hc2: 0x2CE for RC310 + // telegram is either offset 3 with data lenght of 1 and values 0/1 (radiators) - 10 0B FF 03 01 CC 01 F6 + // or offset 0 with data lenght of 6 bytes - offset 3 values are 0x00 or 0xFF - 10 0B FF 00 01 CE FF 13 0A FF 1E 00 20 + + std::shared_ptr hc = heating_circuit(telegram); + if (hc == nullptr) { + return; + } + has_update(telegram, hc->wwprio, 3); +} + // 0x267 RC300 floordrying void Thermostat::process_RC300Floordry(std::shared_ptr telegram) { has_update(telegram, floordrystatus_, 0); @@ -1794,12 +1824,17 @@ bool Thermostat::set_wwprio(const char * value, const int8_t id) { if (!Helpers::value2bool(value, b)) { return false; } - - write_command(set_typeids[hc->hc()], 21, b ? 0xFF : 0x00, set_typeids[hc->hc()]); + if ((model() == EMS_DEVICE_FLAG_RC300)) { + write_command(set2_typeids[hc->hc()], 3, b ? 0xFF : 0x00, set2_typeids[hc->hc()]); + } + else { + write_command(set_typeids[hc->hc()], 21, b ? 0xFF : 0x00, set_typeids[hc->hc()]); + } return true; } + // sets the thermostat ww circulation working mode, where mode is a string bool Thermostat::set_wwcircmode(const char * value, const int8_t id) { uint8_t set = 0xFF; @@ -2936,10 +2971,14 @@ bool Thermostat::set_temperature(const float temperature, const uint8_t mode, co factor = 1; break; case HeatingCircuit::Mode::NOREDUCE: + set_typeid = set_typeids[hc->hc()]; + validate_typeid = set_typeid; offset = 12; factor = 1; break; case HeatingCircuit::Mode::REDUCE: + set_typeid = set_typeids[hc->hc()]; + validate_typeid = set_typeid; offset = 9; factor = 1; break; @@ -3904,6 +3943,7 @@ void Thermostat::register_device_values_hc(std::shared_ptrreducemode, DeviceValueType::ENUM, FL_(enum_reducemode1), FL_(reducemode), DeviceValueUOM::NONE, MAKE_CF_CB(set_reducemode)); 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->wwprio, DeviceValueType::BOOL, nullptr, FL_(wwprio), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwprio)); break; case EMS_DEVICE_FLAG_CRF: register_device_value(tag, &hc->mode, DeviceValueType::ENUM, FL_(enum_mode5), FL_(mode), DeviceValueUOM::NONE); diff --git a/src/devices/thermostat.h b/src/devices/thermostat.h index bc1d3483a..b94c517c2 100644 --- a/src/devices/thermostat.h +++ b/src/devices/thermostat.h @@ -161,6 +161,7 @@ class Thermostat : public EMSdevice { // each thermostat has a list of heating controller type IDs for reading and writing std::vector monitor_typeids; std::vector set_typeids; + std::vector set2_typeids; std::vector timer_typeids; std::vector timer2_typeids; std::vector summer_typeids; @@ -358,6 +359,7 @@ class Thermostat : public EMSdevice { void process_CRFMonitor(std::shared_ptr telegram); void process_RC300Monitor(std::shared_ptr telegram); void process_RC300Set(std::shared_ptr telegram); + void process_RC300Set2(std::shared_ptr telegram); void process_RC300Summer(std::shared_ptr telegram); void process_RC300Summer2(std::shared_ptr telegram); void process_RC300WWmode(std::shared_ptr telegram); diff --git a/src/emsesp.cpp b/src/emsesp.cpp index 17dc3e889..56ef42c4a 100644 --- a/src/emsesp.cpp +++ b/src/emsesp.cpp @@ -183,9 +183,11 @@ uint8_t EMSESP::check_master_device(const uint8_t device_id, const uint16_t type uint16_t curve_ids[] = {0x029B, 0x029C, 0x029D, 0x029E, 0x029F, 0x02A0, 0x02A1, 0x02A2}; uint16_t summer2_ids[] = {0x0471, 0x0472, 0x0473, 0x0474, 0x0475, 0x0476, 0x0477, 0x0478}; uint16_t master_ids[] = {0x02F5, 0x031B, 0x031D, 0x031E, 0x023A, 0x0267, 0x0240}; + uint16_t set2_ids[] = {0x02CC, 0x02CE, 0x02D0, 0x02D2}; // look for heating circuits for (uint8_t i = 0; i < sizeof(mon_ids) / 2; i++) { - if (type_id == mon_ids[i] || type_id == set_ids[i] || type_id == summer_ids[i] || type_id == curve_ids[i] || type_id == summer2_ids[i]) { + if (type_id == mon_ids[i] || type_id == set_ids[i] || type_id == summer_ids[i] + || type_id == curve_ids[i] || type_id == summer2_ids[i] || type_id == set2_ids[i]) { if (read) { // receiving telegrams and map all to master thermostat at 0x18 (src manipulated) return 0x18; From 107106d75943b2c8cf0f23e81b22381bf783d8fb Mon Sep 17 00:00:00 2001 From: tp1de Date: Fri, 27 May 2022 14:05:56 +0200 Subject: [PATCH 09/12] requested changes on PR from @MichaelDvP --- src/devices/thermostat.cpp | 4 +--- src/emsesp.cpp | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index 63ba0ed81..06253315e 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -379,7 +379,7 @@ std::shared_ptr Thermostat::heating_circuit(std::sha if (set_typeids.size()) { toggle_fetch(set_typeids[hc_num - 1], toggle_); } - if (set2_typeids.size()) { + if (hc_num <= set2_typeids.size()) { toggle_fetch(set2_typeids[hc_num - 1], toggle_); } if (summer_typeids.size()) { @@ -2971,13 +2971,11 @@ bool Thermostat::set_temperature(const float temperature, const uint8_t mode, co factor = 1; break; case HeatingCircuit::Mode::NOREDUCE: - set_typeid = set_typeids[hc->hc()]; validate_typeid = set_typeid; offset = 12; factor = 1; break; case HeatingCircuit::Mode::REDUCE: - set_typeid = set_typeids[hc->hc()]; validate_typeid = set_typeid; offset = 9; factor = 1; diff --git a/src/emsesp.cpp b/src/emsesp.cpp index 56ef42c4a..84fd59029 100644 --- a/src/emsesp.cpp +++ b/src/emsesp.cpp @@ -187,7 +187,7 @@ uint8_t EMSESP::check_master_device(const uint8_t device_id, const uint16_t type // look for heating circuits for (uint8_t i = 0; i < sizeof(mon_ids) / 2; i++) { if (type_id == mon_ids[i] || type_id == set_ids[i] || type_id == summer_ids[i] - || type_id == curve_ids[i] || type_id == summer2_ids[i] || type_id == set2_ids[i]) { + || type_id == curve_ids[i] || type_id == summer2_ids[i] || (i <4 && type_id == set2_ids[i])) { if (read) { // receiving telegrams and map all to master thermostat at 0x18 (src manipulated) return 0x18; From 10bf065a2a606241cdeefcf6c2506d5cc8b2405c Mon Sep 17 00:00:00 2001 From: tp1de Date: Fri, 27 May 2022 16:00:18 +0200 Subject: [PATCH 10/12] Add damping to RC310 --- src/devices/thermostat.cpp | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index 06253315e..ada2f557f 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -1082,6 +1082,7 @@ void Thermostat::process_RC300OutdoorTemp(std::shared_ptr telegr // 0x240 RC300 parameter void Thermostat::process_RC300Settings(std::shared_ptr telegram) { + has_update(telegram, ibaDamping_, 8); has_enumupdate(telegram, ibaBuildingType_, 9, 1); // 1=light, 2=medium, 3=heavy has_update(telegram, ibaMinExtTemperature_, 10); } @@ -1671,14 +1672,20 @@ bool Thermostat::set_heatingpid(const char * value, const int8_t id) { return true; } -// 0xA5 - Set the damping settings +// 0xA5 and 0x0240- Set the damping settings bool Thermostat::set_damping(const char * value, const int8_t id) { bool dmp; - if (Helpers::value2bool(value, dmp)) { - write_command(EMS_TYPE_IBASettings, 21, dmp ? 0xFF : 0, EMS_TYPE_IBASettings); - return true; + if (model() == EMS_DEVICE_FLAG_RC300) { + if (Helpers::value2bool(value, dmp)) { + write_command(0x240, 8, dmp ? 0xFF : 0, 0x240); + return true; + } + } else { + if (Helpers::value2bool(value, dmp)) { + write_command(EMS_TYPE_IBASettings, 21, dmp ? 0xFF : 0, EMS_TYPE_IBASettings); + return true; + } } - return false; } @@ -3348,6 +3355,13 @@ void Thermostat::register_device_values() { FL_(ibaMinExtTemperature), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_minexttemp)); + register_device_value(DeviceValueTAG::TAG_THERMOSTAT_DATA, + &ibaDamping_, + DeviceValueType::BOOL, + nullptr, + FL_(damping), + DeviceValueUOM::NONE, + MAKE_CF_CB(set_damping)); register_device_value( DeviceValueTAG::TAG_DEVICE_DATA_WW, &wwSetTemp_, DeviceValueType::UINT, nullptr, FL_(wwSetTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_wwtemp)); register_device_value( From 97239268ac5b4004cedcb91a9432a613acba8ff2 Mon Sep 17 00:00:00 2001 From: tp1de Date: Fri, 27 May 2022 16:07:34 +0200 Subject: [PATCH 11/12] damping --- CHANGELOG_LATEST.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index e1ae6a508..3a229dcb0 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -4,6 +4,7 @@ ### Added +- Added damping for RC310 - Added wwprio for RC310 heating circuits - Added switchonoptimization for RC310 heating circuits - Added enum_controlmode for RC310 (new enum list) From ab6893adeb9fa2683353c889241830be9ce456ab Mon Sep 17 00:00:00 2001 From: tp1de Date: Sat, 28 May 2022 13:16:40 +0200 Subject: [PATCH 12/12] corrections nofrostmode --- src/devices/thermostat.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index ada2f557f..3a6b956d8 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -2489,7 +2489,7 @@ bool Thermostat::set_vacreducemode(const char * value, const int8_t id) { return true; } -// sets the thermostat nofrost mode for RC35 +// sets the thermostat nofrost mode for RC35, RC300/RC310 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); @@ -2498,12 +2498,12 @@ bool Thermostat::set_nofrostmode(const char * value, const int8_t id) { } uint8_t set = 0xFF; if (model() == EMS_DEVICE_FLAG_RC300) { - if (Helpers::value2enum(value, set, FL_(enum_controlmode1))) { + if (Helpers::value2enum(value, set, FL_(enum_nofrostmode1))) { write_command(curve_typeids[hc->hc()], 5, set + 1, curve_typeids[hc->hc()]); return true; } } else { - if (Helpers::value2enum(value, set, FL_(enum_controlmode))) { + if (Helpers::value2enum(value, set, FL_(enum_nofrostmode))) { write_command(set_typeids[hc->hc()], EMS_OFFSET_RC35Set_nofrostmode, set, set_typeids[hc->hc()]); return true; }