From 7349bc9ebf0aa46bc14be11b76ae4c4280455433 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Thu, 4 Jun 2026 12:20:12 +0200 Subject: [PATCH 1/2] reset system status --- src/core/emsesp.cpp | 32 ++++++++++++++++++++++---------- src/web/WebStatusService.cpp | 4 ++++ 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/core/emsesp.cpp b/src/core/emsesp.cpp index dbbc79b2f..6554b20ed 100644 --- a/src/core/emsesp.cpp +++ b/src/core/emsesp.cpp @@ -1864,16 +1864,9 @@ void EMSESP::loop() { webLogService.loop(); // log in Web UI // run the loop, unless we're in the middle of an OTA upload - if (EMSESP::system_.systemStatus() == SYSTEM_STATUS::SYSTEM_STATUS_NORMAL || EMSESP::system_.systemStatus() == SYSTEM_STATUS::SYSTEM_STATUS_INVALID_GPIO) { - // check for GPIO Errors - this is called once when booting - if (EMSESP::system_.systemStatus() == SYSTEM_STATUS::SYSTEM_STATUS_INVALID_GPIO) { - static bool only_once = false; - if (!only_once) { - LOG_ERROR("Invalid GPIOs used. Please check your settings and the system log"); - only_once = true; - } - } - + // if (EMSESP::system_.systemStatus() == SYSTEM_STATUS::SYSTEM_STATUS_NORMAL || EMSESP::system_.systemStatus() == SYSTEM_STATUS::SYSTEM_STATUS_INVALID_GPIO) { + if (EMSESP::system_.systemStatus() != SYSTEM_STATUS::SYSTEM_STATUS_PENDING_UPLOAD + && EMSESP::system_.systemStatus() != SYSTEM_STATUS::SYSTEM_STATUS_UPLOADING) { // loop through the services rxservice_.loop(); // process any incoming Rx telegrams shower_.loop(); // check for shower on/off @@ -1887,6 +1880,14 @@ void EMSESP::loop() { } scheduled_fetch_values(); // force a query on the EMS devices to fetch latest data at a set interval (1 min) } + // check for GPIO Errors - this is called once when booting + if (EMSESP::system_.systemStatus() == SYSTEM_STATUS::SYSTEM_STATUS_INVALID_GPIO) { + static bool only_once = false; + if (!only_once) { + LOG_ERROR("Invalid GPIOs used. Please check your settings and the system log"); + only_once = true; + } + } if (EMSESP::system_.systemStatus() == SYSTEM_STATUS::SYSTEM_STATUS_PENDING_UPLOAD) { // start an upload from a URL, assuming the URL exists and set from a previous pass @@ -1899,6 +1900,17 @@ void EMSESP::loop() { } } + // reset status after 5 Minutes + if (EMSESP::system_.systemStatus() != SYSTEM_STATUS::SYSTEM_STATUS_NORMAL) { + static uint32_t starttime = 0; + if (starttime == 0) { + starttime = uuid::get_uptime_ms(); + } else if (uuid::get_uptime_ms() - starttime > 300000) { + starttime = 0; + EMSESP::system_.systemStatus(SYSTEM_STATUS::SYSTEM_STATUS_NORMAL); + } + } + // telnet service #ifndef EMSESP_STANDALONE if (system_.telnet_enabled()) { diff --git a/src/web/WebStatusService.cpp b/src/web/WebStatusService.cpp index d97c4d4e8..8cb9e5839 100644 --- a/src/web/WebStatusService.cpp +++ b/src/web/WebStatusService.cpp @@ -177,6 +177,10 @@ void WebStatusService::systemStatus(AsyncWebServerRequest * request) { // we're ready to do the actual restart ASAP EMSESP::system_.systemStatus(SYSTEM_STATUS::SYSTEM_STATUS_RESTART_REQUESTED); } + if (EMSESP::system_.systemStatus() == SYSTEM_STATUS::SYSTEM_STATUS_ERROR_UPLOAD) { + // error is reported, back to normal state + EMSESP::system_.systemStatus(SYSTEM_STATUS::SYSTEM_STATUS_NORMAL); + } #endif From f99ca7f013c648b467fe6105418187f4422e653b Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Thu, 4 Jun 2026 12:21:16 +0200 Subject: [PATCH 2/2] seltemp write in cooling mode #1781 --- src/devices/thermostat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index 4bb002096..eb9b2ef01 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -4189,7 +4189,7 @@ bool Thermostat::set_temperature(const float temperature, const uint8_t mode, co if (model == EMSdevice::EMS_DEVICE_FLAG_CR120 && mode_ == HeatingCircuit::Mode::MANUAL) { offset = 22; // manual offset CR120 } else if (mode_ == HeatingCircuit::Mode::MANUAL) { - offset = 10; // manual offset + offset = hc->hpoperatingstate == 2 ? 17 : 10; // cooling or manual offset } else { offset = 8; // auto offset // special case to reactivate auto temperature, see #737, #746