From de9e261807d81b010e78c602e14cf4e203b6c919 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Tue, 13 Dec 2022 11:43:37 +0100 Subject: [PATCH] Test for #802 --- src/devices/boiler.cpp | 61 +++++++++++++++++++++++++++++++++++++++ src/devices/boiler.h | 9 ++++++ src/locale_translations.h | 4 +++ 3 files changed, 74 insertions(+) diff --git a/src/devices/boiler.cpp b/src/devices/boiler.cpp index c972eeaa9..04e07af86 100644 --- a/src/devices/boiler.cpp +++ b/src/devices/boiler.cpp @@ -181,6 +181,9 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const register_telegram_type(0x4A2, "HpInput", false, MAKE_PF_CB(process_HpInput)); register_telegram_type(0x486, "HpInConfig", false, MAKE_PF_CB(process_HpInConfig)); register_telegram_type(0x492, "HpHeaterConfig", false, MAKE_PF_CB(process_HpHeaterConfig)); + + register_telegram_type(0x484, "HPSilentMode", false, MAKE_PF_CB(process_HpSilentMode)); + register_telegram_type(0x491, "HPAdditionalHeater", false, MAKE_PF_CB(process_HpAdditionalHeater)); } /* @@ -558,6 +561,24 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const FL_(maxHeatDhw), DeviceValueUOM::NONE, MAKE_CF_CB(set_maxHeatDhw)); + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, + &auxHeaterOnly_, + DeviceValueType::BOOL, + FL_(auxHeaterOnly), + DeviceValueUOM::NONE, + MAKE_CF_CB(set_additionalHeaterOnly)); + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, + &addHeaterDelay_, + DeviceValueType::USHORT, + FL_(addHeaterDelay), + DeviceValueUOM::NONE, + MAKE_CF_CB(set_additionalHeaterDelay)); + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, + &minTempSilent_, + DeviceValueType::INT, + FL_(minTempSilent), + DeviceValueUOM::NONE, + MAKE_CF_CB(set_minTempSilent)); } // dhw - DEVICE_DATA_ww topic @@ -1453,6 +1474,18 @@ void Boiler::process_amExtraMessage(std::shared_ptr telegram) { #pragma GCC diagnostic pop +// Boiler(0x08) -> All(0x00), ?(0x0484), data: 00 00 14 28 0D 50 00 00 00 02 02 07 28 01 00 02 05 19 0A 0A 03 0D 07 00 0A +// Boiler(0x08) -> All(0x00), ?(0x0484), data: 01 90 00 F6 28 14 64 00 00 E1 00 1E 00 1E 01 64 01 64 54 20 00 00 (offset 25) +void Boiler::process_HpSilentMode(std::shared_ptr telegram) { + has_update(telegram, minTempSilent_, 11); +} + +// Boiler(0x08) -> All(0x00), ?(0x0491), data: 03 01 00 00 00 02 64 00 00 14 01 2C 00 0A 00 1E 00 1E 00 00 1E 0A 1E 05 05 +void Boiler::process_HpAdditionalHeater(std::shared_ptr telegram) { + has_update(telegram, auxHeaterOnly_, 1); + has_update(telegram, addHeaterDelay_, 10); +} + // Settings AM200 // pos 12: off(00)/Keelbypass(01)/(hc1pump(02) only standalone) @@ -2394,4 +2427,32 @@ bool Boiler::set_maxHeat(const char * value, const int8_t id) { return true; } +bool Boiler::set_minTempSilent(const char * value, const int8_t id) { + int v; + if (Helpers::value2temperature(value, v)) { + write_command(0x484, 11, v, 0x484); + return true; + } + return false; +} + +bool Boiler::set_additionalHeaterOnly(const char * value, const int8_t id) { + bool v; + if (Helpers::value2bool(value, v)) { + write_command(0x491, 1, v ? 1 : 0, 0x491); + return true; + } + return false; +} + +bool Boiler::set_additionalHeaterDelay(const char * value, const int8_t id) { + int v; + if (Helpers::value2number(value, v)) { + uint8_t data[2] = {(uint8_t)(v >> 8), (uint8_t)(v & 0xFF)}; + write_command(0x491, 10, data, 2, 0x491); + return true; + } + return false; +} + } // namespace emsesp diff --git a/src/devices/boiler.h b/src/devices/boiler.h index 4eec3c73e..89fd078f9 100644 --- a/src/devices/boiler.h +++ b/src/devices/boiler.h @@ -242,6 +242,10 @@ class Boiler : public EMSdevice { int8_t blockHyst_; // pos 14?: Hyst. for bolier block (K) uint8_t releaseWait_; // pos 15: Boiler release wait time (min) + uint8_t auxHeaterOnly_; + uint16_t addHeaterDelay_; + int8_t minTempSilent_; + /* // Hybrid heatpump with telegram 0xBB is readable and writeable in boiler and thermostat // thermostat always overwrites settings in boiler @@ -293,6 +297,8 @@ class Boiler : public EMSdevice { void process_amSettingMessage(std::shared_ptr telegram); void process_amCommandMessage(std::shared_ptr telegram); void process_amExtraMessage(std::shared_ptr telegram); + void process_HpSilentMode(std::shared_ptr telegram); + void process_HpAdditionalHeater(std::shared_ptr telegram); // commands - none of these use the additional id parameter bool set_ww_mode(const char * value, const int8_t id); @@ -378,6 +384,9 @@ class Boiler : public EMSdevice { inline bool set_maxHeatDhw(const char * value, const int8_t id) { return set_maxHeat(value, 4); } + bool set_minTempSilent(const char * value, const int8_t id); + bool set_additionalHeaterOnly(const char * value, const int8_t id); + bool set_additionalHeaterDelay(const char * value, const int8_t id); /* bool set_hybridStrategy(const char * value, const int8_t id); diff --git a/src/locale_translations.h b/src/locale_translations.h index ec1d0a6c7..6d25d0a56 100644 --- a/src/locale_translations.h +++ b/src/locale_translations.h @@ -367,6 +367,10 @@ MAKE_PSTR_LIST(maxHeatComp, "maxheatcomp", "heat limit compressor", "Heizgrenze MAKE_PSTR_LIST(maxHeatHeat, "maxheatheat", "heat limit heating", "Heizgrenze Heizen", "heat limit heating", "heat limit heating", "limit ciepła dla ogrzewania", "maks varmegrense oppvarming") MAKE_PSTR_LIST(maxHeatDhw, "maxheatdhw", "heat limit dhw", "Heizgrenze Warmwasser", "heat limit dhw", "heat limit dhw", "limit ciepła dla c.w.u.", "varmegrense varmtvann") +MAKE_PSTR_LIST(auxHeaterOnly, "auxheateronly", "auxilliary heater only", "nur Zusatzheizer") +MAKE_PSTR_LIST(addHeaterDelay, "addheaterdelay", "additional heater on delay", "Zusatzheizer Einschaltverzögerung") +MAKE_PSTR_LIST(minTempSilent, "mintempsilent", "min. outside temp. for silent mode", "Minimale Aussentemperatur Silentmodus") + // hybrid heatpump MAKE_PSTR_LIST(hybridStrategy, "hybridstrategy", "hybrid control strategy", "Hybrid Strategie", "Hybride strategie", "Hybrid kontrollstrategi", "strategia sterowania hybrydowego", "hybrid kontrollstrategi") MAKE_PSTR_LIST(switchOverTemp, "switchovertemp", "outside switchover temperature", "Außentemperatur für Umschaltung", "Schakeltemperatuur buitentemperatuur", "Utomhus Omställningstemperatur", "zewnętrzna temperatura przełączania", "utendørstemp styring")