From d83b56a13cb18f6cc382970241237b0ae2b52fbf Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Sat, 27 Jun 2026 13:03:10 +0200 Subject: [PATCH] calcutae dewtemp for Easycontrol, #3135 --- CHANGELOG_LATEST.md | 1 + src/core/roomcontrol.h | 4 ++-- src/devices/thermostat.cpp | 17 ++++++++--------- src/emsesp_version.h | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index 1d968a2b6..ce20c2f80 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -18,3 +18,4 @@ For more details go to [emsesp.org](https://emsesp.org/). ## Changed - call compute value direct, enlarge TCP stack [#3127](https://github.com/emsesp/EMS-ESP32/discussions/3127) +- Dewtemperature for Easycontrol calculated by ems-esp [3135](https://github.com/emsesp/EMS-ESP32/issues/3135) diff --git a/src/core/roomcontrol.h b/src/core/roomcontrol.h index 5b361cfe3..2bc61c1e5 100644 --- a/src/core/roomcontrol.h +++ b/src/core/roomcontrol.h @@ -34,7 +34,8 @@ class Roomctrl { static bool is_remote(const uint8_t hc) { return (hc < 4 && remotetemp_[hc] != EMS_VALUE_INT16_NOTSET); } - static void set_timeout(uint8_t t); + static void set_timeout(uint8_t t); + static int16_t calc_dew(int16_t temp, uint8_t hum); private: static constexpr uint32_t SEND_INTERVAL = 15000; // 15 sec @@ -50,7 +51,6 @@ class Roomctrl { static void nack_write(); static void ack_write(); static void replyF7(uint8_t addr, uint8_t dst, uint8_t offset, uint8_t typehh, uint8_t typeh, uint8_t typel, uint8_t hc); - static int16_t calc_dew(int16_t temp, uint8_t hum); static bool switch_off_[HCS]; static uint32_t send_time_[HCS]; diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index eb9b2ef01..8f5441cc3 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -810,16 +810,15 @@ void Thermostat::process_RemoteTemp(std::shared_ptr telegram) { // e.g. "38 10 FF 00 03 7B 08 24 00 4B" void Thermostat::process_RemoteHumidity(std::shared_ptr telegram) { // has_update(telegram, dewtemperature_, 0); // this is int8 - has_update(telegram, humidity_, 1); - has_update(telegram, dewtemperature_, 2); // this is int16 // some thermostats use short telegram with int8 dewpoint, https://github.com/emsesp/EMS-ESP32/issues/1491 - if (telegram->offset == 0 && telegram->message_length < 4) { - int8_t dew = dewtemperature_ / 10; - telegram->read_value(dew, 0); - if (dew != EMS_VALUE_INT8_NOTSET && dewtemperature_ != dew * 10) { - dewtemperature_ = dew * 10; - has_update(dewtemperature_); - } + // but it's not a dewpoint in offset 0, removed, see https://github.com/emsesp/EMS-ESP32/issues/3135 + has_update(telegram, humidity_, 1); + // has_update(telegram, dewtemperature_, 2); // this is int16 + int16_t dew = EMS_VALUE_INT16_NOTSET; + if (telegram->read_value(dew, 2)) { + has_update(dewtemperature_, dew); + } else if (telegram->offset == 0 && telegram->message_length < 4) { + has_update(dewtemperature_, Roomctrl::calc_dew(tempsensor1_, humidity_)); } } diff --git a/src/emsesp_version.h b/src/emsesp_version.h index 74e1e397b..3928edd22 100644 --- a/src/emsesp_version.h +++ b/src/emsesp_version.h @@ -1 +1 @@ -#define EMSESP_APP_VERSION "3.8.3-dev.7" +#define EMSESP_APP_VERSION "3.8.3-dev.8"