From 1ae2a624f768d22a0bcd6f5a349f5f8e1b2a90a1 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Mon, 11 Dec 2023 09:12:23 +0100 Subject: [PATCH] add back lowres dewtemp, #1491 --- src/devices/thermostat.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index c0f6176bb..30602656a 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -712,6 +712,15 @@ 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_INT_NOTSET && dewtemperature_ != dew * 10) { + dewtemperature_ = dew * 10; + has_update(dewtemperature_); + } + } } // 0x273 - for reading temperaturcorrection from the RC100H remote thermostat (0x38, 0x39, ..)