From 5ec68b85d2d26599149b571d2bc8fda26a1b1ad6 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Wed, 24 Apr 2024 07:55:25 +0200 Subject: [PATCH] add meters for gasboiler --- src/devices/boiler.cpp | 43 +++++++++++++++++++++++++++++++++++++++ src/devices/boiler.h | 8 ++++++++ src/locale_translations.h | 4 ++++ 3 files changed, 55 insertions(+) diff --git a/src/devices/boiler.cpp b/src/devices/boiler.cpp index 17b556285..cca692f2a 100644 --- a/src/devices/boiler.cpp +++ b/src/devices/boiler.cpp @@ -91,6 +91,12 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const register_telegram_type(0x4A5, "HPFan", true, MAKE_PF_CB(process_HpFan)); } + // some gas boilers, see #1701 + if (model() != EMSdevice::EMS_DEVICE_FLAG_HEATPUMP) { + register_telegram_type(0x2E, "Meters", false, MAKE_PF_CB(process_Meters)); + register_telegram_type(0x3B, "Energy", false, MAKE_PF_CB(process_Energy)); + } + 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)); @@ -389,6 +395,29 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const 99); } */ + if (model() != EMSdevice::EMS_DEVICE_FLAG_HEATPUMP) { + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, + &meterHeat_, + DeviceValueType::UINT24, + DeviceValueNumOp::DV_NUMOP_DIV10, + FL_(meterHeat), + DeviceValueUOM::KWH); + register_device_value(DeviceValueTAG::TAG_DHW1, &meterWw_, DeviceValueType::UINT24, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(meterWw), DeviceValueUOM::KWH); + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, + &gasMeterHeat_, + DeviceValueType::UINT24, + DeviceValueNumOp::DV_NUMOP_DIV10, + FL_(gasMeterHeat), + DeviceValueUOM::KWH); + register_device_value(DeviceValueTAG::TAG_DHW1, &gasMeterWw_, DeviceValueType::UINT24, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(gasMeterWw), DeviceValueUOM::KWH); + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, + &nrgHeat2_, + DeviceValueType::UINT24, + DeviceValueNumOp::DV_NUMOP_DIV10, + FL_(nrgHeat2), + DeviceValueUOM::KWH); + register_device_value(DeviceValueTAG::TAG_DHW1, &nrgWw2_, DeviceValueType::UINT24, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(nrgWw2), DeviceValueUOM::KWH); + } // heatpump info if (model() == EMSdevice::EMS_DEVICE_FLAG_HEATPUMP) { @@ -1949,6 +1978,20 @@ void Boiler::process_HpFan(std::shared_ptr telegram) { has_update(telegram, fan_, 9); } +// Boiler(0x08) -B-> All(0x00), ?(0x2E), data: 00 00 1C CE 00 00 05 E8 00 00 00 18 00 00 00 02 +void Boiler::process_Meters(std::shared_ptr telegram) { + has_update(telegram, gasMeterHeat_, 0); + has_update(telegram, gasMeterWw_, 4); + has_update(telegram, meterHeat_, 8); + has_update(telegram, meterWw_, 12); +} + +// boiler(0x08) -B-> All(0x00), ?(0x3B), data: 00 00 1B D1 00 00 05 7F +void Boiler::process_Energy(std::shared_ptr telegram) { + has_update(telegram, nrgHeat2_, 0); + has_update(telegram, nrgWw2_, 4); +} + // HIU unit // boiler(0x08) -B-> All(0x00), ?(0x0779), data: 06 05 01 01 AD 02 EF FF FF 00 00 7F FF diff --git a/src/devices/boiler.h b/src/devices/boiler.h index eb984b401..cc44873db 100644 --- a/src/devices/boiler.h +++ b/src/devices/boiler.h @@ -225,11 +225,15 @@ class Boiler : public EMSdevice { uint32_t nrgTotal_; uint32_t nrgWw_; uint32_t nrgHeat_; + uint32_t nrgWw2_; + uint32_t nrgHeat2_; uint32_t meterTotal_; uint32_t meterComp_; uint32_t meterEHeat_; uint32_t meterHeat_; uint32_t meterWw_; + uint32_t gasMeterHeat_; + uint32_t gasMeterWw_; uint8_t hpEA0_; uint8_t hpPumpMode_; uint8_t hpSetDiffPress_; @@ -367,6 +371,10 @@ class Boiler : public EMSdevice { void process_HpMeters(std::shared_ptr telegram); void process_WeatherComp(std::shared_ptr telegram); void process_HpFan(std::shared_ptr telegram); + + void process_Meters(std::shared_ptr telegram); + void process_Energy(std::shared_ptr telegram); + // HIU void process_HIUSettings(std::shared_ptr telegram); void process_HIUMonitor(std::shared_ptr telegram); diff --git a/src/locale_translations.h b/src/locale_translations.h index ccf4b4d46..5aad2920a 100644 --- a/src/locale_translations.h +++ b/src/locale_translations.h @@ -543,12 +543,16 @@ MAKE_TRANSLATION(releaseWait, "releasewait", "boiler release wait time", "Wartez MAKE_TRANSLATION(nrgTotal, "nrgtotal", "total energy", "Energie gesamt", "", "", "całkowita energia", "", "", "", "", "celková energia") // TODO translate MAKE_TRANSLATION(nrgHeat, "nrgheat", "energy heating", "Energie Heizen", "", "", "energia na ogrzewanie", "", "", "ısıtma enerjisi", "", "energetické vykurovanie") // TODO translate MAKE_TRANSLATION(nrgWw, "nrgdhw", "energy", "Energie", "", "", "energia", "", "", "sıcak kullanım suyu enerjisi", "", "energia") // TODO translate +MAKE_TRANSLATION(nrgHeat2, "nrgheat2", "energy heating 2", "Energie Heizen 2", "", "", "energia na ogrzewanie 2", "", "", "ısıtma enerjisi 2", "", "energetické vykurovanie") // TODO translate +MAKE_TRANSLATION(nrgWw2, "nrgdhw2", "energy 2", "Energie 2", "", "", "energia 2", "", "", "sıcak kullanım suyu enerjisi 2", "", "energia 2") // TODO translate MAKE_TRANSLATION(nomPower, "nompower", "nominal Power", "Brennerleistung", "", "", "moc nominalna", "", "", "nominal güç", "", "nominálny výkon") // TODO translate MAKE_TRANSLATION(meterTotal, "metertotal", "meter total", "Messung gesamt", "", "", "licznik całkowity", "", "", "", "", "meter celkom") // TODO translate MAKE_TRANSLATION(meterComp, "metercomp", "meter compressor", "Messung Kompressor", "", "", "licznik sprężarki", "", "", "", "", "meter kompresor") // TODO translate MAKE_TRANSLATION(meterEHeat, "metereheat", "meter e-heater", "Messung E-Heizer", "", "", "licznik dogrzewacza", "", "", "", "", "elektrický ohrievač") // TODO translate MAKE_TRANSLATION(meterHeat, "meterheat", "meter heating", "Messung Heizen", "", "", "licznik ogrzewania", "", "", "", "", "") // TODO translate MAKE_TRANSLATION(meterWw, "meterdhw", "meter", "Messung", "", "", "licznik", "", "", "", "", "") // TODO translate +MAKE_TRANSLATION(gasMeterHeat, "gasmeterheat", "gas meter heating", "Gas Messung Heizen", "", "", "", "", "", "", "", "") // TODO translate +MAKE_TRANSLATION(gasMeterWw, "gasmeterdhw", "gas meter", "Gas Messung", "", "", "", "", "", "", "", "") // TODO translate // HIU MAKE_TRANSLATION(netFlowTemp, "netflowtemp", "heat network flow temp", "System Vorlauftemperatur", "Netto aanvoertemperatuur", "", "temp. zasilania sieci cieplnej", "", "", "ısıtma şebekesi akış derecesi", "temperatura di mandata della rete di riscaldamento", "teplota prívodu tepelnej siete") // TODO translate