mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-03-14 05:36:34 +03:00
read connect seltemp after mode/icon to create HA-climate
This commit is contained in:
@@ -129,9 +129,13 @@ void Connect::process_roomThermostat(std::shared_ptr<const Telegram> telegram) {
|
||||
}
|
||||
has_update(telegram, rc->temp_, 0);
|
||||
has_update(telegram, rc->humidity_, 2); // could show -3 if not set
|
||||
// make sure we have read mode and icon, needed for ha climate
|
||||
if (!Mqtt::ha_enabled() || (Helpers::hasValue(rc->mode_) && Helpers::hasValue(rc->icon_))) {
|
||||
has_update(telegram, rc->seltemp_, 3);
|
||||
}
|
||||
|
||||
// calculate dew temperature
|
||||
if (rc->humidity_ >= 0 && rc->humidity_ <= 100) {
|
||||
const float k2 = 17.62;
|
||||
const float k3 = 243.12;
|
||||
const float t = (float)rc->temp_ / 10;
|
||||
@@ -139,6 +143,7 @@ void Connect::process_roomThermostat(std::shared_ptr<const Telegram> telegram) {
|
||||
int16_t dt = (10 * k3 * (((k2 * t) / (k3 + t)) + log(h)) / (((k2 * k3) / (k3 + t)) - log(h)));
|
||||
has_update(rc->dewtemp_, dt);
|
||||
}
|
||||
}
|
||||
|
||||
// gateway(0x48) W gateway(0x50), ?(0x0B42), data: 01 // icon in offset 0
|
||||
// gateway(0x48) W gateway(0x50), ?(0x0B42), data: 00 4B 00 FC 00 63 00 68 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 (offset 1)
|
||||
|
||||
Reference in New Issue
Block a user