From dced355a294d24a015a18a4d4bf5bb15c7b53d00 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Sun, 8 Jan 2023 14:12:53 +0100 Subject: [PATCH] Add silentmode from/to #896 --- src/devices/boiler.cpp | 34 ++++++++++++++++++++++++++++++++++ src/devices/boiler.h | 4 ++++ src/locale_translations.h | 2 ++ 3 files changed, 40 insertions(+) diff --git a/src/devices/boiler.cpp b/src/devices/boiler.cpp index 85b3a5148..eca15df9b 100644 --- a/src/devices/boiler.cpp +++ b/src/devices/boiler.cpp @@ -526,6 +526,20 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const FL_(silentMode), DeviceValueUOM::NONE, MAKE_CF_CB(set_silentMode)); + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, + &silentFrom_, + DeviceValueType::UINT, + DeviceValueNumOp::DV_NUMOP_MUL15, + FL_(silentFrom), + DeviceValueUOM::MINUTES, + MAKE_CF_CB(set_silentFrom)); + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, + &silentTo_, + DeviceValueType::UINT, + DeviceValueNumOp::DV_NUMOP_MUL15, + FL_(silentTo), + DeviceValueUOM::MINUTES, + MAKE_CF_CB(set_silentTo)); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &minTempSilent_, DeviceValueType::INT, @@ -1450,6 +1464,8 @@ void Boiler::process_HpSilentMode(std::shared_ptr telegram) { has_update(telegram, hpHystCool_, 35); // is / 5, maybe offset swapped with pool has_update(telegram, hpHystPool_, 33); // is / 5 has_update(telegram, hpCircPumpWw_, 46); + has_update(telegram, silentFrom_, 52); // in steps of 15 min + has_update(telegram, silentTo_, 53); // in steps of 15 min } // Boiler(0x08) -B-> All(0x00), ?(0x0488), data: 8E 00 00 00 00 00 01 03 @@ -2284,6 +2300,24 @@ bool Boiler::set_silentMode(const char * value, const int8_t id) { return true; } +bool Boiler::set_silentFrom(const char * value, const int8_t id) { + int v; + if (!Helpers::value2number(value, v)) { + return false; + } + write_command(0x484, 52, v / 15, 0x484); + return true; +} + +bool Boiler::set_silentTo(const char * value, const int8_t id) { + int v; + if (!Helpers::value2number(value, v)) { + return false; + } + write_command(0x484, 53, v / 15, 0x484); + return true; +} + bool Boiler::set_minTempSilent(const char * value, const int8_t id) { int v; if (Helpers::value2temperature(value, v)) { diff --git a/src/devices/boiler.h b/src/devices/boiler.h index 2ceccf52c..30d0b6bb7 100644 --- a/src/devices/boiler.h +++ b/src/devices/boiler.h @@ -222,6 +222,8 @@ class Boiler : public EMSdevice { uint16_t auxHeaterDelay_; uint8_t silentMode_; int8_t minTempSilent_; + uint8_t silentFrom_; + uint8_t silentTo_; int8_t tempParMode_; int8_t auxHeatMixValve_; uint16_t hpHystHeat_; @@ -370,6 +372,8 @@ class Boiler : public EMSdevice { } bool set_silentMode(const char * value, const int8_t id); bool set_minTempSilent(const char * value, const int8_t id); + bool set_silentFrom(const char * value, const int8_t id); + bool set_silentTo(const char * value, const int8_t id); bool set_additionalHeaterOnly(const char * value, const int8_t id); bool set_additionalHeater(const char * value, const int8_t id); bool set_additionalHeaterDelay(const char * value, const int8_t id); diff --git a/src/locale_translations.h b/src/locale_translations.h index 6d4ef260e..517bbaa3f 100644 --- a/src/locale_translations.h +++ b/src/locale_translations.h @@ -395,6 +395,8 @@ MAKE_PSTR_LIST(hpHystCool, "hphystcool", "on/off hyst cool", "Schalthysterese K MAKE_PSTR_LIST(hpHystPool, "hphystpool", "on/off hyst pool", "Schalthysterese Pool", "an/uit-hysteresis in zwembadbedri", "Hystereses Pool", "histereza wł./wył. podgrzewania basenu", "", "Hystérésis Marche en mode piscine") // TODO translate MAKE_PSTR_LIST(tempDiffHeat, "tempdiffheat", "temp. diff. TC3/TC0 heat", "Temp.diff. TC3/TC0 Heizen", "Temp.vers. TC3/TC0 verw", "Delta(T) TC3/TC0 Uppvärm.", "różnica temperatur TC3/TC0 w trakcie ogrzewania", "", "Delta T TC3/TC0 Chauff") // TODO translate MAKE_PSTR_LIST(tempDiffCool, "tempdiffcool", "temp. diff. TC3/TC0 cool", "Temp.diff. TC3/TC0 Kühlen", "Temp.vers. TC3/TC0 koel.", "Delta(T) TC3/TC0 Kyla", "różnica temperatur TC3/TC0 w trakcie chłodzenia", "", "Delta T TC3/TC0 Refroid.") // TODO translate +MAKE_PSTR_LIST(silentFrom, "silentfrom", "silent mode from", "Silentmodus Start") // TODO translate +MAKE_PSTR_LIST(silentTo, "silentto", "silent mode to", "Silentmodus Ende") // TODO translate MAKE_PSTR_LIST(wwComfOffTemp, "wwcomfoff", "comfort switch off", "Komfort Ausschalttemp", "Comfort Uitschakeltemp.", "Komfortläge avstängingstemp.", "temperatura wyłączania w trybie komfort", "", "Confort Temp. d'arrêt") // TODO translate MAKE_PSTR_LIST(wwEcoOffTemp, "wwecooff", "eco switch off", "ECO Ausschalttemp", "Eco Uitschakeltemp.", "Ekoläge avstängningstemp.", "temperatura wyłączania w trybie eko", "", "Eco Temp. d'arrêt") // TODO translate