From 0b9a2483b2b69c5c125031b2f124bb292e19e928 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Sun, 29 Oct 2023 11:42:28 +0100 Subject: [PATCH] add HIU entities #1334, fix hp nrgheat/ww offsets #1349 --- src/devices/boiler.cpp | 65 +++++++++++++++++++++++++++------------ src/devices/boiler.h | 6 ++-- src/devices/mixer.cpp | 2 +- src/locale_translations.h | 4 ++- 4 files changed, 53 insertions(+), 24 deletions(-) diff --git a/src/devices/boiler.cpp b/src/devices/boiler.cpp index 7eabdf572..f36bcf4b0 100644 --- a/src/devices/boiler.cpp +++ b/src/devices/boiler.cpp @@ -92,6 +92,26 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const 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, + &netFlowTemp_, + DeviceValueType::USHORT, + DeviceValueNumOp::DV_NUMOP_DIV10, + FL_(netFlowTemp), + DeviceValueUOM::DEGREES); + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, + &retTemp_, + DeviceValueType::USHORT, + DeviceValueNumOp::DV_NUMOP_DIV10, + FL_(retTemp), + DeviceValueUOM::DEGREES); + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &heatValve_, DeviceValueType::UINT, FL_(heatValve), DeviceValueUOM::PERCENT); + register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW, &wwValve_, DeviceValueType::UINT, FL_(wwValve), DeviceValueUOM::PERCENT); + register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW, + &wwCurFlow_, + DeviceValueType::UINT, + DeviceValueNumOp::DV_NUMOP_DIV10, + FL_(wwCurFlow), + DeviceValueUOM::LMIN); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &keepWarmTemp_, DeviceValueType::UINT, @@ -104,18 +124,6 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const FL_(setReturnTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_returnTemp)); - register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, - &cwFlowRate_, - DeviceValueType::USHORT, - DeviceValueNumOp::DV_NUMOP_DIV10, - FL_(cwFlowRate), - DeviceValueUOM::LMIN); - register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, - &netFlowTemp_, - DeviceValueType::USHORT, - DeviceValueNumOp::DV_NUMOP_DIV10, - FL_(netFlowTemp), - DeviceValueUOM::DEGREES); } /* @@ -215,7 +223,6 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const MAKE_CF_CB(set_burn_period), 0, 120); - register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &burnMinPower_, DeviceValueType::UINT, @@ -282,10 +289,6 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const MAKE_CF_CB(set_emergency_temp), 15, 70); - register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &nrgTotal_, DeviceValueType::ULONG, DeviceValueNumOp::DV_NUMOP_DIV100, FL_(nrgTotal), DeviceValueUOM::KWH); - register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW, &nrgWw_, DeviceValueType::ULONG, DeviceValueNumOp::DV_NUMOP_DIV100, FL_(nrgWw), DeviceValueUOM::KWH); - register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &nrgHeat_, DeviceValueType::ULONG, DeviceValueNumOp::DV_NUMOP_DIV100, FL_(nrgHeat), DeviceValueUOM::KWH); - /* * Hybrid heatpump with telegram 0xBB is readable and writeable in boiler and thermostat * thermostat always overwrites settings in boiler @@ -359,6 +362,19 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const // heatpump info if (model() == EMS_DEVICE_FLAG_HEATPUMP) { + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, + &nrgTotal_, + DeviceValueType::ULONG, + DeviceValueNumOp::DV_NUMOP_DIV100, + FL_(nrgTotal), + DeviceValueUOM::KWH); + register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW, &nrgWw_, DeviceValueType::ULONG, DeviceValueNumOp::DV_NUMOP_DIV100, FL_(nrgWw), DeviceValueUOM::KWH); + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, + &nrgHeat_, + DeviceValueType::ULONG, + DeviceValueNumOp::DV_NUMOP_DIV100, + FL_(nrgHeat), + DeviceValueUOM::KWH); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &meterTotal_, DeviceValueType::ULONG, @@ -911,6 +927,12 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const if (model() != EMS_DEVICE_FLAG_HEATPUMP) { register_telegram_type(0x04, "UBAFactory", true, MAKE_PF_CB(process_UBAFactory)); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &nomPower_, DeviceValueType::UINT, FL_(nomPower), DeviceValueUOM::KW, MAKE_CF_CB(set_nomPower)); + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, + &nrgTotal_, + DeviceValueType::ULONG, + DeviceValueNumOp::DV_NUMOP_DIV100, + FL_(nrgTotal), + DeviceValueUOM::KWH); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &nrgHeat_, DeviceValueType::ULONG, @@ -1808,8 +1830,8 @@ void Boiler::process_HpSettings3(std::shared_ptr telegram) { // boiler(0x08) -W-> Me(0x0B), ?(0x04AE), data: 00 00 00 00 00 00 00 00 (offset 24) void Boiler::process_HpEnergy(std::shared_ptr telegram) { has_update(telegram, nrgTotal_, 0); - has_update(telegram, nrgWw_, 4); - has_update(telegram, nrgHeat_, 12); + has_update(telegram, nrgHeat_, 4); + has_update(telegram, nrgWw_, 12); } // boiler(0x08) -W-> Me(0x0B), ?(0x04AF), data: 00 00 48 B2 00 00 48 55 00 00 00 5D 00 00 01 78 00 00 00 00 00 00 07 61 @@ -1825,8 +1847,11 @@ void Boiler::process_HpMeters(std::shared_ptr telegram) { // 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, retTemp_, 3); // is * 10 has_update(telegram, netFlowTemp_, 5); // is * 10 - has_update(telegram, cwFlowRate_, 9); // is * 10 + has_update(telegram, heatValve_, 7); // is % + has_update(telegram, wwValve_, 8); // is % + has_update(telegram, wwCurFlow_, 10); // is * 10 (for HIU 16 bit at offset 9, use 8 bit for compatibility to other boilers) } // Boiler(0x08) -W-> ME(0x0x), ?(0x0772), data: 00 00 00 00 00 diff --git a/src/devices/boiler.h b/src/devices/boiler.h index 280b45aad..5215e3f00 100644 --- a/src/devices/boiler.h +++ b/src/devices/boiler.h @@ -68,7 +68,7 @@ class Boiler : public EMSdevice { uint8_t wwCirc_; // DHW circulation on/off uint16_t wwCurTemp_; // DHW current temperature uint16_t wwCurTemp2_; // DHW current temperature storage - uint8_t wwCurFlow_; // DHW current flow temp in l/min + uint8_t wwCurFlow_; // DHW current flow in l/min uint16_t wwStorageTemp1_; // DHW storage temp 1 uint16_t wwStorageTemp2_; // DHW storage temp 2 uint8_t wwActivated_; // DHW activated @@ -267,10 +267,12 @@ class Boiler : public EMSdevice { uint8_t elHeatStep3_; // HIU - uint16_t cwFlowRate_; // cold water flow rate *10 + // uint16_t cwFlowRate_; // cold water flow rate *10 uint16_t netFlowTemp_; // heat network flow temperature *10 uint8_t keepWarmTemp_; uint8_t setReturnTemp_; + uint8_t heatValve_; + uint8_t wwValve_; // special double nrgHeatF_; // double calcutate for nrgHeat diff --git a/src/devices/mixer.cpp b/src/devices/mixer.cpp index 210b0d2f1..5f4a94fbe 100644 --- a/src/devices/mixer.cpp +++ b/src/devices/mixer.cpp @@ -44,7 +44,7 @@ Mixer::Mixer(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c if (flags == EMSdevice::EMS_DEVICE_FLAG_MMPLUS) { if (device_id >= 0x20 && device_id <= 0x27) { register_telegram_type(device_id - 0x20 + 0x02D7, "MMPLUSStatusMessage_HC", false, MAKE_PF_CB(process_MMPLUSStatusMessage_HC)); - // register_telegram_type(device_id - 0x20 + 0x02E1, "MMPLUSStetMessage_HC", true, MAKE_PF_CB(process_MMPLUSSetMessage_HC)); + // register_telegram_type(device_id - 0x20 + 0x02E1, "MMPLUSSetMessage_HC", true, MAKE_PF_CB(process_MMPLUSSetMessage_HC)); type_ = Type::HC; hc_ = device_id - 0x20 + 1; uint8_t tag = DeviceValueTAG::TAG_HC1 + hc_ - 1; diff --git a/src/locale_translations.h b/src/locale_translations.h index bf75cddcf..98d9c1a65 100644 --- a/src/locale_translations.h +++ b/src/locale_translations.h @@ -516,8 +516,10 @@ MAKE_TRANSLATION(meterEHeat, "metereheat", "meter e-heater", "Messung E-Heizer", // HIU MAKE_TRANSLATION(netFlowTemp, "netflowtemp", "heat network flow temp", "System Vorlauftemperatur", "Netto aanvoertemperatuur", "", "", "", "", "ısıtma şebekesi akış derecesi", "temperatura di mandata della rete di riscaldamento") // TODO translate -MAKE_TRANSLATION(cwFlowRate, "cwflowrate", "cold water flow rate", "Kaltwasser Durchfluss", "Stroomsnelheid koud water ", "", "", "", "", "soğuk su akış hızı", "portata acqua fredda") // TODO translate +// MAKE_TRANSLATION(cwFlowRate, "cwflowrate", "cold water flow rate", "Kaltwasser Durchfluss", "Stroomsnelheid koud water ", "", "", "", "", "soğuk su akış hızı", "portata acqua fredda") // TODO translate MAKE_TRANSLATION(keepWarmTemp, "keepwarmtemp", "keep warm temperature","Warmhaltetemperatur", "Warmhoudtemperatuur", "", "", "", "", "sıcaklığı koruma derecesi", "mantenere la temperatura calda") // TODO translate +MAKE_TRANSLATION(heatValve, "heatvalve", "heating valve", "Ventil Heizen", "", "", "", "", "", "", "") // TODO translate +MAKE_TRANSLATION(wwValve, "wwvalve", "valve", "Ventil", "", "", "", "", "", "", "") // TODO translate // the following are dhw for the boiler and automatically tagged with 'dhw' MAKE_TRANSLATION(wwSelTemp, "wwseltemp", "selected temperature", "gewählte Temperatur", "Geselecteerd temperatuur", "Vald Temperatur", "temperatura wyższa/komfort", "valgt temperatur", "température sélectionnée", "seçili sıcaklık", "temperatura selezionata")