From 2a6fedc6b3c46872526e3820e4914ff6c03c5d76 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Sun, 26 Nov 2023 09:11:46 +0100 Subject: [PATCH] hetpump energy meters, sync with HP id 0x08 --- src/devices/heatpump.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ src/devices/heatpump.h | 10 ++++++++++ 2 files changed, 50 insertions(+) diff --git a/src/devices/heatpump.cpp b/src/devices/heatpump.cpp index edb25e6bb..e9f74e672 100644 --- a/src/devices/heatpump.cpp +++ b/src/devices/heatpump.cpp @@ -33,6 +33,8 @@ Heatpump::Heatpump(uint8_t device_type, uint8_t device_id, uint8_t product_id, c register_telegram_type(0x9A0, "HPTemperature", false, MAKE_PF_CB(process_HPTemperature)); register_telegram_type(0x99B, "HPFlowTemp", false, MAKE_PF_CB(process_HPFlowTemp)); register_telegram_type(0x99C, "HPComp", false, MAKE_PF_CB(process_HPComp)); + register_telegram_type(0x4AE, "HPEnergy", true, MAKE_PF_CB(process_HpEnergy)); + register_telegram_type(0x4AF, "HPMeters", true, MAKE_PF_CB(process_HpMeters)); // device values register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &airHumidity_, DeviceValueType::UINT, FL_(airHumidity), DeviceValueUOM::PERCENT); @@ -146,6 +148,27 @@ Heatpump::Heatpump(uint8_t device_type, uint8_t device_id, uint8_t product_id, c DeviceValueUOM::NONE, MAKE_CF_CB(set_heatDrainPan)); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &heatCable_, DeviceValueType::BOOL, FL_(heatCable), DeviceValueUOM::NONE, MAKE_CF_CB(set_heatCable)); + 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, + DeviceValueNumOp::DV_NUMOP_DIV100, + FL_(meterTotal), + DeviceValueUOM::KWH); + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, + &meterComp_, + DeviceValueType::ULONG, + DeviceValueNumOp::DV_NUMOP_DIV100, + FL_(meterComp), + DeviceValueUOM::KWH); + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, + &meterEHeat_, + DeviceValueType::ULONG, + DeviceValueNumOp::DV_NUMOP_DIV100, + FL_(meterEHeat), + DeviceValueUOM::KWH); } /* @@ -226,6 +249,23 @@ void Heatpump::process_HPFunctionTest(std::shared_ptr telegram) has_update(telegram, heatCable_, 10); } +// boiler(0x08) -W-> Me(0x0B), ?(0x04AE), data: 00 00 BD C4 00 00 5B 6A 00 00 00 24 00 00 62 59 00 00 00 00 00 00 00 00 +// boiler(0x08) -W-> Me(0x0B), ?(0x04AE), data: 00 00 00 00 00 00 00 00 (offset 24) +void Heatpump::process_HpEnergy(std::shared_ptr telegram) { + has_update(telegram, nrgTotal_, 0); + 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 +// boiler(0x08) -W-> Me(0x0B), ?(0x04AF), data: 00 00 24 B0 00 00 00 12 00 00 23 A5 00 00 00 4B 00 00 00 00 00 00 00 00 (offset 24) +// boiler(0x08) -W-> Me(0x0B), ?(0x04AF), data: 00 00 00 00 00 00 00 00 (offset 48) +void Heatpump::process_HpMeters(std::shared_ptr telegram) { + has_update(telegram, meterTotal_, 0); + has_update(telegram, meterComp_, 4); + has_update(telegram, meterEHeat_, 8); +} + /* * Broadcast (0x099A), data: 05 00 00 00 00 00 00 37 00 00 1D 00 00 52 00 00 13 01 00 01 7C * Broadcast (0x099B), data: 80 00 80 00 01 3C 01 38 80 00 80 00 80 00 01 37 00 00 00 00 64 diff --git a/src/devices/heatpump.h b/src/devices/heatpump.h index e13aad81f..e99748836 100644 --- a/src/devices/heatpump.h +++ b/src/devices/heatpump.h @@ -67,6 +67,14 @@ class Heatpump : public EMSdevice { int16_t hpJr0_; // low pressure sensor int16_t hpJr1_; // high pressure sensor + uint32_t nrgTotal_; + uint32_t nrgWw_; + uint32_t nrgHeat_; + uint32_t meterTotal_; + uint32_t meterComp_; + uint32_t meterEHeat_; + + void process_HPMonitor1(std::shared_ptr telegram); void process_HPMonitor2(std::shared_ptr telegram); void process_HPSettings(std::shared_ptr telegram); @@ -74,6 +82,8 @@ class Heatpump : public EMSdevice { void process_HPTemperature(std::shared_ptr telegram); void process_HPFlowTemp(std::shared_ptr telegram); void process_HPComp(std::shared_ptr telegram); + void process_HpEnergy(std::shared_ptr telegram); + void process_HpMeters(std::shared_ptr telegram); bool set_controlStrategy(const char * value, const int8_t id); bool set_lowNoiseMode(const char * value, const int8_t id);