From 1040450cb2dcc05e55c94570d2e3e2e503dc39c9 Mon Sep 17 00:00:00 2001 From: proddy Date: Sun, 28 Jun 2026 16:03:31 +0200 Subject: [PATCH 1/2] fix set datetime for junkers --- src/devices/thermostat.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index 5a2de88fa..72076a2c4 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -3077,7 +3077,6 @@ bool Thermostat::set_datetime(const char * value, const int8_t id) { data[6] = (tm_->tm_wday + 6) % 7; // Bosch counts from Mo, time from Su data[7] = (id == 0) ? 2 : tm_->tm_isdst + 2; // set DST and flag for ext. clock if (model() == EMSdevice::EMS_DEVICE_FLAG_JUNKERS) { - data[6]++; // Junkers use 1-7; data[7] = 0; } } else if (dt.length() == 23) { @@ -3101,6 +3100,10 @@ bool Thermostat::set_datetime(const char * value, const int8_t id) { return false; } + if (model() == EMSdevice::EMS_DEVICE_FLAG_JUNKERS) { + data[6]++; // Junkers use 1-7 for day of the week + } + // LOG_INFO("Setting date and time: %02d.%02d.2%03d-%02d:%02d:%02d-%d-%d", data[3], data[1], data[0], data[2], data[4], data[5], data[6], data[7]); write_command(EMS_TYPE_time, 0, data, 8, EMS_TYPE_time); From 04e787fd800856ea6b51e1b04f1f48df941f9dbe Mon Sep 17 00:00:00 2001 From: proddy Date: Sun, 28 Jun 2026 16:09:22 +0200 Subject: [PATCH 2/2] update --- CHANGELOG_LATEST.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index 176d45e78..bcdc9044d 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -14,8 +14,9 @@ For more details go to [emsesp.org](https://emsesp.org/). - signed value for solarInfuence [#3077](https://github.com/emsesp/EMS-ESP32/issues/3077) - TLS support with 4MB boards without PSRAM -- Prevent system crash during WiFi network discovery on ESP32-S3 hardware [#3128](https://github.com/emsesp/EMS-ESP32/pull/3128) +- prevent system crash during WiFi network discovery on ESP32-S3 hardware [#3128](https://github.com/emsesp/EMS-ESP32/pull/3128) - check arithmetric operations on strings [#3127](https://github.com/emsesp/EMS-ESP32/discussions/3127) +- fix setting date/time on Junkers thermostats ## Changed