diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index 36502665c..71cf0483e 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -124,11 +124,13 @@ Thermostat::Thermostat(uint8_t device_type, uint8_t device_id, uint8_t product_i set_typeids = {0x02B9, 0x02BA, 0x02BB, 0x02BC}; summer_typeids = {0x02AF, 0x02B0, 0x02B1, 0x02B2}; curve_typeids = {0x029B, 0x029C, 0x029D, 0x029E}; + summer2_typeids = {0x0471, 0x0472, 0x0473, 0x0474}; for (uint8_t i = 0; i < monitor_typeids.size(); i++) { register_telegram_type(monitor_typeids[i], F("RC300Monitor"), false, MAKE_PF_CB(process_RC300Monitor)); register_telegram_type(set_typeids[i], F("RC300Set"), false, MAKE_PF_CB(process_RC300Set)); register_telegram_type(summer_typeids[i], F("RC300Summer"), false, MAKE_PF_CB(process_RC300Summer)); register_telegram_type(curve_typeids[i], F("RC300Curves"), false, MAKE_PF_CB(process_RC300Curve)); + register_telegram_type(summer2_typeids[i], F("RC300Summer2"), true, MAKE_PF_CB(process_RC300Summer2)); } register_telegram_type(0x2F5, F("RC300WWmode"), true, MAKE_PF_CB(process_RC300WWmode)); register_telegram_type(0x31B, F("RC300WWtemp"), true, MAKE_PF_CB(process_RC300WWtemp)); @@ -281,6 +283,16 @@ std::shared_ptr Thermostat::heating_circuit(std::sha } } + // not found, search summer message types + if (hc_num == 0) { + for (uint8_t i = 0; i < summer2_typeids.size(); i++) { + if (summer2_typeids[i] == telegram->type_id) { + hc_num = i + 1; + break; + } + } + } + // not found, search heating_curve message types if (hc_num == 0) { for (uint8_t i = 0; i < curve_typeids.size(); i++) { @@ -879,8 +891,11 @@ void Thermostat::process_RC300Summer(std::shared_ptr telegram) { has_update(telegram->read_value(hc->roominfluence, 0)); has_update(telegram->read_value(hc->offsettemp, 2)); - has_update(telegram->read_value(hc->summertemp, 6)); - has_update(telegram->read_value(hc->summer_setmode, 7)); + // dont use these values if we have telegram 0x471 ff + if (!is_fetch(summer2_typeids[hc->hc_num() - 1])) { + has_update(telegram->read_value(hc->summertemp, 6)); + has_update(telegram->read_value(hc->summer_setmode, 7)); + } if (hc->heatingtype < 3) { has_update(telegram->read_value(hc->designtemp, 4)); @@ -892,6 +907,16 @@ void Thermostat::process_RC300Summer(std::shared_ptr telegram) { has_update(telegram->read_value(hc->fastHeatupFactor, 10)); } +// types 0x471 ff +void Thermostat::process_RC300Summer2(std::shared_ptr telegram) { + std::shared_ptr hc = heating_circuit(telegram); + if (hc == nullptr) { + return; + } + has_update(telegram->read_value(hc->summer_setmode, 0)); + has_update(telegram->read_value(hc->summertemp, 1)); +} + // types 0x29B ff void Thermostat::process_RC300Curve(std::shared_ptr telegram) { std::shared_ptr hc = heating_circuit(telegram); @@ -1822,7 +1847,11 @@ bool Thermostat::set_summermode(const char * value, const int8_t id) { return false; } LOG_INFO(F("Setting summer mode to %s for heating circuit %d"), value, hc->hc_num()); - write_command(summer_typeids[hc->hc_num() - 1], 7, set, summer_typeids[hc->hc_num() - 1]); + if (is_fetch(summer2_typeids[hc->hc_num() - 1])) { + write_command(summer2_typeids[hc->hc_num() - 1], 0, set, summer2_typeids[hc->hc_num() - 1]); + } else { + write_command(summer_typeids[hc->hc_num() - 1], 7, set, summer_typeids[hc->hc_num() - 1]); + } return true; } @@ -2021,8 +2050,13 @@ bool Thermostat::set_temperature(const float temperature, const uint8_t mode, co validate_typeid = set_typeids[hc->hc_num() - 1]; switch (mode) { case HeatingCircuit::Mode::SUMMER: - offset = 0x06; - set_typeid = summer_typeids[hc->hc_num() - 1]; + if (is_fetch(summer2_typeids[hc->hc_num() - 1])) { + offset = 0x01; + set_typeid = summer2_typeids[hc->hc_num() - 1]; + } else { + offset = 0x06; + set_typeid = summer_typeids[hc->hc_num() - 1]; + } validate_typeid = set_typeid; factor = 1; break; diff --git a/src/devices/thermostat.h b/src/devices/thermostat.h index a4ef9b8af..18f30ea46 100644 --- a/src/devices/thermostat.h +++ b/src/devices/thermostat.h @@ -139,6 +139,7 @@ class Thermostat : public EMSdevice { std::vector set_typeids; std::vector timer_typeids; std::vector summer_typeids; + std::vector summer2_typeids; std::vector curve_typeids; // standard for all thermostats @@ -294,6 +295,7 @@ class Thermostat : public EMSdevice { void process_RC300Monitor(std::shared_ptr telegram); void process_RC300Set(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); void process_RC300WWmode2(std::shared_ptr telegram); void process_RC300WWtemp(std::shared_ptr telegram);