From 3d8ec8e2950948c366f735bf89801bd747b7fa7e Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Wed, 12 Nov 2025 16:32:46 +0100 Subject: [PATCH] wwprio to mixer, boiler --- src/devices/boiler.cpp | 14 +++++++++++++- src/devices/boiler.h | 2 ++ src/devices/mixer.cpp | 16 ++++++++++++++-- src/devices/mixer.h | 2 ++ 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/src/devices/boiler.cpp b/src/devices/boiler.cpp index f5de7d3d9..ab985112f 100644 --- a/src/devices/boiler.cpp +++ b/src/devices/boiler.cpp @@ -67,6 +67,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const register_telegram_type(0xEA, "UBAParameterWWPlus", true, MAKE_PF_CB(process_UBAParameterWWPlus)); register_telegram_type(0x28, "WeatherComp", true, MAKE_PF_CB(process_WeatherComp)); register_telegram_type(0x2E0, "UBASetPoints", false, MAKE_PF_CB(process_UBASetPoints2)); + register_telegram_type(0x2CC, "HPPressure", true, MAKE_PF_CB(process_HpPressure)); } if (isHeatPump()) { @@ -89,7 +90,6 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const register_telegram_type(0x49D, "HPSettings3", true, MAKE_PF_CB(process_HpSettings3)); register_telegram_type(0x4AE, "HPEnergy", true, MAKE_PF_CB(process_HpEnergy)); register_telegram_type(0x4AF, "HPMeters", true, MAKE_PF_CB(process_HpMeters)); - register_telegram_type(0x2CC, "HPPressure", true, MAKE_PF_CB(process_HpPressure)); register_telegram_type(0x4A5, "HPFan", true, MAKE_PF_CB(process_HpFan)); register_telegram_type(0x4AA, "HPPower2", true, MAKE_PF_CB(process_HpPower2)); register_telegram_type(0x4A7, "HPPowerLimit", true, MAKE_PF_CB(process_HpPowerLimit)); @@ -1104,6 +1104,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const DeviceValueNumOp::DV_NUMOP_DIV10, FL_(wwCylMiddleTemp), DeviceValueUOM::DEGREES); + register_device_value(DeviceValueTAG::TAG_DHW1, &wwPrio_, DeviceValueType::BOOL, FL_(wwprio), DeviceValueUOM::NONE, MAKE_CF_CB(set_ww_prio)); register_device_value(DeviceValueTAG::TAG_DHW1, &wwStarts_, DeviceValueType::UINT24, FL_(wwStarts), DeviceValueUOM::NONE); register_device_value(DeviceValueTAG::TAG_DHW1, &wwWorkM_, DeviceValueType::TIME, FL_(wwWorkM), DeviceValueUOM::MINUTES); @@ -2225,6 +2226,7 @@ void Boiler::process_HpMeters(std::shared_ptr telegram) { } void Boiler::process_HpPressure(std::shared_ptr telegram) { + has_update(telegram, wwPrio_, 3); has_update(telegram, hpSetDiffPress_, 9); } @@ -2458,6 +2460,16 @@ bool Boiler::set_ww_disinfect_temp(const char * value, const int8_t id) { return true; } +// Set the dhw priority +bool Boiler::set_ww_prio(const char * value, const int8_t id) { + bool b; + if (!Helpers::value2bool(value, b)) { + return false; + } + write_command(0x2CC, 3, b ? 0xFF : 0, 0x2CC); + return true; +} + // flow temp bool Boiler::set_flow_temp(const char * value, const int8_t id) { int v; diff --git a/src/devices/boiler.h b/src/devices/boiler.h index 51b514aab..55a6b6a00 100644 --- a/src/devices/boiler.h +++ b/src/devices/boiler.h @@ -100,6 +100,7 @@ class Boiler : public EMSdevice { uint8_t wwAlternatingOper_; // alternating operation on/off uint8_t wwAltOpPrioHeat_; // alternating operation, prioritize heat time uint8_t wwAltOpPrioWw_; // alternating operation, prioritize dhw time + uint8_t wwPrio_; // special function uint8_t forceHeatingOff_; @@ -424,6 +425,7 @@ class Boiler : public EMSdevice { bool set_ww_maxtemp(const char * value, const int8_t id); bool set_ww_flowTempOffset(const char * value, const int8_t id); bool set_ww_chargeOptimization(const char * value, const int8_t id); + bool set_ww_prio(const char * value, const int8_t id); bool set_flow_temp(const char * value, const int8_t id); bool set_burn_power(const char * value, const int8_t id); bool set_heating_activated(const char * value, const int8_t id); diff --git a/src/devices/mixer.cpp b/src/devices/mixer.cpp index 3cc2fc00a..64309d0ec 100644 --- a/src/devices/mixer.cpp +++ b/src/devices/mixer.cpp @@ -31,7 +31,7 @@ Mixer::Mixer(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c if (flags == EMSdevice::EMS_DEVICE_FLAG_MMPLUS) { register_telegram_type(device_id - 0x20 + 0x02D7, "MMPLUSStatusMessage", false, MAKE_PF_CB(process_MMPLUSStatusMessage_HC)); // register_telegram_type(device_id - 0x20 + 0x02E1, "MMPLUSSetMessage", true, MAKE_PF_CB(process_MMPLUSSetMessage_HC)); - register_telegram_type(device_id - 0x20 + 0x02CD, "MMPLUSConfigMessage", true, MAKE_PF_CB(process_MMPLUSConfigMessage_HC)); + register_telegram_type(device_id - 0x20 + 0x02CD, "MMPLUSConfigMessage", false, MAKE_PF_CB(process_MMPLUSConfigMessage_HC)); register_device_value(tag, &flowTempHc_, DeviceValueType::UINT16, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(flowTempHc), DeviceValueUOM::DEGREES); register_device_value(tag, &status_, DeviceValueType::UINT8, FL_(mixerStatus), DeviceValueUOM::PERCENT); register_device_value(tag, &flowSetTemp_, DeviceValueType::UINT8, FL_(flowSetTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_flowSetTemp)); @@ -50,7 +50,8 @@ Mixer::Mixer(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c 10, 600); register_device_value(tag, &flowTempOffset_, DeviceValueType::UINT8, FL_(flowtempoffset), DeviceValueUOM::K, MAKE_CF_CB(set_flowTempOffset), 0, 20); - // EMSESP::send_read_request(device_id - 0x20 + 0x02CD, device_id, 0, 3); + register_device_value(tag, &wwprio_, DeviceValueType::BOOL, FL_(wwprio), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwprio)); + EMSESP::send_read_request(device_id - 0x20 + 0x02CD, device_id, 0, 3); } // EMS 1.0 @@ -157,6 +158,7 @@ void Mixer::process_MMPLUSConfigMessage_HC(std::shared_ptr teleg has_update(telegram, activated_, 0); // on = 0xFF has_update(telegram, setValveTime_, 1); // valve runtime in 10 sec, default 120 s, max 600 s has_update(telegram, flowTempOffset_, 2); // Mixer increase [0-20 K] + has_update(telegram, wwprio_, 3); has_update(telegram, pressure_, 9); } @@ -286,4 +288,14 @@ bool Mixer::set_pressure(const char * value, const int8_t id) { return true; } +bool Mixer::set_wwprio(const char * value, const int8_t id) { + bool b; + if (!Helpers::value2bool(value, b)) { + return false; + } + uint8_t hc = device_id() - 0x20; + write_command(0x2CD + hc, 3, b ? 0xFF: 0, 0x2CD + hc); + return true; +} + } // namespace emsesp diff --git a/src/devices/mixer.h b/src/devices/mixer.h index 2e4c3475a..6e33f113c 100644 --- a/src/devices/mixer.h +++ b/src/devices/mixer.h @@ -46,6 +46,7 @@ class Mixer : public EMSdevice { bool set_setValveTime(const char * value, const int8_t id); bool set_flowTempOffset(const char * value, const int8_t id); bool set_pressure(const char * value, const int8_t id); + bool set_wwprio(const char * value, const int8_t id); private: uint16_t flowTempHc_; @@ -58,6 +59,7 @@ class Mixer : public EMSdevice { uint8_t flowTempOffset_; uint16_t flowRate_; // l/h uint8_t pressure_; // setting 150-750mbar, scale 50 + uint8_t wwprio_; }; } // namespace emsesp