Hab's übersichtlicher hinbekommen, und auch einen Fehler behoben, glaube ich: alias: Dyn Temp Shift Door description: Automatically adjusts the sensitivity based on the temperature difference. triggers: - trigger: state entity_id: sensor.temp_shift_door actions: - variables: temp_innen_1: '{{ states(''sensor.temp_combi'') | float(24) }}' temp_innen_2: '{{ states(''sensor.wohnzimmer_tp357_klein_temperature'') | float(24) }}' temp_aussen: '{{ states(''sensor.aktuelle_wetter_temperatur'') | float(15) }}' temp_shift_door: '{{ states(''sensor.temp_shift_door'') | float(0) }}' is_winter: '{{ temp_aussen < temp_innen_1 }}' delta: '{{ (temp_aussen - temp_innen_1) | abs }}' threshold: '{{ (-1.0 if is_winter else 1.0) * (0.03 + (delta * 0.005)) }}' - choose: - conditions: - condition: state entity_id: light.tapo_l530_balkon state: 'off' - condition: template value_template: >- {{ (is_winter and temp_shift_door < threshold) or (not is_winter and temp_shift_door > threshold) }} sequence: - action: light.turn_on target: entity_id: light.tapo_l530_balkon - conditions: - condition: state entity_id: light.tapo_l530_balkon state: 'on' - condition: template value_template: >- {{ (is_winter and temp_shift_door > 0.01) or (not is_winter and temp_shift_door < -0.01) }} sequence: - action: light.turn_off target: entity_id: light.tapo_l530_balkon temp_innen_2 braucht man, glaube ich, gar nicht, da dieser Wert ja schon in temp_shift_door ist.