diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index 12328b4b5..db9a7f184 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -19,6 +19,8 @@ - HP input states [#1723](https://github.com/emsesp/EMS-ESP32/discussions/1723) - holiday settings for rego 3000 [#1735](https://github.com/emsesp/EMS-ESP32/issues/1735) - Added scripts for OTA (scripts/upload.py and upload_cli.py) [#1738](https://github.com/emsesp/EMS-ESP32/issues/1738) +- timeout for remote thermostat emulation [#1680](https://github.com/emsesp/EMS-ESP32/discussions/1680), [#1774](https://github.com/emsesp/EMS-ESP32/issues/1774) +- seltemp/mode for CR120 [#1779](https://github.com/emsesp/EMS-ESP32/discussions/1779) ## Fixed diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index e7cedaef2..612bb0a9c 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -1093,8 +1093,13 @@ 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 - has_update(telegram, hc->mode_new, 21); // for BC400 - has_bitupdate(telegram, hc->mode, 0, 0); // RC300, RC100 + has_update(telegram, hc->mode_new, 21); // for BC400 + // set mode for CR120, https://github.com/emsesp/EMS-ESP32/discussions/1779 + if (Helpers::hasValue(hc->mode_new)) { + has_update(hc->mode, hc->mode_new == 2 ? 1 : 0); + } else { + has_bitupdate(telegram, hc->mode, 0, 0); // RC300, RC100 + } /* telegram->read_value(hc->mode_new, 21); // 0-off, 1-manual, 2-auto if (Helpers::hasValue(hc->mode_new)) { @@ -2815,8 +2820,14 @@ bool Thermostat::set_mode_n(const uint8_t mode, const int8_t id) { case EMSdevice::EMS_DEVICE_FLAG_RC300: case EMSdevice::EMS_DEVICE_FLAG_RC100: case EMSdevice::EMS_DEVICE_FLAG_R3000: - offset = EMS_OFFSET_RCPLUSSet_mode; - set_mode_value = set_mode_value == 2 ? 0xFF : 0; + // CR120, https://github.com/emsesp/EMS-ESP32/discussions/1779 + if (Helpers::hasValue(hc->mode_new)) { + offset = EMS_OFFSET_RCPLUSSet_mode_new; + set_mode_value = set_mode_value == 2 ? 2 : 1; + } else { + offset = EMS_OFFSET_RCPLUSSet_mode; + set_mode_value = set_mode_value == 2 ? 0xFF : 0; + } break; case EMSdevice::EMS_DEVICE_FLAG_JUNKERS: if (has_flags(EMSdevice::EMS_DEVICE_FLAG_JUNKERS_OLD)) { @@ -3546,7 +3557,11 @@ bool Thermostat::set_temperature(const float temperature, const uint8_t mode, co factor = 1; break; case HeatingCircuit::Mode::MANUAL: - offset = 0x0A; // manual offset + if (Helpers::hasValue(hc->mode_new)) { + offset = 22; // manual offset CR120 + } else { + offset = 10; // manual offset + } break; case HeatingCircuit::Mode::TEMPAUTO: offset = 0x08; // auto offset @@ -3617,13 +3632,14 @@ bool Thermostat::set_temperature(const float temperature, const uint8_t mode, co offset = 9; factor = 1; break; - default: - // HeatingCircuit::Mode::AUTO: + default: // seltemp uint8_t mode_ = hc->get_mode(); - if (mode_ == HeatingCircuit::Mode::MANUAL) { - offset = 0x0A; // manual offset + if (Helpers::hasValue(hc->mode_new) && mode_ == HeatingCircuit::Mode::MANUAL) { + offset = 22; // manual offset CR120 + } else if (mode_ == HeatingCircuit::Mode::MANUAL) { + offset = 10; // manual offset } else { - offset = 0x08; // auto offset + offset = 8; // auto offset // special case to reactivate auto temperature, see #737, #746 if (temperature == -1) { factor = 1; diff --git a/src/roomcontrol.h b/src/roomcontrol.h index 627c0d3bd..d2fa4b827 100644 --- a/src/roomcontrol.h +++ b/src/roomcontrol.h @@ -37,7 +37,7 @@ class Roomctrl { private: static constexpr uint32_t SEND_INTERVAL = 15000; // 15 sec - static constexpr uint32_t TIMEOUT = 10800000; // 3 hour + static constexpr uint32_t TIMEOUT = 86400000; // 24 hour static constexpr uint8_t HCS = 4; // max 4 heating circuits enum SendType : uint8_t { TEMP, HUMI }; diff --git a/src/version.h b/src/version.h index b969f3758..0109bf35a 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define EMSESP_APP_VERSION "3.7.0-dev.11" +#define EMSESP_APP_VERSION "3.7.0-dev.12"