From ca5d631dfc6d83edadce73e73f73d10820fd0ca1 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Thu, 21 Nov 2024 08:56:01 +0100 Subject: [PATCH] csv and modbus water devices #2229 --- CHANGELOG_LATEST.md | 1 + src/device_library.h | 12 ++++++++++++ src/emsesp.cpp | 34 ++++++++++++++-------------------- 3 files changed, 27 insertions(+), 20 deletions(-) diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index c5feb0dd1..899fb95c1 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -26,6 +26,7 @@ For more details go to [docs.emsesp.org](https://docs.emsesp.org/). - heatpump cost UOMs [#2188](https://github.com/emsesp/EMS-ESP32/issues/2188) - analog dac output and inputs on dac pins [#2201](https://github.com/emsesp/EMS-ESP32/discussions/2201) - api memory leak [#2216](https://github.com/emsesp/EMS-ESP32/issues/2216) +- modbus multiple mixers [#2229](https://github.com/emsesp/EMS-ESP32/issues/2229) ## Changed diff --git a/src/device_library.h b/src/device_library.h index d8e80475f..1c22b9091 100644 --- a/src/device_library.h +++ b/src/device_library.h @@ -187,4 +187,16 @@ // Generic - 0x40 or other with no product-id and no version {0, DeviceType::GENERIC, "unknown", DeviceFlags::EMS_DEVICE_FLAG_NONE} +#if defined(EMSESP_STANDALONE) +, +{100, DeviceType::WATER, "IPM", DeviceFlags::EMS_DEVICE_FLAG_IPM}, +{102, DeviceType::WATER, "IPM", DeviceFlags::EMS_DEVICE_FLAG_IPM}, +{160, DeviceType::WATER, "MM100", DeviceFlags::EMS_DEVICE_FLAG_MMPLUS}, +{161, DeviceType::WATER, "MM200", DeviceFlags::EMS_DEVICE_FLAG_MMPLUS}, +{163, DeviceType::WATER, "SM100, MS100", DeviceFlags::EMS_DEVICE_FLAG_SM100}, +{164, DeviceType::WATER, "SM200, MS200", DeviceFlags::EMS_DEVICE_FLAG_SM100}, +{248, DeviceType::MIXER, "HM210", DeviceFlags::EMS_DEVICE_FLAG_MMPLUS}, +{157, DeviceType::THERMOSTAT, "RC120", DeviceFlags::EMS_DEVICE_FLAG_CR120} +#endif + // clang-format on diff --git a/src/emsesp.cpp b/src/emsesp.cpp index f185463a6..11f6a2829 100644 --- a/src/emsesp.cpp +++ b/src/emsesp.cpp @@ -343,17 +343,14 @@ void EMSESP::dump_all_entities(uuid::console::Shell & shell) { for (const auto & device : device_library_) { if (device_class.first == device.device_type) { uint8_t device_id = 0; - // Mixer class looks at device_id to determine type and the tag - // so fixing to 0x28 which will give all the settings except flowSetTemp - if (device.device_type == DeviceType::MIXER) { + // Water class looks at device_id to determine type and the tag + if (device.device_type == DeviceType::WATER) { if (device.flags == EMSdevice::EMS_DEVICE_FLAG_MMPLUS) { - if (device.product_id == 160) { // MM100 - device_id = 0x28; // dhw - } else { - device_id = 0x20; // hc - } - } else { - device_id = 0x20; // should cover all the other device types + device_id = 0x28; // dhw 1/2 + } else if (device.flags == EMSdevice::EMS_DEVICE_FLAG_SM100) { + device_id = 0x2A; // dhw 3 + } else if (device.flags == EMSdevice::EMS_DEVICE_FLAG_IPM) { + device_id = 0x40; // dhw 1 } } @@ -385,17 +382,14 @@ void EMSESP::dump_all_telegrams(uuid::console::Shell & shell) { for (const auto & device : device_library_) { if (device_class.first == device.device_type) { uint8_t device_id = 0; - // Mixer class looks at device_id to determine type and the tag - // so fixing to 0x28 which will give all the settings except flowSetTemp - if (device.device_type == DeviceType::MIXER) { + // Water class looks at device_id to determine type and the tag + if (device.device_type == DeviceType::WATER) { if (device.flags == EMSdevice::EMS_DEVICE_FLAG_MMPLUS) { - if (device.product_id == 160) { // MM100 - device_id = 0x28; // dhw - } else { - device_id = 0x20; // hc - } - } else { - device_id = 0x20; // should cover all the other device types + device_id = 0x28; // dhw 1/2 + } else if (device.flags == EMSdevice::EMS_DEVICE_FLAG_SM100) { + device_id = 0x2A; // dhw 3 + } else if (device.flags == EMSdevice::EMS_DEVICE_FLAG_IPM) { + device_id = 0x40; // dhw 1 } }