From 34d1ad936738681e3c07d4a1dd309f58f941857d Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Tue, 2 Aug 2022 20:31:36 +0200 Subject: [PATCH] Recommended: threshold --- packages/climate/climate_sensors.yaml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/climate/climate_sensors.yaml b/packages/climate/climate_sensors.yaml index 600d13a..6d53612 100644 --- a/packages/climate/climate_sensors.yaml +++ b/packages/climate/climate_sensors.yaml @@ -104,11 +104,14 @@ sensor: {% set target = states("sensor.climate_temp")|float %} {% set temp_inside = states("sensor.temperature_kai_temperature")|float %} {% set temp_outside = states("sensor.temperature_outside_pirateweather")|float %} - {% if temp_inside > max %} - {% if temp_inside > temp_outside %} {{ "open window" }} - {% else %} {{ "close window" }} {% endif %} + {% 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 %} + {% else %} + {% if temp_inside < min %} {{ "close window" }} {% endif %} {% endif %} - {% if temp_inside < min %} {{ "turn the heater on" }} {% endif %} + ## -----------------------------------------------------------------------------------------------##