add switchProgMode #1903

This commit is contained in:
MichaelDvP
2024-07-30 15:18:01 +02:00
parent 80aa1e65b7
commit 95f0478fa7
5 changed files with 23 additions and 1 deletions

View File

@@ -34,6 +34,7 @@
- RT800 remote emulation [#1867](https://github.com/emsesp/EMS-ESP32/issues/1867)
- RC310 cooling parameters [#1857](https://github.com/emsesp/EMS-ESP32/issues/1857)
- command `api/device/entities` [#1897](https://github.com/emsesp/EMS-ESP32/issues/1897)
- switchprogmode [#1903]<https://github.com/emsesp/EMS-ESP32/discussions/1903>
## Fixed

View File

@@ -1106,7 +1106,8 @@ void Thermostat::process_RC300Set(std::shared_ptr<const Telegram> telegram) {
has_enumupdate(telegram, hc->reducemode, 5, 1); // 1-outdoor temp threshold, 2-room temp threshold, 3-reduced mode
has_update(telegram, hc->reducetemp, 9);
has_update(telegram, hc->noreducetemp, 12);
has_update(telegram, hc->remoteseltemp, 17); // see https://github.com/emsesp/EMS-ESP32/issues/590
has_enumupdate(telegram, hc->switchProgMode, 13, 1); // 1-level, 2-absolute
has_update(telegram, hc->remoteseltemp, 17); // see https://github.com/emsesp/EMS-ESP32/issues/590
has_update(telegram, hc->boost, 23);
has_update(telegram, hc->boosttime, 24);
has_update(telegram, hc->cooling, 28);
@@ -2280,6 +2281,19 @@ bool Thermostat::set_cooloffdelay(const char * value, const int8_t id) {
return true;
}
bool Thermostat::set_switchProgMode(const char * value, const int8_t id) {
auto hc = heating_circuit(id);
if (hc == nullptr) {
return false;
}
uint8_t set;
if (!Helpers::value2enum(value, set, FL_(enum_switchProgMode))) {
return false;
}
write_command(set_typeids[hc->hc()], 13, set + 1, set_typeids[hc->hc()]);
return true;
}
// sets the thermostat ww circulation working mode, where mode is a string
bool Thermostat::set_wwcircmode(const char * value, const int8_t id) {
uint8_t dhw = id2dhw(id);
@@ -4511,6 +4525,8 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
register_device_value(tag, &hc->coolstart, DeviceValueType::UINT8, FL_(coolstart), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_coolstart), 20, 35);
register_device_value(tag, &hc->coolondelay, DeviceValueType::UINT8, FL_(coolondelay), DeviceValueUOM::HOURS, MAKE_CF_CB(set_coolondelay), 1, 48);
register_device_value(tag, &hc->cooloffdelay, DeviceValueType::UINT8, FL_(cooloffdelay), DeviceValueUOM::HOURS, MAKE_CF_CB(set_cooloffdelay), 1, 48);
register_device_value(
tag, &hc->switchProgMode, DeviceValueType::ENUM, FL_(enum_switchProgMode), FL_(control), DeviceValueUOM::NONE, MAKE_CF_CB(set_switchProgMode));
break;
case EMSdevice::EMS_DEVICE_FLAG_CRF:

View File

@@ -86,6 +86,7 @@ class Thermostat : public EMSdevice {
uint8_t climate;
uint8_t switchonoptimization;
uint8_t statusbyte; // from RC300monitor
uint8_t switchProgMode;
// RC 10
uint8_t reducehours; // night reduce duration
uint16_t reduceminutes; // remaining minutes to night->day
@@ -655,6 +656,7 @@ class Thermostat : public EMSdevice {
bool set_cooling(const char * value, const int8_t id);
bool set_coolondelay(const char * value, const int8_t id);
bool set_cooloffdelay(const char * value, const int8_t id);
bool set_switchProgMode(const char * value, const int8_t id);
};
} // namespace emsesp

View File

@@ -349,6 +349,7 @@ MAKE_ENUM(enum_control1, FL_(rc310), FL_(rc200), FL_(rc100), FL_(rc100h), FL_(tc
MAKE_ENUM(enum_control2, FL_(off), FL_(dash), FL_(rc100), FL_(rc100h), FL_(dash), FL_(rc120rf), FL_(rc220), FL_(single)) // BC400
MAKE_ENUM(enum_switchmode, FL_(off), FL_(eco), FL_(comfort), FL_(heat))
MAKE_ENUM(enum_switchProgMode, FL_(level), FL_(absolute))
MAKE_ENUM(enum_dayOfWeek, FL_(day_mo), FL_(day_tu), FL_(day_we), FL_(day_th), FL_(day_fr), FL_(day_sa), FL_(day_su), FL_(all))
MAKE_ENUM(enum_progMode2, FL_(own_1), FL_(family), FL_(morning), FL_(evening), FL_(am), FL_(pm), FL_(midday), FL_(singles), FL_(seniors), FL_(new), FL_(own_2))

View File

@@ -279,6 +279,8 @@ MAKE_WORD_TRANSLATION(functioning_mode, "functioning mode", "Funktionsweise", "f
MAKE_WORD_TRANSLATION(unmixed, "unmixed", "ungemischt", "", "", "niezmieszany", "", "", "", "", "") // TODO translate
MAKE_WORD_TRANSLATION(unmixedIPM, "unmixed IPM", "ungemischt IPM", "", "", "niezmieszany IPM", "", "", "", "", "") // TODO translate
MAKE_WORD_TRANSLATION(mixed, "mixed IPM", "gemischt IPM", "", "", "zmieszany IPM", "", "", "", "", "") // TODO translate
MAKE_WORD_TRANSLATION(level, "level", "Level") // TODO translate
MAKE_WORD_TRANSLATION(absolute, "absolute", "Absolut") // TODO translate
// mixer
MAKE_WORD_TRANSLATION(stopped, "stopped", "gestoppt", "gestopt", "stoppad", "zatrzymany", "stoppet", "arrêté", "durdu", "fermato", "zastavený")