From df808a2bcffc2a6808c0eee189c4bc43259ce9e0 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Fri, 20 Mar 2026 14:53:07 +0100 Subject: [PATCH] dev.12, add dhw4 circuit, #2991 --- CHANGELOG_LATEST.md | 1 + src/devices/water.cpp | 35 +++++++++++++++++++++-------------- src/emsesp_version.h | 2 +- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index 7c69530ce..eceb2daf3 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -12,6 +12,7 @@ For more details go to [emsesp.org](https://emsesp.org/). - prometheus metrics for temperature/analog/scheduler/custom [#2962](https://github.com/emsesp/EMS-ESP32/issues/2962) - boiler pumpkick [#2965](https://github.com/emsesp/EMS-ESP32/discussions/2965) - heatpump reset [#2933](https://github.com/emsesp/EMS-ESP32/issues/2933) +- 2.nd freshwater module (dhw4) [#2991](https://github.com/emsesp/EMS-ESP32/issues/2991) ## Fixed diff --git a/src/devices/water.cpp b/src/devices/water.cpp index 94a8c9cf2..d535504ac 100644 --- a/src/devices/water.cpp +++ b/src/devices/water.cpp @@ -30,15 +30,23 @@ Water::Water(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c int8_t tag = DeviceValueTAG::TAG_DHW1 + dhw_; if (flags == EMSdevice::EMS_DEVICE_FLAG_SM100) { // device_id 0x2A, DHW3 // telegram handlers - register_telegram_type(0x07D6, "SM100wwTemperature", false, MAKE_PF_CB(process_SM100wwTemperature)); - register_telegram_type(0x07AA, "SM100wwStatus", false, MAKE_PF_CB(process_SM100wwStatus)); - register_telegram_type(0x07AB, "SM100wwCommand", false, MAKE_PF_CB(process_SM100wwCommand)); - register_telegram_type(0x07AC, "SM100wwParam1", false, MAKE_PF_CB(process_SM100wwParam2)); - register_telegram_type(0x07A5, "SM100wwCirc", true, MAKE_PF_CB(process_SM100wwCirc)); - register_telegram_type(0x07A6, "SM100wwParam", true, MAKE_PF_CB(process_SM100wwParam)); - register_telegram_type(0x07AE, "SM100wwKeepWarm", true, MAKE_PF_CB(process_SM100wwKeepWarm)); - register_telegram_type(0x07E0, "SM100wwStatus2", true, MAKE_PF_CB(process_SM100wwStatus2)); - register_telegram_type(0x07AD, "SM100ValveStatus", false, MAKE_PF_CB(process_SM100ValveStatus)); + if (tag == DeviceValueTAG::TAG_DHW3) { + register_telegram_type(0x07AA, "SM100wwStatus", false, MAKE_PF_CB(process_SM100wwStatus)); + register_telegram_type(0x07AC, "SM100wwParam1", false, MAKE_PF_CB(process_SM100wwParam2)); + register_telegram_type(0x07A5, "SM100wwCirc", true, MAKE_PF_CB(process_SM100wwCirc)); + register_telegram_type(0x07A6, "SM100wwParam", true, MAKE_PF_CB(process_SM100wwParam)); + register_telegram_type(0x07AE, "SM100wwKeepWarm", true, MAKE_PF_CB(process_SM100wwKeepWarm)); + register_telegram_type(0x07AD, "SM100ValveStatus", false, MAKE_PF_CB(process_SM100ValveStatus)); + register_telegram_type(0x07AB, "SM100wwCommand", false, MAKE_PF_CB(process_SM100wwCommand)); + register_telegram_type(0x07D6, "SM100wwTemperature", false, MAKE_PF_CB(process_SM100wwTemperature)); + register_telegram_type(0x07E0, "SM100wwStatus2", true, MAKE_PF_CB(process_SM100wwStatus2)); + // 0x07C3 + } else if (tag == DeviceValueTAG::TAG_DHW4) { + register_telegram_type(0x07A6, "SM100wwParam", true, MAKE_PF_CB(process_SM100wwParam)); + register_telegram_type(0x07D7, "SM100wwTemperature", false, MAKE_PF_CB(process_SM100wwTemperature)); + register_telegram_type(0x07E1, "SM100wwStatus2", true, MAKE_PF_CB(process_SM100wwStatus2)); + register_telegram_type(0x07C3, "SM100wwCommand", false, MAKE_PF_CB(process_SM100wwCommand)); + } // device values... register_device_value(tag, &wwTemp_, DeviceValueType::UINT16, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(wwTemp), DeviceValueUOM::DEGREES); register_device_value(tag, &wwTemp2_, DeviceValueType::UINT16, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(wwStorageTemp1), DeviceValueUOM::DEGREES); @@ -100,7 +108,7 @@ Water::Water(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c } } -// SM100wwTemperature - 0x07D6 +// SM100wwTemperature - 0x07D6, dhw4: 0x07D7 // Solar Module(0x2A) -> (0x00), (0x7D6), data: 01 C1 00 00 02 5B 01 AF 01 AD 80 00 01 90 void Water::process_SM100wwTemperature(std::shared_ptr telegram) { has_update(telegram, wwTemp_, 0); // is *10 TS17 @@ -156,12 +164,10 @@ void Water::process_SM100ValveStatus(std::shared_ptr telegram) { has_update(telegram, wwRetValve_, 1); } -/* -// SM100ww? - 0x7E0, some kind of status +// SM100ww? - 0x7E0, some kind of status, dhw4: 0x7E1 // data: 00 00 46 00 00 01 06 0E 06 0E 00 00 00 00 00 03 03 03 03 // publishes single values offset 1/2(16bit), offset 5, offset 6, offset 7, offset 8, offset 9, // status2 = 03:"no heat", 06:"heat request", 08:"disinfecting", 09:"hold" -*/ void Water::process_SM100wwStatus2(std::shared_ptr telegram) { // has_update(telegram, wwFlow_, 7); // single byte, wrong see #1387 has_update(telegram, wwStatus2_, 8); @@ -170,6 +176,7 @@ void Water::process_SM100wwStatus2(std::shared_ptr telegram) { // SM100wwCommand - 0x07AB // Thermostat(0x10) -> Solar Module(0x2A), (0x7AB), data: 01 00 01 +// or dhw3 module (0x2A) -> dhw4 module(0x2B), (0x7C3), data: 01 01 00 void Water::process_SM100wwCommand(std::shared_ptr telegram) { // not implemented yet } @@ -268,7 +275,7 @@ bool Water::set_wwMaxTemp(const char * value, const int8_t id) { } else if (flags() == EMSdevice::EMS_DEVICE_FLAG_MMPLUS) { write_command(0x313 + dhw_, 10, (uint8_t)temperature, 0x313 + dhw_); } else { // SM100 - write_command(0x7A6, 8, (uint8_t)temperature, 0x7A6); + write_command(0x7A6, 8, (uint8_t)temperature, 0x7A6); } return true; } diff --git a/src/emsesp_version.h b/src/emsesp_version.h index d13dd7e33..5077987b7 100644 --- a/src/emsesp_version.h +++ b/src/emsesp_version.h @@ -1 +1 @@ -#define EMSESP_APP_VERSION "3.8.2-dev.11" +#define EMSESP_APP_VERSION "3.8.2-dev.12"