From a5113eb90d8adc8a716c5534bf8302e2d0572b84 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Wed, 10 May 2023 18:47:39 +0200 Subject: [PATCH] add HIU --- src/device_library.h | 2 +- src/devices/boiler.cpp | 53 ++++++++++++++++++++++++++++++++++++++++++ src/devices/boiler.h | 12 ++++++++++ src/emsdevice.h | 1 + 4 files changed, 67 insertions(+), 1 deletion(-) diff --git a/src/device_library.h b/src/device_library.h index 58ee81ee8..a0fc49739 100644 --- a/src/device_library.h +++ b/src/device_library.h @@ -48,7 +48,7 @@ {208, DeviceType::BOILER, "Logamax Plus/GB192/Condens GC9000/Greenstar ErP", DeviceFlags::EMS_DEVICE_FLAG_NONE}, {210, DeviceType::BOILER, "Cascade MC400", DeviceFlags::EMS_DEVICE_FLAG_NONE}, {211, DeviceType::BOILER, "EasyControl Adapter", DeviceFlags::EMS_DEVICE_FLAG_NONE}, -{219, DeviceType::BOILER, "Greenstar HIU", DeviceFlags::EMS_DEVICE_FLAG_NONE}, +{219, DeviceType::BOILER, "Greenstar HIU", DeviceFlags::EMS_DEVICE_FLAG_HIU}, {234, DeviceType::BOILER, "Logamax Plus GB122/Condense 2300", DeviceFlags::EMS_DEVICE_FLAG_NONE}, // Controllers - 0x09 / 0x10 / 0x50 diff --git a/src/devices/boiler.cpp b/src/devices/boiler.cpp index ab4f0eb2c..e6d92501d 100644 --- a/src/devices/boiler.cpp +++ b/src/devices/boiler.cpp @@ -86,6 +86,26 @@ 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)); } + if (model() == EMSdevice::EMS_DEVICE_FLAG_HIU) { + register_telegram_type(0x772, "HIUSettings", false, MAKE_PF_CB(process_HIUSettings)); + register_telegram_type(0x779, "HIUMonitor", false, MAKE_PF_CB(process_HIUMonitor)); + + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, + &keepWarmTemp_, + DeviceValueType::UINT, + FL_(keepWarmTemp), + DeviceValueUOM::DEGREES, + MAKE_CF_CB(set_keepWarmTemp)); + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, + &setReturnTemp_, + DeviceValueType::UINT, + FL_(setReturnTemp), + DeviceValueUOM::DEGREES, + MAKE_CF_CB(set_returnTemp)); + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &cwFlowRate_, DeviceValueType::USHORT, FL_(cwFlowRate), DeviceValueUOM::LMIN); + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &netFlowTemp_, DeviceValueType::USHORT, FL_(netFlowTemp), DeviceValueUOM::DEGREES); + } + /* * Hybrid heatpump with telegram 0xBB is readable and writeable in boiler and thermostat * thermostat always overwrites settings in boiler @@ -1570,6 +1590,39 @@ void Boiler::process_HpSettings3(std::shared_ptr telegram) { has_update(telegram, elHeatStep3_, 9); } +// HIU unit + +// boiler(0x08) -B-> All(0x00), ?(0x0779), data: 06 05 01 01 AD 02 EF FF FF 00 00 7F FF +void Boiler::process_HIUMonitor(std::shared_ptr telegram) { + has_update(telegram, netFlowTemp_, 5); // is * 10 + has_update(telegram, cwFlowRate_, 9); // is * 10 +} + +// Boiler(0x08) -W-> ME(0x0x), ?(0x0772), data: 00 00 00 00 00 +void Boiler::process_HIUSettings(std::shared_ptr telegram) { + has_update(telegram, keepWarmTemp_, 1); + has_update(telegram, setReturnTemp_, 2); +} + +// HIU Settings +bool Boiler::set_keepWarmTemp(const char * value, const int8_t id) { + int v; + if (!Helpers::value2temperature(value, v)) { + return false; + } + write_command(0x772, 1, v, 0x772); + return true; +} + +bool Boiler::set_returnTemp(const char * value, const int8_t id) { + int v; + if (!Helpers::value2temperature(value, v)) { + return false; + } + write_command(0x772, 2, v, 0x772); + return true; +} + /* * Hybrid heatpump with telegram 0xBB is readable and writeable in boiler and thermostat * thermostat always overwrites settings in boiler diff --git a/src/devices/boiler.h b/src/devices/boiler.h index 18e0f6b06..264d00d39 100644 --- a/src/devices/boiler.h +++ b/src/devices/boiler.h @@ -252,6 +252,12 @@ class Boiler : public EMSdevice { uint8_t elHeatStep2_; uint8_t elHeatStep3_; + // HIU + uint16_t cwFlowRate_; // cold water flow rate *10 + uint16_t netFlowTemp_; // heat network flow temperature *10 + uint8_t keepWarmTemp_; + uint8_t setReturnTemp_; + /* // Hybrid heatpump with telegram 0xBB is readable and writeable in boiler and thermostat // thermostat always overwrites settings in boiler @@ -306,6 +312,12 @@ class Boiler : public EMSdevice { void process_HpDhwSettings(std::shared_ptr telegram); void process_HpSettings2(std::shared_ptr telegram); void process_HpSettings3(std::shared_ptr telegram); + // HIU + void process_HIUSettings(std::shared_ptr telegram); + void process_HIUMonitor(std::shared_ptr telegram); + + bool set_keepWarmTemp(const char * value, const int8_t id); + bool set_returnTemp(const char * value, const int8_t id); // commands - none of these use the additional id parameter bool set_ww_mode(const char * value, const int8_t id); diff --git a/src/emsdevice.h b/src/emsdevice.h index 20d5e307d..00ab27f1c 100644 --- a/src/emsdevice.h +++ b/src/emsdevice.h @@ -381,6 +381,7 @@ class EMSdevice { static constexpr uint8_t EMS_DEVICE_FLAG_HT3 = 3; static constexpr uint8_t EMS_DEVICE_FLAG_HEATPUMP = 4; static constexpr uint8_t EMS_DEVICE_FLAG_HYBRID = 5; + static constexpr uint8_t EMS_DEVICE_FLAG_HIU = 6; // Solar Module static constexpr uint8_t EMS_DEVICE_FLAG_SM10 = 1;