From a2422e1f6a63fda42392f93fddef6eb5f578c758 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Sun, 12 Nov 2023 10:59:30 +0100 Subject: [PATCH 1/3] add hpEA0, heatnigpump for all boilers/hps/hiu, remove input-state --- src/devices/boiler.cpp | 52 +++++++++++++++++---------------------- src/devices/boiler.h | 1 + src/locale_translations.h | 1 + 3 files changed, 25 insertions(+), 29 deletions(-) diff --git a/src/devices/boiler.cpp b/src/devices/boiler.cpp index 0d8b4ec91..274c5deca 100644 --- a/src/devices/boiler.cpp +++ b/src/devices/boiler.cpp @@ -177,6 +177,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const FL_(headertemp), DeviceValueUOM::DEGREES); + // exclude burner related entities from heatpump and HIU if (model() != EMS_DEVICE_FLAG_HEATPUMP && model() != EMS_DEVICE_FLAG_HIU) { register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &exhaustTemp_, @@ -184,12 +185,6 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const DeviceValueNumOp::DV_NUMOP_DIV10, FL_(exhaustTemp), DeviceValueUOM::DEGREES); - register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, - &heatblock_, - DeviceValueType::USHORT, - DeviceValueNumOp::DV_NUMOP_DIV10, - FL_(heatblock), - DeviceValueUOM::DEGREES); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &burnGas_, DeviceValueType::BOOL, FL_(burnGas), DeviceValueUOM::NONE); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &burnGas2_, DeviceValueType::BOOL, FL_(burnGas2), DeviceValueUOM::NONE); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, @@ -198,7 +193,6 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const DeviceValueNumOp::DV_NUMOP_DIV10, FL_(flameCurr), DeviceValueUOM::UA); - register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &heatingPump_, DeviceValueType::BOOL, FL_(heatingPump), DeviceValueUOM::NONE); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &fanWork_, DeviceValueType::BOOL, FL_(fanWork), DeviceValueUOM::NONE); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &ignWork_, DeviceValueType::BOOL, FL_(ignWork), DeviceValueUOM::NONE); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &oilPreHeat_, DeviceValueType::BOOL, FL_(oilPreHeat), DeviceValueUOM::NONE); @@ -216,20 +210,6 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const MAKE_CF_CB(set_max_power), 0, 254); - register_device_value( - DeviceValueTAG::TAG_DEVICE_DATA, &boilHystOn_, DeviceValueType::INT, FL_(boilHystOn), DeviceValueUOM::DEGREES_R, MAKE_CF_CB(set_hyst_on), -20, 0); - register_device_value( - DeviceValueTAG::TAG_DEVICE_DATA, &boilHystOff_, DeviceValueType::INT, FL_(boilHystOff), DeviceValueUOM::DEGREES_R, MAKE_CF_CB(set_hyst_off), 0, 20); - register_device_value( - DeviceValueTAG::TAG_DEVICE_DATA, &boil2HystOn_, DeviceValueType::INT, FL_(boil2HystOn), DeviceValueUOM::DEGREES_R, MAKE_CF_CB(set_hyst2_on), -20, 0); - register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, - &boil2HystOff_, - DeviceValueType::INT, - FL_(boil2HystOff), - DeviceValueUOM::DEGREES_R, - MAKE_CF_CB(set_hyst2_off), - 0, - 20); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &burnMinPeriod_, DeviceValueType::UINT, @@ -248,6 +228,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const MAKE_CF_CB(set_heating_activated)); register_device_value( DeviceValueTAG::TAG_DEVICE_DATA, &heatingTemp_, DeviceValueType::UINT, FL_(heatingTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_heating_temp), 0, 90); + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &heatingPump_, DeviceValueType::BOOL, FL_(heatingPump), DeviceValueUOM::NONE); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &pumpModMax_, DeviceValueType::UINT, FL_(pumpModMax), DeviceValueUOM::PERCENT, MAKE_CF_CB(set_max_pump)); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &pumpModMin_, DeviceValueType::UINT, FL_(pumpModMin), DeviceValueUOM::PERCENT, MAKE_CF_CB(set_min_pump)); register_device_value( @@ -255,6 +236,16 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const register_device_value( DeviceValueTAG::TAG_DEVICE_DATA, &pumpDelay_, DeviceValueType::UINT, FL_(pumpDelay), DeviceValueUOM::MINUTES, MAKE_CF_CB(set_pump_delay), 0, 60); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &setFlowTemp_, DeviceValueType::UINT, FL_(setFlowTemp), DeviceValueUOM::DEGREES); + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, + &heatblock_, + DeviceValueType::USHORT, + DeviceValueNumOp::DV_NUMOP_DIV10, + FL_(heatblock), + DeviceValueUOM::DEGREES); + register_device_value( + DeviceValueTAG::TAG_DEVICE_DATA, &boilHystOn_, DeviceValueType::INT, FL_(boilHystOn), DeviceValueUOM::DEGREES_R, MAKE_CF_CB(set_hyst_on), -20, 0); + register_device_value( + DeviceValueTAG::TAG_DEVICE_DATA, &boilHystOff_, DeviceValueType::INT, FL_(boilHystOff), DeviceValueUOM::DEGREES_R, MAKE_CF_CB(set_hyst_off), 0, 20); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &setBurnPow_, DeviceValueType::UINT, FL_(setBurnPow), DeviceValueUOM::PERCENT); register_device_value( DeviceValueTAG::TAG_DEVICE_DATA, &selBurnPow_, DeviceValueType::UINT, FL_(selBurnPow), DeviceValueUOM::PERCENT, MAKE_CF_CB(set_burn_power), 0, 254); @@ -506,7 +497,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const DeviceValueUOM::DEGREES, MAKE_CF_CB(set_pool_temp)); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hp4wayValve_, DeviceValueType::ENUM, FL_(enum_4way), FL_(hp4wayValve), DeviceValueUOM::NONE); - register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpInput[0].state, DeviceValueType::BOOL, FL_(hpInput1), DeviceValueUOM::NONE); + // register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpInput[0].state, DeviceValueType::BOOL, FL_(hpInput1), DeviceValueUOM::NONE); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpInput[0].option, DeviceValueType::STRING, @@ -514,7 +505,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const FL_(hpIn1Opt), DeviceValueUOM::NONE, MAKE_CF_CB(set_HpIn1Logic)); - register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpInput[1].state, DeviceValueType::BOOL, FL_(hpInput2), DeviceValueUOM::NONE); + // register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpInput[1].state, DeviceValueType::BOOL, FL_(hpInput2), DeviceValueUOM::NONE); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpInput[1].option, DeviceValueType::STRING, @@ -522,7 +513,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const FL_(hpIn2Opt), DeviceValueUOM::NONE, MAKE_CF_CB(set_HpIn2Logic)); - register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpInput[2].state, DeviceValueType::BOOL, FL_(hpInput3), DeviceValueUOM::NONE); + // register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpInput[2].state, DeviceValueType::BOOL, FL_(hpInput3), DeviceValueUOM::NONE); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpInput[2].option, DeviceValueType::STRING, @@ -530,7 +521,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const FL_(hpIn3Opt), DeviceValueUOM::NONE, MAKE_CF_CB(set_HpIn3Logic)); - register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpInput[3].state, DeviceValueType::BOOL, FL_(hpInput4), DeviceValueUOM::NONE); + // register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpInput[3].state, DeviceValueType::BOOL, FL_(hpInput4), DeviceValueUOM::NONE); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpInput[3].option, DeviceValueType::STRING, @@ -774,6 +765,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const FL_(hpCircPumpWw), DeviceValueUOM::NONE, MAKE_CF_CB(set_hpCircPumpWw)); + register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW, &hpEA0_, DeviceValueType::BOOL, FL_(hpEA0), DeviceValueUOM::NONE); } // dhw - DEVICE_DATA_ww topic @@ -1511,6 +1503,7 @@ void Boiler::process_UBAEnergySupplied(std::shared_ptr telegram) void Boiler::process_HpPower(std::shared_ptr telegram) { has_update(telegram, hpPower_, 11); has_bitupdate(telegram, hpCompOn_, 3, 4); + has_bitupdate(telegram, hpEA0_, 3, 6); has_update(telegram, hpBrinePumpSpd_, 5); has_update(telegram, hpCompSpd_, 17); has_update(telegram, hpCircSpd_, 4); @@ -1552,12 +1545,13 @@ void Boiler::process_HpPool(std::shared_ptr telegram) { // Heatpump inputs - type 0x4A2 // Boiler(0x08) -> All(0x00), ?(0x04A2), data: 02 01 01 00 01 00 // Boiler(0x08) -W-> Me(0x0B), HpInput(0x04A2), data: 20 07 06 01 00 (from #802) +// fix stetes 1/3 see https://github.com/emsesp/EMS-ESP32/issues/1388 void Boiler::process_HpInput(std::shared_ptr telegram) { has_bitupdate(telegram, hp4wayValve_, 0, 7); - has_update(telegram, hpInput[0].state, 2); - has_update(telegram, hpInput[1].state, 3); - has_update(telegram, hpInput[2].state, 4); - has_update(telegram, hpInput[3].state, 5); + // has_update(telegram, hpInput[0].state, 2); + // has_bitupdate(telegram, hpInput[1].state, 0, 1); + // has_update(telegram, hpInput[2].state, 3); + // has_bitupdate(telegram, hpInput[3].state, 4, 0); } // Heatpump inputs settings- type 0x486 (https://github.com/emsesp/EMS-ESP32/issues/600) diff --git a/src/devices/boiler.h b/src/devices/boiler.h index eecef4c48..9466ea179 100644 --- a/src/devices/boiler.h +++ b/src/devices/boiler.h @@ -217,6 +217,7 @@ class Boiler : public EMSdevice { uint32_t meterTotal_; uint32_t meterComp_; uint32_t meterEHeat_; + uint8_t hpEA0_; // Pool unit int8_t poolSetTemp_; diff --git a/src/locale_translations.h b/src/locale_translations.h index 5bf46295d..a4c098541 100644 --- a/src/locale_translations.h +++ b/src/locale_translations.h @@ -450,6 +450,7 @@ MAKE_TRANSLATION(elHeatStep3, "elheatstep3", "el. heater step 3", "El. Heizer St MAKE_TRANSLATION(wwAlternatingOper, "wwalternatingop", "alternating operation", "Wechselbetrieb", "Wisselbedrijf ww", "", "praca naprzemienna", "alternativ drift", "", "sıcak kullanım suyu alternatif işletim", "funzionamento alternato") // TODO translate MAKE_TRANSLATION(wwAltOpPrioHeat, "wwaltopprioheat", "prioritise heating during dhw", "Heizen bevorzugt vor WW", "Proriteit verwarming boven ww", "", "czas na ogrzewanie w trakcie c.w.u", "prioritert oppvarmning", "", "sıcak kullanım suyu esnasında ısıtmayı öne al", "dare la priorità al riscaldamento durante l'ACS") // TODO translate MAKE_TRANSLATION(wwAltOpPrioWw, "wwaltopprioww", "prioritise dhw during heating", "WW bevorzugt vor Heizen", "Prioriteit ww boven verwarming", "", "czas na c.w.u w trakcie ogrzewania", "prioritert varmtvann", "", "ısıtma esnasında sıcak kullanım suyunu öne al", "dare priorità all'acqua calda durante il riscaldamento") // TODO translate +MAKE_TRANSLATION(hpEA0, "hpea0", "condensate reservoir heating (EA0)", "Heizung Kondensatwanne (EA0)", "", "", "", "", "", "", "") // TODO translate // hybrid heatpump MAKE_TRANSLATION(hybridStrategy, "hybridstrategy", "hybrid control strategy", "Hybrid Strategie", "Hybride strategie", "Hybrid kontrollstrategi", "strategia sterowania hybrydowego", "hybrid kontrollstrategi", "stratégie contrôle hybride", "hibrit kontrol stratejisi", "strategia comtrollo ibrido") From 4b6b89f1a062880f805ba0d90890bba77f5e8185 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Sun, 12 Nov 2023 13:46:33 +0100 Subject: [PATCH 2/3] add uptimetotal, #1416 --- src/devices/boiler.cpp | 7 +++++++ src/devices/boiler.h | 1 + src/locale_translations.h | 1 + 3 files changed, 9 insertions(+) diff --git a/src/devices/boiler.cpp b/src/devices/boiler.cpp index 274c5deca..3497ace0c 100644 --- a/src/devices/boiler.cpp +++ b/src/devices/boiler.cpp @@ -398,6 +398,12 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const DeviceValueNumOp::DV_NUMOP_DIV100, FL_(meterEHeat), DeviceValueUOM::KWH); + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, + &upTimeTotal_, + DeviceValueType::TIME, + DeviceValueNumOp::DV_NUMOP_DIV60, + FL_(upTimeTotal), + DeviceValueUOM::MINUTES); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &upTimeControl_, DeviceValueType::TIME, @@ -1489,6 +1495,7 @@ void Boiler::process_UBAInformation(std::shared_ptr telegram) { * 08 00 FF 31 03 94 00 00 00 00 00 00 00 38 */ void Boiler::process_UBAEnergySupplied(std::shared_ptr telegram) { + has_update(telegram, upTimeTotal_, 0); has_update(telegram, nrgSuppTotal_, 4); has_update(telegram, nrgSuppHeating_, 12); has_update(telegram, nrgSuppWw_, 8); diff --git a/src/devices/boiler.h b/src/devices/boiler.h index 9466ea179..fa686b493 100644 --- a/src/devices/boiler.h +++ b/src/devices/boiler.h @@ -154,6 +154,7 @@ class Boiler : public EMSdevice { uint16_t heatblock_; // see #1317 // info + uint32_t upTimeTotal_; // Operating time uint32_t upTimeControl_; // Operating time control uint32_t upTimeCompHeating_; // Operating time compressor heating uint32_t upTimeCompCooling_; // Operating time compressor cooling diff --git a/src/locale_translations.h b/src/locale_translations.h index a4c098541..27e7b4f1e 100644 --- a/src/locale_translations.h +++ b/src/locale_translations.h @@ -345,6 +345,7 @@ MAKE_TRANSLATION(headertemp, "headertemp", "low loss header", "Hydr. Weiche", "o MAKE_TRANSLATION(heatblock, "heatblock", "heating block", "Wärmezelle", "Aanvoertemp. warmtecel", "", "blok grzewczy", "", "départ corps de chauffe", "Hid.denge kabı sıcaklığı", "mandata scamb. pr.") // TODO translate // heatpump/compress specific +MAKE_TRANSLATION(upTimeTotal, "uptimetotal", "heatpump total uptime", "Wärmpepumpe Gesamtbetriebszeit", "", "", "", "", "", "", "") // TODO translate MAKE_TRANSLATION(upTimeControl, "uptimecontrol", "total operating time heat", "Betriebszeit Heizen gesamt", "Totale bedrijfstijd", "Total tid uppvärmning", "łączny czas generowania ciepła", "total driftstid", "durée totale de fonctionnement chauffage", "ısınma toplam işletme süresi", "Tempo di funzionamento totale riscaldamento") MAKE_TRANSLATION(upTimeCompHeating, "uptimecompheating", "operating time compressor heating", "Betriebszeit Kompressor heizen", "Bedrijfstijd compressor verwarmingsbedrijf", "Total tid kompressor uppvärmning", "łączny czas ogrzewania (sprężarka)", "totaltid kompressor", "durée de fonctionnement compresseur chauffage", "ısı pompası ısınma işletme süresi", "tempo di funzionamento del compressore riscaldamento") MAKE_TRANSLATION(upTimeCompCooling, "uptimecompcooling", "operating time compressor cooling", "Betriebszeit Kompressor kühlen", "Bedrijfstijd compressor koelbedrijf", "Total tid kompressor kyla", "łączny czas chłodzenia (sprężarka)", "Total tid kompressor kjøling", "durée de fonctionnement compresseur refroidissement", "ısı pompası soğuma işletme süresi", "tempo di funzionamento del compressore raffreddamento") From 1b27fae8441dedfb18854c6a17019b4dd7f4c713 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Sun, 12 Nov 2023 14:31:42 +0100 Subject: [PATCH 3/3] fix tag of hpEA0 --- src/devices/boiler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/boiler.cpp b/src/devices/boiler.cpp index 3497ace0c..a4ed879b8 100644 --- a/src/devices/boiler.cpp +++ b/src/devices/boiler.cpp @@ -718,6 +718,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const FL_(elHeatStep3), DeviceValueUOM::NONE, MAKE_CF_CB(set_elHeatStep3)); + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpEA0_, DeviceValueType::BOOL, FL_(hpEA0), DeviceValueUOM::NONE); // heatpump DHW settings register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW, &wwAlternatingOper_, @@ -771,7 +772,6 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const FL_(hpCircPumpWw), DeviceValueUOM::NONE, MAKE_CF_CB(set_hpCircPumpWw)); - register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW, &hpEA0_, DeviceValueType::BOOL, FL_(hpEA0), DeviceValueUOM::NONE); } // dhw - DEVICE_DATA_ww topic