Hello,
I have the following automation that does not work correctly:
alias: Heating & Cooing
description: ""
trigger:
- platform: homeassistant
event: start
- platform: event
event_type: automation_reloaded
- platform: state
entity_id: climate.living_room_thermostat
- platform: state
entity_id: input_boolean.heating_cooling_auto
to: "on"
- platform: state
entity_id:
- schedule.heating_active_time
- schedule.cooling_active_time
- platform: state
entity_id:
- timer.heating_cooling_boost_timer
condition:
- condition: state
entity_id: input_boolean.heating_cooling_auto
state: "on"
- condition: or
conditions:
- condition: state
entity_id: climate.living_room_thermostat
state: heat
- condition: state
entity_id: climate.living_room_thermostat
state: cool
action:
- variables:
temperature: 21
- choose:
- conditions:
- condition: or
conditions:
- condition: state
entity_id: alarm_control_panel.alarmo
state: armed_away
- condition: state
entity_id: alarm_control_panel.alarmo
state: armed_vacation
- condition: and
conditions:
- condition: state
entity_id: climate.living_room_thermostat
state: heat
- condition: state
entity_id: schedule.heating_active_time
state: "off"
- condition: and
conditions:
- condition: state
entity_id: climate.living_room_thermostat
state: cool
- condition: state
entity_id: schedule.cooling_active_time
state: "off"
sequence:
- variables:
temperature: >-
{{ states("input_number.heating_cooling_eco_temperature") |
float }}
- conditions:
- condition: state
entity_id: climate.living_room_thermostat
state: heat
- condition: template
value_template: "{{ states('sensor.home_hours_of_sun_today') | float > 5 }}"
sequence:
- variables:
temperature: >-
{{ states("input_number.heating_cooling_active_temperature") |
float - 1 }}
default:
- variables:
temperature: >-
{{ states("input_number.heating_cooling_active_temperature") | float
}}
- if:
- condition: state
entity_id: timer.heating_cooling_boost_timer
state: active
then:
- choose:
- conditions:
- condition: state
entity_id: climate.living_room_thermostat
state: heat
sequence:
- variables:
temperature: "{{ temperature | float + 1.5 }}"
- conditions:
- condition: state
entity_id: climate.living_room_thermostat
state: cool
sequence:
- variables:
temperature: "{{ temperature | float - 1.5 }}"
- service: climate.set_temperature
data:
temperature: "{{ temperature | float }}"
target:
entity_id: climate.living_room_thermostat
mode: single
The Problem is that the variable “temperature” is changed throughout the automation but at the end it sets the Thermostat to the value that is defined in the beginning and not the value that has been set in the different choose blocks.
Can someone point me in the right direction?