From 430396832f82cde51ff3ee3370ef20d9753e59e8 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Thu, 24 Nov 2022 15:09:39 +0100 Subject: [PATCH] Fix thermostat ramp-off time Fix thermostat ramp-off time (#16424) --- tasmota/tasmota_xdrv_driver/xdrv_39_thermostat.ino | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_39_thermostat.ino b/tasmota/tasmota_xdrv_driver/xdrv_39_thermostat.ino index ca1f39ec7..ed721bb22 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_39_thermostat.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_39_thermostat.ino @@ -428,6 +428,14 @@ void ThermostatCtrState(uint8_t ctr_output) break; // Ramp-up controller (predictive) case CTR_RAMP_UP: + // If ramp-up off time counter has been initialized + // AND ramp-up off time counter value reached + if ((Thermostat[ctr_output].time_ctr_checkpoint != 0) && + (TasmotaGlobal.uptime >= Thermostat[ctr_output].time_ctr_checkpoint)) { + // Reset times + Thermostat[ctr_output].time_ctr_checkpoint = 0; + Thermostat[ctr_output].timestamp_rampup_start = TasmotaGlobal.uptime; + } break; #ifdef USE_PI_AUTOTUNING // PI autotune