diff --git a/esphome/components/tuya/climate/tuya_climate.cpp b/esphome/components/tuya/climate/tuya_climate.cpp index 7dbf33878a..111d090c3e 100644 --- a/esphome/components/tuya/climate/tuya_climate.cpp +++ b/esphome/components/tuya/climate/tuya_climate.cpp @@ -513,14 +513,14 @@ void TuyaClimate::compute_state_() { } else { // Fallback to active state calc based on temp and hysteresis const float temp_diff = this->target_temperature - this->current_temperature; - if (std::abs(temp_diff) > this->hysteresis_) { - if (this->supports_heat_ && temp_diff > 0) { - target_action = climate::CLIMATE_ACTION_HEATING; - this->mode = climate::CLIMATE_MODE_HEAT; - } else if (this->supports_cool_ && temp_diff < 0) { - target_action = climate::CLIMATE_ACTION_COOLING; - this->mode = climate::CLIMATE_MODE_COOL; - } + if ((this->supports_heat_ && temp_diff >= this->hysteresis_) || + (this->action == climate::CLIMATE_ACTION_HEATING && temp_diff > 0)) { + target_action = climate::CLIMATE_ACTION_HEATING; + this->mode = climate::CLIMATE_MODE_HEAT; + } else if ((this->supports_cool_ && temp_diff <= -this->hysteresis_) || + (this->action == climate::CLIMATE_ACTION_COOLING && temp_diff < 0)) { + target_action = climate::CLIMATE_ACTION_COOLING; + this->mode = climate::CLIMATE_MODE_COOL; } }