diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index ca05d4b84..0c50654a9 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -1454,6 +1454,7 @@ void Thermostat::process_RC35Set(std::shared_ptr telegram) { has_update(telegram, hc->designtemp, 17); // is * 1 has_update(telegram, hc->maxflowtemp, 15); // is * 1 } + setValueEnum(&hc->heatingtype, hc->control == 1 ? FL_(enum_heatingtype2) : FL_(enum_heatingtype)); } // type 0x3F (HC1), 0x49 (HC2), 0x53 (HC3), 0x5D (HC4) - timer setting @@ -3208,14 +3209,18 @@ bool Thermostat::set_heatingtype(const char * value, const int8_t id) { } uint8_t set; - if (model() == EMSdevice::EMS_DEVICE_FLAG_JUNKERS && Helpers::value2enum(value, set, FL_(enum_heatingtype1))) { - write_command(set_typeids[hc->hc()], 0, set, set_typeids[hc->hc()]); - return true; - } - if (Helpers::value2enum(value, set, FL_(enum_heatingtype))) { - if ((model() == EMSdevice::EMS_DEVICE_FLAG_RC20_N) || (model() == EMSdevice::EMS_DEVICE_FLAG_RC25)) { + if (model() == EMSdevice::EMS_DEVICE_FLAG_JUNKERS) { + if (Helpers::value2enum(value, set, FL_(enum_heatingtype1))) { write_command(set_typeids[hc->hc()], 0, set, set_typeids[hc->hc()]); - } else if (model() == EMSdevice::EMS_DEVICE_FLAG_RC35 || model() == EMSdevice::EMS_DEVICE_FLAG_RC30_N) { + return true; + } + } else if (model() == EMSdevice::EMS_DEVICE_FLAG_RC35 || model() == EMSdevice::EMS_DEVICE_FLAG_RC30_N) { + if (Helpers::value2enum(value, set, hc->control == 1 ? FL_(enum_heatingtype2) : FL_(enum_heatingtype))) { + write_command(set_typeids[hc->hc()], 0, set, set_typeids[hc->hc()]); + return true; + } + } else if (Helpers::value2enum(value, set, FL_(enum_heatingtype))) { + if ((model() == EMSdevice::EMS_DEVICE_FLAG_RC20_N) || (model() == EMSdevice::EMS_DEVICE_FLAG_RC25)) { write_command(set_typeids[hc->hc()], 0, set, set_typeids[hc->hc()]); } else if (model() == EMSdevice::EMS_DEVICE_FLAG_RC30) { write_command(curve_typeids[hc->hc()], 0, set, curve_typeids[hc->hc()]); diff --git a/src/emsdevice.cpp b/src/emsdevice.cpp index 752dcc955..c5c5108f0 100644 --- a/src/emsdevice.cpp +++ b/src/emsdevice.cpp @@ -1182,6 +1182,19 @@ void EMSdevice::set_climate_minmax(int8_t tag, int16_t min, uint32_t max) { } } +void EMSdevice::setValueEnum(const void * value_p, const char * const ** options) { + for (auto & dv : devicevalues_) { + if (dv.value_p == value_p) { + if (dv.options != options && Mqtt::ha_enabled()) { + dv.remove_state(DeviceValueState::DV_HA_CONFIG_CREATED); + } + dv.options = options; + dv.options_size = Helpers::count_items(options); + break; + } + } +} + // set mask per device entity based on the id which is prefixed with the 2 char hex mask value // returns true if the entity has a mask set (not 0 the default) void EMSdevice::setCustomizationEntity(const std::string & entity_id) { @@ -1984,7 +1997,7 @@ std::string EMSdevice::name() { if (model().empty()) { return default_name(); } - return model() + "/" + default_name(); + return model() + "/" + std::string(default_name()); } return custom_name(); diff --git a/src/emsdevice.h b/src/emsdevice.h index 4f02fd76e..e4ce9743e 100644 --- a/src/emsdevice.h +++ b/src/emsdevice.h @@ -216,6 +216,7 @@ class EMSdevice { void add_handlers_ignored(const uint16_t handler); void set_climate_minmax(int8_t tag, int16_t min, uint32_t max); + void setValueEnum(const void * value_p, const char * const ** options); void setCustomizationEntity(const std::string & entity_id); void getCustomizationEntities(std::vector & entity_ids); diff --git a/src/locale_common.h b/src/locale_common.h index 75ad68e1e..220da8b25 100644 --- a/src/locale_common.h +++ b/src/locale_common.h @@ -317,6 +317,7 @@ MAKE_ENUM(enum_wwMode5, FL_(normal), FL_(comfort), FL_(ecoplus)) // Rego3000 MAKE_ENUM(enum_wwMode6, FL_(off), FL_(comfort), FL_(auto)) // CR120 MAKE_ENUM(enum_heatingtype, FL_(off), FL_(radiator), FL_(convector), FL_(floor)) MAKE_ENUM(enum_heatingtype1, FL_(off), FL_(curve), FL_(radiator), FL_(convector), FL_(floor)) +MAKE_ENUM(enum_heatingtype2, FL_(off), FL_(radiator), FL_(convector), FL_(floor), FL_(roomflow), FL_(roomload)) MAKE_ENUM(enum_summermode, FL_(summer), FL_(auto), FL_(winter)) MAKE_ENUM(enum_hpoperatingmode, FL_(off), FL_(auto), FL_(heating), FL_(cooling)) MAKE_ENUM(enum_summer, FL_(winter), FL_(summer)) diff --git a/src/locale_translations.h b/src/locale_translations.h index 153409ee4..c0d817623 100644 --- a/src/locale_translations.h +++ b/src/locale_translations.h @@ -253,6 +253,8 @@ MAKE_WORD_TRANSLATION(curve, "heatingcurve", "Heizkurve", "", "", "krzywa grzani MAKE_WORD_TRANSLATION(radiator, "radiator", "Heizkörper", "radiator", "Radiator", "grzejniki", "radiator", "radiateur", "radyatör", "radiatore", "radiátor", "radiátor") MAKE_WORD_TRANSLATION(convector, "convector", "Konvektor", "convector", "Konvektor", "konwektory", "konvektor", "convecteur", "convector", "convettore", "konvektor", "konvektor") MAKE_WORD_TRANSLATION(floor, "floor", "Fussboden", "vloer", "Golv", "podłoga", "gulv", "sol", "yer", "pavimento", "podlaha", "podlaha") +MAKE_WORD_TRANSLATION(roomflow, "roomflow", "Raum Fluß", "", "", "", "", "", "", "", "", "") // TODO translate +MAKE_WORD_TRANSLATION(roomload, "roomload", "Raum Bedarf", "", "", "", "", "", "", "", "", "") // TODO translate MAKE_WORD_TRANSLATION(summer, "summer", "Sommer", "zomer", "Sommar", "lato", "sommer", "été", "yaz", "estate", "leto", "léto") MAKE_WORD_TRANSLATION(winter, "winter", "Winter", "winter", "Vinter", "zima", "vinter", "hiver", "kış", "inverno", "zima", "zima") MAKE_WORD_TRANSLATION(outdoor, "outdoor", "Außen", "buiten", "Utomhus", "temp. zewnętrzna", "utendørs", "extérieur", "dış", "esterno", "vonku", "venkovní")