From 48ab1abf3997ad83a4fc5dfa8ce033de5d7422aa Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Mon, 28 Oct 2024 07:31:47 +0100 Subject: [PATCH] boiler (HP) power reduction #2147 --- src/devices/boiler.cpp | 27 +++++++++++++++++++++++---- src/devices/boiler.h | 3 ++- src/locale_translations.h | 1 + 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/devices/boiler.cpp b/src/devices/boiler.cpp index ee6de8b03..c25b32e05 100644 --- a/src/devices/boiler.cpp +++ b/src/devices/boiler.cpp @@ -555,6 +555,15 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const FL_(pvMaxComp), DeviceValueUOM::KW, MAKE_CF_CB(set_pvMaxComp)); + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, + &powerReduction_, + DeviceValueType::UINT8, + DeviceValueNumOp::DV_NUMOP_MUL10, + FL_(powerReduction), + DeviceValueUOM::PERCENT, + MAKE_CF_CB(set_powerReduction), + 30, + 60); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpSetDiffPress_, DeviceValueType::UINT8, @@ -1937,10 +1946,11 @@ void Boiler::process_HpSilentMode(std::shared_ptr telegram) { has_update(telegram, hpHystPool_, 33); // is / 5 has_update(telegram, hpCircPumpWw_, 46); has_update(telegram, hpMaxPower_, 31); - has_update(telegram, silentFrom_, 52); // in steps of 15 min - has_update(telegram, silentTo_, 53); // in steps of 15 min - has_update(telegram, pvMaxComp_, 54); // #2062 - has_update(telegram, hpshutdown_, 58); // 1 powers off + has_update(telegram, silentFrom_, 52); // in steps of 15 min + has_update(telegram, silentTo_, 53); // in steps of 15 min + has_update(telegram, pvMaxComp_, 54); // #2062 + has_update(telegram, hpshutdown_, 58); // 1 powers off + has_update(telegram, powerReduction_, 64); // 3..6 -> is *10 } // Boiler(0x08) -B-> All(0x00), ?(0x0488), data: 8E 00 00 00 00 00 01 03 @@ -3154,6 +3164,15 @@ bool Boiler::set_hpPowerLimit(const char * value, const int8_t id) { return false; } +bool Boiler::set_powerReduction(const char * value, const int8_t id) { + int v; + if (Helpers::value2number(value, v)) { + write_command(0x484, 64, v / 10, 0x484); + return true; + } + return false; +} + bool Boiler::set_vp_cooling(const char * value, const int8_t id) { bool v; if (Helpers::value2bool(value, v)) { diff --git a/src/devices/boiler.h b/src/devices/boiler.h index e9d56f3b0..7c4df0b1a 100644 --- a/src/devices/boiler.h +++ b/src/devices/boiler.h @@ -256,6 +256,7 @@ class Boiler : public EMSdevice { uint8_t maxHeatDhw_; uint8_t hpMaxPower_; uint8_t pvMaxComp_; + uint8_t powerReduction_; uint8_t pvCooling_; uint8_t manDefrost_; @@ -332,7 +333,6 @@ class Boiler : public EMSdevice { uint8_t delayBoiler_; // minutes uint8_t tempDiffBoiler_; // relative temperature degrees */ - void process_UBAFactory(std::shared_ptr telegram); void process_UBAParameterWW(std::shared_ptr telegram); void process_UBAMonitorFast(std::shared_ptr telegram); @@ -482,6 +482,7 @@ class Boiler : public EMSdevice { bool set_pvMaxComp(const char * value, const int8_t id); bool set_hpDiffPress(const char * value, const int8_t id); bool set_hpPowerLimit(const char * value, const int8_t id); + bool set_powerReduction(const char * value, const int8_t id); bool set_auxLimit(const char * value, const int8_t id); inline bool set_auxMaxLimit(const char * value, const int8_t id) { diff --git a/src/locale_translations.h b/src/locale_translations.h index c28ae0281..e0acb909a 100644 --- a/src/locale_translations.h +++ b/src/locale_translations.h @@ -576,6 +576,7 @@ MAKE_TRANSLATION(gasMeterHeat, "gasmeterheat", "gas meter heating", "Gaszähler MAKE_TRANSLATION(gasMeterWw, "gasmeter", "gas meter", "Gaszähler", "", "", "licznik gazu", "", "", "", "", "počítadlo plynu", "počítadlo plynu") // TODO translate MAKE_TRANSLATION(hpCurrPower, "hpcurrpower", "compressor current power", "akt. Kompressorleistung", "", "", "", "", "", "", "", "", "aktuální výkon kompresoru") // TODO translate MAKE_TRANSLATION(hpPowerLimit, "hppowerlimit", "power limit", "Leistungsgrenze", "", "", "", "", "", "", "", "", "omezení výkonu") // TODO translate +MAKE_TRANSLATION(powerReduction, "powerreduction", "power reduction", "Leistungsverringerung", "", "", "", "", "", "", "", "", "omezení výkonu") // TODO translate // HIU MAKE_TRANSLATION(netFlowTemp, "netflowtemp", "heat network flow temp", "Systemvorlauftemperatur", "Netto aanvoertemperatuur", "", "temp. zasilania sieci cieplnej", "", "", "ısıtma şebekesi akış derecesi", "temperatura di mandata della rete di riscaldamento", "teplota prívodu tepelnej siete", "teplota přívodu tepelné sítě") // TODO translate