From 4db1c7dfca245f7b597edb140cf7300d5fbe97b0 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Tue, 21 Nov 2023 11:25:25 +0100 Subject: [PATCH] add boostmode/time #1446 --- src/devices/thermostat.cpp | 31 +++++++++++++++++++++++++++++++ src/devices/thermostat.h | 4 ++++ src/locale_translations.h | 2 ++ 3 files changed, 37 insertions(+) diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index 7faac02e2..769abe751 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -1050,6 +1050,8 @@ void Thermostat::process_RC300Set(std::shared_ptr telegram) { has_update(telegram, hc->reducetemp, 9); has_update(telegram, hc->noreducetemp, 12); has_update(telegram, hc->remoteseltemp, 17); // see https://github.com/emsesp/EMS-ESP32/issues/590 + has_update(telegram, hc->boost, 23); + has_update(telegram, hc->boosttime, 24); has_update(telegram, hc->cooling, 28); } @@ -2668,7 +2670,34 @@ bool Thermostat::set_switchonoptimization(const char * value, const int8_t id) { write_command(curve_typeids[hc->hc()], 4, b ? 0xFF : 0x00, curve_typeids[hc->hc()]); return true; } +bool Thermostat::set_boost(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; + if (!Helpers::value2bool(value, b)) { + return false; + } + write_command(set_typeids[hc->hc()], 23, b ? 0xFF : 0x00, set_typeids[hc->hc()]); + return true; +} +bool Thermostat::set_boosttime(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; + } + int v; + if (!Helpers::value2number(value, v)) { + return false; + } + write_command(set_typeids[hc->hc()], 24, (uint8_t)v, set_typeids[hc->hc()]); + return true; + +} // sets the thermostat reducemode for RC35 and RC310 bool Thermostat::set_reducemode(const char * value, const int8_t id) { @@ -4270,6 +4299,8 @@ void Thermostat::register_device_values_hc(std::shared_ptrremotehum, DeviceValueType::UINT, FL_(remotehum), DeviceValueUOM::PERCENT, MAKE_CF_CB(set_remotehum), -1, 101); + register_device_value(tag, &hc->boost, DeviceValueType::BOOL, FL_(boost), DeviceValueUOM::NONE, MAKE_CF_CB(set_boost)); + register_device_value(tag, &hc->boosttime, DeviceValueType::UINT, FL_(boosttime), DeviceValueUOM::HOURS, MAKE_CF_CB(set_boosttime)); break; case EMS_DEVICE_FLAG_CRF: diff --git a/src/devices/thermostat.h b/src/devices/thermostat.h index 3ad8bec68..27c694936 100644 --- a/src/devices/thermostat.h +++ b/src/devices/thermostat.h @@ -98,6 +98,8 @@ class Thermostat : public EMSdevice { uint8_t hpmode; uint8_t cooling; uint8_t coolingon; + uint8_t boost; + uint8_t boosttime; uint8_t hc_num() const { return hc_num_; @@ -439,6 +441,8 @@ class Thermostat : public EMSdevice { 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); + bool set_boost(const char * value, const int8_t id); + bool set_boosttime(const char * value, const int8_t id); inline bool set_temp(const char * value, const int8_t id) { return set_temperature_value(value, id, HeatingCircuit::Mode::AUTO); diff --git a/src/locale_translations.h b/src/locale_translations.h index 033effe57..75e3d3486 100644 --- a/src/locale_translations.h +++ b/src/locale_translations.h @@ -455,6 +455,8 @@ MAKE_TRANSLATION(wwAlternatingOper, "wwalternatingop", "alternating operation", MAKE_TRANSLATION(wwAltOpPrioHeat, "wwaltopprioheat", "prioritise heating during dhw", "Heizen bevorzugt vor WW", "Proriteit verwarming boven ww", "", "czas na ogrzewanie w trakcie c.w.u", "prioritert oppvarmning", "", "sıcak kullanım suyu esnasında ısıtmayı öne al", "dare la priorità al riscaldamento durante l'ACS") // TODO translate MAKE_TRANSLATION(wwAltOpPrioWw, "wwaltopprioww", "prioritise dhw during heating", "WW bevorzugt vor Heizen", "Prioriteit ww boven verwarming", "", "czas na c.w.u w trakcie ogrzewania", "prioritert varmtvann", "", "ısıtma esnasında sıcak kullanım suyunu öne al", "dare priorità all'acqua calda durante il riscaldamento") // TODO translate MAKE_TRANSLATION(hpEA0, "hpea0", "condensate reservoir heating (EA0)", "Heizung Kondensatwanne (EA0)", "", "", "", "", "", "", "") // TODO translate +MAKE_TRANSLATION(boost, "boost", "boost mode", "Boost", "", "", "", "", "", "", "") // TODO translate +MAKE_TRANSLATION(boosttime, "boosttime", "boost time", "Boost Dauer", "", "", "", "", "", "", "") // TODO translate // hybrid heatpump MAKE_TRANSLATION(hybridStrategy, "hybridstrategy", "hybrid control strategy", "Hybrid Strategie", "Hybride strategie", "Hybrid kontrollstrategi", "strategia sterowania hybrydowego", "hybrid kontrollstrategi", "stratégie contrôle hybride", "hibrit kontrol stratejisi", "strategia comtrollo ibrido")