diff --git a/packages/climate/climate_sensors.yaml b/packages/climate/climate_sensors.yaml index 6d53612..8ad5e92 100644 --- a/packages/climate/climate_sensors.yaml +++ b/packages/climate/climate_sensors.yaml @@ -105,11 +105,11 @@ sensor: {% set temp_inside = states("sensor.temperature_kai_temperature")|float %} {% set temp_outside = states("sensor.temperature_outside_pirateweather")|float %} {% set inside_max = temp_inside + states("input_number.climate_temp_accuracy")|float %} - {% set inside_min = temp_inside - states("input_number.climate_temp_accuracy")|float %} - {% if temp_inside > target %} - {% if inside_max > temp_outside %} {{ "open window" }} {% endif %} + {% set accuracy = states("input_number.climate_temp_accuracy") |float %} + {% if temp_inside >= target and temp_inside >= (temp_outside - accuracy) %} + {{ "open window" }} {% else %} - {% if temp_inside < min %} {{ "close window" }} {% endif %} + {{ "close window" }} {% endif %}