From 8e844550bfd8e2e8e8d00ec5bffbe3e48be0d173 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Mon, 13 Nov 2023 13:53:35 +0100 Subject: [PATCH 1/2] sort HIU entities --- src/devices/boiler.cpp | 21 +++++++++++---------- src/locale_translations.h | 1 + 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/devices/boiler.cpp b/src/devices/boiler.cpp index a4ed879b8..0ea71603e 100644 --- a/src/devices/boiler.cpp +++ b/src/devices/boiler.cpp @@ -118,6 +118,7 @@ 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, &burnGas_, DeviceValueType::BOOL, FL_(heatingOn), DeviceValueUOM::NONE); } /* @@ -219,6 +220,16 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const 0, 120); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &absBurnPow_, DeviceValueType::UINT, FL_(absBurnPow), DeviceValueUOM::PERCENT); + 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, &heatingActivated_, @@ -236,16 +247,6 @@ 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); diff --git a/src/locale_translations.h b/src/locale_translations.h index 27e7b4f1e..faf7559b2 100644 --- a/src/locale_translations.h +++ b/src/locale_translations.h @@ -292,6 +292,7 @@ MAKE_TRANSLATION(wwtapactivated, "wwtapactivated", "turn on/off", "Durchlauferhi MAKE_TRANSLATION(reset, "reset", "reset", "Reset", "Reset", "Nollställ", "kasowanie komunikatu", "nullstill", "reset", "Sıfırla", "Reset") MAKE_TRANSLATION(oilPreHeat, "oilpreheat", "oil preheating", "Ölvorwärmung", "Olie voorverwarming", "Förvärmning olja", "podgrzewanie oleju", "oljeforvarming", "préchauffage de l'huile", "Yakıt Ön ısıtma devrede", "preriscaldamento olio") MAKE_TRANSLATION(heatingActive, "heatingactive", "heating active", "Heizen aktiv", "Verwarming actief", "Uppvärmning aktiv", "c.o. aktywne", "oppvarming aktiv", "chauffage actif", "ısıtma devrede", "riscaldamento attivo") +MAKE_TRANSLATION(heatingOn, "heating", "heating", "Heizen", "verwarmen", "Uppvärmning", "ogrzewanie", "oppvarming", "chauffage", "ısıtma", "riscaldamento") MAKE_TRANSLATION(tapwaterActive, "tapwateractive", "tapwater active", "Warmwasser aktiv", "Warm water actief", "Varmvatten aktiv", "c.w.u. aktywne", "varmtvann aktiv", "eau chaude active", "sıcak kullanım suyu devrede", "acqua calda attiva") MAKE_TRANSLATION(selFlowTemp, "selflowtemp", "selected flow temperature", "Sollwert Vorlauftemperatur", "Ingestelde aanvoertemperatuur", "Börvärde Flödestemperatur", "wybrana temperatura zasilania", "valgt turtemperatur", "température de flux selectionnée", "seçili akış sıcaklığı", "flusso temperatura selezionato") MAKE_TRANSLATION(selBurnPow, "selburnpow", "burner selected max power", "Sollwert Brennerleistung", "Ingestelde maximale brandervermogen", "Brännare vald maxeffekt", "wybrana moc źródła ciepła", "settpunkt brennerkapasitet", "puissance max du brûleur selectionnée", "seçili kazan maksimum güç", "Setpoint potenza bruciatore") From 1f8a47793990a6fb89909d66ef0b62ac8e867be9 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Mon, 13 Nov 2023 13:54:13 +0100 Subject: [PATCH 2/2] RC300/BC400 mode setting --- src/devices/thermostat.cpp | 21 +++++++++++++-------- src/devices/thermostat.h | 2 ++ src/locale_common.h | 2 +- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index f7f5dfa32..f46e6c8ff 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -1021,8 +1021,14 @@ void Thermostat::process_RC300Set(std::shared_ptr telegram) { // has_update(telegram, hc->selTemp, 8, 1); // single byte conversion, value is * 2 - auto? // has_update(telegram, hc->selTemp, 10, 1); // single byte conversion, value is * 2 - manual - // check why mode is both in the Monitor and Set for the RC300. It'll be read twice! - // has_update(telegram, hc->mode, 0); // Auto = xFF, Manual = x00 eg. 10 00 FF 08 01 B9 FF + telegram->read_value(hc->mode_new, 21); // 0-off, 1-manual, 2-auto + if (Helpers::hasValue(hc->mode_new)) { + has_update(hc->mode, hc->mode_new); + } else { + uint8_t mode = EMS_VALUE_UINT_NOTSET; + telegram->read_value(mode, 0); + has_update(hc->mode, mode == 0xFF ? 2 : 1); + } has_update(telegram, hc->daytemp, 2); // is * 2 has_update(telegram, hc->nighttemp, 4); // is * 2 @@ -2552,12 +2558,11 @@ bool Thermostat::set_mode_n(const uint8_t mode, const uint8_t hc_num) { break; case EMSdevice::EMS_DEVICE_FLAG_RC300: case EMSdevice::EMS_DEVICE_FLAG_RC100: - offset = EMS_OFFSET_RCPLUSSet_mode; - validate_typeid = monitor_typeids[hc_p]; - if (mode == HeatingCircuit::Mode::AUTO) { - set_mode_value = 0xFF; // special value for auto + if (Helpers::hasValue(hc->mode_new)) { + offset = EMS_OFFSET_RCPLUSSet_mode; } else { - set_mode_value = 0; // everything else, like manual/day etc.. + offset = 0; + set_mode_value = set_mode_value == 2 ? 0xFF : 0; } break; case EMSdevice::EMS_DEVICE_FLAG_JUNKERS: @@ -3599,7 +3604,7 @@ void Thermostat::register_device_values() { &wwDisinfectHour_, DeviceValueType::UINT, DeviceValueNumOp::DV_NUMOP_MUL15, - FL_(wwDisinfectTime), + FL_(wwDisinfectHour), DeviceValueUOM::MINUTES, MAKE_CF_CB(set_wwDisinfectHour), 0, diff --git a/src/devices/thermostat.h b/src/devices/thermostat.h index 8db4096dd..4fa450143 100644 --- a/src/devices/thermostat.h +++ b/src/devices/thermostat.h @@ -41,6 +41,7 @@ class Thermostat : public EMSdevice { uint8_t tempautotemp; int8_t remoteseltemp; uint8_t mode; + uint8_t mode_new; uint8_t modetype; uint8_t summermode; uint8_t holidaymode; @@ -318,6 +319,7 @@ class Thermostat : public EMSdevice { static constexpr uint8_t EMS_OFFSET_RCPLUSStatusMessage_curr = 0; // current temp static constexpr uint8_t EMS_OFFSET_RCPLUSStatusMessage_currsetpoint = 6; // target setpoint temp static constexpr uint8_t EMS_OFFSET_RCPLUSSet_mode = 0; // operation mode(Auto=0xFF, Manual=0x00) + static constexpr uint8_t EMS_OFFSET_RCPLUSSet_mode_new = 21; // operation mode(0-off, 1-manual, 2-auto) static constexpr uint8_t EMS_OFFSET_RCPLUSSet_temp_comfort3 = 1; // comfort3 level static constexpr uint8_t EMS_OFFSET_RCPLUSSet_temp_comfort2 = 2; // comfort2 level static constexpr uint8_t EMS_OFFSET_RCPLUSSet_temp_comfort1 = 3; // comfort1 level diff --git a/src/locale_common.h b/src/locale_common.h index 7d52e6801..ce3b8675f 100644 --- a/src/locale_common.h +++ b/src/locale_common.h @@ -303,7 +303,7 @@ MAKE_ENUM(enum_summer, FL_(winter), FL_(summer)) MAKE_ENUM(enum_operatingstate, FL_(heating), FL_(off), FL_(cooling)) MAKE_ENUM(enum_hpmode, FL_(heating), FL_(cooling), FL_(heatandcool)) -MAKE_ENUM(enum_mode, FL_(manual), FL_(auto)) // RC100, RC300, RC310 +MAKE_ENUM(enum_mode, FL_(off), FL_(manual), FL_(auto)) // RC100, RC300, RC310 MAKE_ENUM(enum_mode2, FL_(off), FL_(manual), FL_(auto)) // RC20, RC30 MAKE_ENUM(enum_mode3, FL_(night), FL_(day), FL_(auto)) // RC35, RC30_N, RC25, RC20_N MAKE_ENUM(enum_mode4, FL_(nofrost), FL_(eco), FL_(heat), FL_(auto)) // JUNKERS