Automated temperature control (target temperature sensor, door/window, heat-once)

Note: The blueprint was developed for my own case. You can use it as a draft for adaption to your own case.

The automation switches the climate on, if the temperature in room below T_goal-T_delta, and switches the climate off, if the temperature above the goal temperaute T_goal.
Additionaly the climate is switched on/off by the door/window sensor (defined as a group).
Furthermore there is a “input_boolean.flag” to heat the room once and reset to a T_min temperature after the temperature is reached (use it, if you want asleep in a warm room, but don’t need this temperature whole night).
Unfortunately, since it is not possible to use template_trigger in blueprints an the moment, you need additional binary_sensors defined outside of the blueprint, for the case T_curr > T_goal (current temperature above goal temperature), and T < T_goal - T_delta (current temperature is to low).

      room_above_goal_t:
        friendly_name: "room: T > T_goal"
        value_template: >-
          {{ states('sensor.room_t') | float > state_attr('climate.room_thermostat', 'temperature') |float }}
      room_below_goal_t:
        friendly_name: "room: T < T_goal-dT"
        value_template: >-
          {{ states('sensor.room_t') | float < (state_attr('climate.room_thermostat', 'temperature') |float - states('input_number.t_delta') | float) }}

Also you need a input_boolean for manually on/off the climate.
In my case I switch this flag if nobody is at home (off) or just arrived (on), as well as in this automation by “door/window” group.

All what you have to do, if it’s running, is to set your T_goal temperature manually at thermostat itself or with an automation. I set 4-5 different temperatures during the day by automations.

There is a deactived debbuger within automation notify.debugger_file. Delete it, if you get problems with the debbuger, or replace by your own notification.

The “auto”-state will be overwritten by “heat” state.

Here some pictures and graphs from UI.
Climate - control:

And graph of the controlled temperate (red = T_goal, green = T_curr, blue = T_goal - T_delta, white = on/off state of climate)

Here the screenshot of the automatisation:

Here is the blueprint itself:

blueprint:
  name: Automatisation of heat controll
  domain: automation
  input:
    climate_target:
      name: Thermostat
      description: Thermostat to be controlled
      selector:
        entity:
          domain: climate
    t_current_target:
      name: T_curr
      description: Current temperature in room.
      selector:
        entity:
          domain: sensor
    climate_trigger_t_above:
      name: Flag T > T_goal
      description: Flag, it the temperature T above T_goal
      selector:
        entity:
          domain: binary_sensor
    climate_trigger_t_below:
      name: Flag T < T_goal - T_delta
      description: Flag, it the temperature T below T_goal - T_delta
      selector:
        entity:
          domain: binary_sensor
    open_close_target:
      name: Door | Window - group
      description: Group of sensors for switching off the climate in "on"-state
      selector:
        entity:
          domain: group
    climate_auto_control_target:
      name: Manual switch for climate 
      description: Flag for activating / deactivating of climate control
      selector:
        entity:
          domain: input_boolean
    climate_reset_heating_control_target:
      name: Manual switch for reset of temperature 
      description: Reset T_goal to T_min after reaching T_goal
      selector:
        entity:
          domain: input_boolean
    t_min_target:
      name: T_min
      description: Minimal temperature is after reset of temperature in (heating once) mode.
      default: 17
      selector:
        number:
          min: 10.0
          max: 30.0
          step: 0.5
          unit_of_measurement: °C
    t_delta_target:
      name: T_delta
      description: Maximal deviation of target temperature. T_low = T_goal - T_delta
      default: input_number.system_delta_goal_t
      selector:
        entity:
          domain: input_number
mode: restart

variables:
  climate_target: !input climate_target
  t_current_target: !input t_current_target
  open_close_target: !input open_close_target
  climate_auto_control_target: !input climate_auto_control_target
  climate_reset_heating_control_target: !input climate_reset_heating_control_target
  climate_trigger_t_above: !input climate_trigger_t_above
  climate_trigger_t_below: !input climate_trigger_t_below

  t_min_target: !input t_min_target
  t_delta_target: !input t_delta_target
  t_goal: "{{state_attr(climate_target, 'temperature') | float}}"
  t_current: "{{states[t_current_target].state | float}}"
  t_delta: "{{states[t_delta_target].state | float}}"
  
  debug_mode: 'off'
  
trigger:
  - platform: state
    entity_id: !input open_close_target
    for: 00:00:45
  - platform: state
    entity_id: !input climate_target
    to: auto
  - platform: state
    entity_id: !input climate_auto_control_target
  - platform: state
    entity_id: !input climate_trigger_t_above
    to: 'on'
    from: 'off'
  - platform: state
    entity_id: !input climate_trigger_t_below
    to: 'on'
    from: 'off'
  - platform: state
    entity_id: !input climate_target
    to: heat
    from: 'on'

condition: []

action:
  - choose:
    - conditions:
      - condition: template
        value_template: "{{ debug_mode  == 'on' }}"
      sequence:
      - service: notify.debugger_file
        data:
          message: |-
            ####
            Start of automation: {{now().strftime('%Y-%m-%d %H:%M:%S')}}
            from_state: {{ trigger.from_state.state }}
            to_state: {{ trigger.to_state.state }}
            entity_id: {{ trigger.from_state.entity_id }}
            climate_target: {{climate_target }}
            t_delta_target: {{t_delta_target }}
            t_current_target: {{t_current_target }}
            t_current: {{t_current }}
            open_close_target: {{open_close_target }}
            climate_auto_control_target: {{climate_auto_control_target }}
            climate_trigger_t_above: {{climate_trigger_t_above}}
            climate_trigger_t_below: {{climate_trigger_t_below}}
            t_min_target: {{t_min_target }}
            climate_reset_heating_control_target: {{climate_reset_heating_control_target }}
            t_goal: {{t_goal}}
            t_delta: {{t_delta + 1.0}}
            ####
    default: []
  - choose:
    - conditions:
      - condition: template
        value_template: '{{ trigger.from_state.entity_id  == open_close_target}}'
      sequence:
      - choose:
        - conditions:
          - condition: template
            value_template: "{{ debug_mode  == 'on' }}"
          sequence:
          - service: notify.debugger_file
            data:
              message: Called by door group
        default: []      
      - choose:
        - conditions:
          - condition: state
            entity_id: !input open_close_target
            state: 'on'
          sequence:
          # door/window open -> check hold_temperature
          - choose:
            - conditions:
              - condition: state
                entity_id: !input climate_auto_control_target
                state: 'on'
              sequence:
              #  hold_temperature on -> turn off hold_temperature
              - service: input_boolean.turn_off
                data: {}
                entity_id: !input climate_auto_control_target
            default:
            # hold_temperature off -> check climate on
            - choose:
              - conditions:
                - condition: not
                  conditions:
                  - condition: state
                    entity_id: !input climate_target
                    state: 'off'
                sequence:
                #  climate on -> turn off
                - service: climate.turn_off
                  data: {}
                  entity_id: !input climate_target
              default: [] #climate already off -> continue
        default:
        # door/window closed -> check hold_temperature
        - choose:
          - conditions:
            - condition: state
              entity_id: !input climate_auto_control_target
              state: 'off'
            sequence:
            # hold_temperature off -> turn hold_temperature on
            - service: input_boolean.turn_on
              data: {}
              entity_id: !input climate_auto_control_target
          default: [] # hold_temperature on -> continue
    - conditions:
      - condition: template
        value_template: '{{ trigger.from_state.entity_id  == climate_auto_control_target}}'
      sequence:
      #  Called by hold_temperature
      - choose:
        - conditions:
          - condition: state
            entity_id: !input climate_auto_control_target
            state: 'off'
          sequence:
          #  hold_temperature on to off -> check climate on
          - choose:
            - conditions:
              - condition: not
                conditions:
                - condition: state
                  entity_id: !input climate_target
                  state: 'off'
              sequence:
              #  climate on -> turn off
              - service: climate.turn_off
                data: {}
                entity_id: !input climate_target
            default: [] #  climate off -> continue
        default:
        #  hold_temperature off to on -> check if t < goal
        - choose:
          - conditions:
            - condition: template
              value_template: '{{ t_current  < t_goal }}'
            sequence:
            #  t < goal is true -> check if heat on
            - choose:
              - conditions:
                - condition: state
                  entity_id: !input climate_target
                  state: 'off'
                sequence:
                #  climate off -> turn climate to heat mode
                - service: climate.set_hvac_mode
                  data:
                    hvac_mode: heat
                  entity_id: !input climate_target
              default: [] # climate already on -> continue
          default: [] # t < goal is false -> continue
    - conditions:
      - condition: or
        conditions:
        - condition: and
          conditions:
          - condition: template
            value_template: '{{ trigger.from_state.entity_id  == climate_target}}'
          - condition: template
            value_template: '{{ trigger.to_state.state  == trigger.from_state.state}}'
        - condition: and
          conditions:
          - condition: template
            value_template: '{{ trigger.from_state.entity_id  == t_current_target}}'
          - condition: template
            value_template: '{{ trigger.to_state.state  != trigger.from_state.state}}'
        - condition: and
          conditions:
          - condition: template
            value_template: '{{ trigger.from_state.entity_id  == climate_trigger_t_above}}'
          - condition: template
            value_template: '{{ trigger.to_state.state  != trigger.from_state.state}}'
        - condition: and
          conditions:
          - condition: template
            value_template: '{{ trigger.from_state.entity_id  == climate_trigger_t_below}}'
          - condition: template
            value_template: '{{ trigger.to_state.state  != trigger.from_state.state}}'
      sequence:
      # 'Called by climate temperature or sensor: check hold_temperature on'
      - choose:
        - conditions:
          - condition: or
            conditions:
            - condition: and
              conditions:
              - condition: template
                value_template: '{{ trigger.from_state.entity_id  == climate_target}}'
              - condition: template
                value_template: '{{ trigger.to_state.state  == trigger.from_state.state}}'
              - condition: template
                value_template: '{{ t_current  < t_goal }}'
            - condition: and
              conditions:
              - condition: template
                value_template: '{{ trigger.from_state.entity_id  != climate_target}}'
              - condition: template
                value_template: '{{ trigger.to_state.state  != trigger.from_state.state}}'
              - condition: template
                value_template: '{{ t_current  < t_goal - t_delta }}'
          sequence:
          #  T < goal - d for sensor or T < goal for climate is true -> check if heat on
          - choose:
            - conditions:
              - condition: state
                entity_id: !input climate_target
                state: 'off'
              sequence:
              #  climate off -> turn climate to heat
              - service: climate.set_hvac_mode
                data:
                  hvac_mode: heat
                entity_id: !input climate_target
            default: [] #  climate already on -> continue
        - conditions:
          - condition: template
            value_template: '{{ t_current > t_goal  }}'
          sequence:
          #  '"T > goal is true -> turn off climate,  check if heat-once"'
          - choose:
            - conditions:
              - condition: state
                entity_id: !input climate_reset_heating_control_target
                state: 'on'
              sequence:
              #  heat once is true -> set T_min, reset heat once
              - service: input_boolean.turn_off
                data: {}
                entity_id: !input climate_reset_heating_control_target
              - service: climate.set_temperature
                data:
                  temperature: '{{t_min_target }}'
                entity_id: !input climate_target
            default: [] #  heat once is off -> continue
          - service: climate.turn_off
            data: {}
            entity_id: !input climate_target            
        default: [] #  Tgoal - d <= T <= Tgoal by sensor -> continue
    - conditions:
      - condition: and
        conditions:
        - condition: template
          value_template: '{{ trigger.from_state.entity_id  == climate_target}}'
        - condition: template
          value_template: '{{ trigger.to_state.state  != trigger.from_state.state}}'
      sequence:
      #  Called by climate state
      - choose:
        - conditions:
          - condition: state
            entity_id: !input climate_target
            state: auto
          sequence:
          #  '"climate auto -> auto to heat"'
          - service: climate.set_hvac_mode
            data:
              hvac_mode: heat
            entity_id: !input climate_target
        - conditions:
          - condition: state
            entity_id: !input climate_target
            state: heat
          sequence:
          #  climate to heat -> check if hold_temperature is on
          - choose:
            - conditions:
              - condition: state
                entity_id: !input climate_auto_control_target
                state: 'off'
              sequence:
              # 'by climate on to heat: hold_temperature off -> turn on'
              - service: input_boolean.turn_on
                data: {}
                entity_id: !input climate_auto_control_target
            default: [] #  'by climate on to heat: hold_temperature on -> continue'
        default: []  #  climate not auto and not to heat -> just continue
    default: []  #  Unknown trigger case
    #  '#### End of automation ####'
8 Likes

das sieht phantastisch aus and ist genau was ich benötige. leider lässt sich der blueprint nicht importieren:

“No valid blueprint found in the topic. Blueprint syntax blocks need to be marked as YAML or no syntax.”

thanks a lot

Same here… i get it also in other blueprints…

import doesnt work

Import is not working. I think you must remove the YAML above the other YAML for import to work.

I uploaded the @iwanttobeafriendofha 's code to my github for testing purpose and it’s importing fine. You may use the link, until it’s fixed.
https://raw.githubusercontent.com/mj1985/ha-blueprint/main/heating.yaml

I just verified this url works and the one linked to this page is still down

thank you mj1985

Hello, I’m new to HA. where exactly do I add T_curr> T_goal and T <T_goal - T_delta. In the config?

hey Pulsaro,
it is just a template - binary_sensor give you ‘on’ or ‘off’ if you ar above or below the goal temperature. In my case it looks like:

binary_sensor:
  - platform: template
      kinderzimmer_above_goal_t:
        friendly_name: "Kinderzimmer: T > T_goal"
        value_template: >-
          {{ states('sensor.kinderzimmer_t') | float > state_attr('climate.kinderzimmer_thermostat', 'temperature') |float }}
      kinderzimmer_below_goal_t:
        friendly_name: "Kinderzimmer: T < T_goal-dT"
        value_template: >-
          {{ states('sensor.kinderzimmer_t') | float < (state_attr('climate.kinderzimmer_thermostat', 'temperature') |float - states('input_number.system_delta_goal_t') | float) }}
1 Like

thank you!

With trigger-id it is much easier to implement.
Here the simplified version of the blueprint. I’ve deleted “heat-ones”, since I haven’t use it during the last winter at all.

blueprint:
  name: Heizungssteuerung
  domain: automation
  input:
    climate_target:
      name: Thermostat
      description: Thermostat to be controlled
      selector:
        entity:
          domain: climate
    t_current_target:
      name: T_curr
      description: Current temperature in room.
      selector:
        entity:
          domain: sensor
    climate_trigger_t_above:
      name: Flag T > T_goal
      description: Flag, it the temperature T above T_goal
      selector:
        entity:
          domain: binary_sensor
    climate_trigger_t_below:
      name: Flag T < T_goal - T_delta
      description: Flag, it the temperature T below T_goal - T_delta
      selector:
        entity:
          domain: binary_sensor
    open_close_target:
      name: Door | Window - group
      description: Group of sensors for switching off the climate in "on"-state
      selector:
        entity:
          domain: group
    climate_auto_control_target:
      name: Manual switch for climate 
      description: Flag for activating / deactivating of climate control
      selector:
        entity:
          domain: input_boolean
mode: queued

variables:
  climate_target: !input climate_target
  t_current_target: !input t_current_target
  open_close_target: !input open_close_target
  climate_auto_control_target: !input climate_auto_control_target
  climate_trigger_t_above: !input climate_trigger_t_above
  climate_trigger_t_below: !input climate_trigger_t_below

  t_goal: "{{state_attr(climate_target, 'temperature') | float}}"
  t_current: "{{states[t_current_target].state | float}}"

  debug_mode: 'off'
  
trigger:
  - platform: state
    entity_id: !input open_close_target
    for: 00:00:45
    from: 'off'
    to: 'on'
    id: trigger_open
  - platform: state
    entity_id: !input open_close_target
    from: 'on'
    to: 'off'
    id: trigger_close
  - platform: state
    entity_id: !input climate_auto_control_target
    from: 'on'
    to: 'off'
    id: trigger_steuerung_off
  - platform: state
    entity_id: !input climate_auto_control_target
    from: 'off'
    to: 'on'
    id: trigger_steuerung_on
  - platform: state
    entity_id: !input climate_trigger_t_above
    to: 'on'
    from: 'off'
    id: trigger_t_above
  - platform: state
    entity_id: !input climate_trigger_t_below
    to: 'on'
    from: 'off'
    id: trigger_t_below
  - platform: state
    entity_id: !input climate_target
    to: heat
    id: climate_to_heat
  - platform: state
    entity_id: !input climate_target
    to: auto
    id: climate_to_auto

condition: []

action:
  - choose:
###############################################################################
###############################################################################
    - conditions:
      - condition: trigger
        id: trigger_steuerung_off
      sequence:
      #  hold_temperature on to off -> check climate on
      - choose:
        - conditions: # check if on or auto
          - condition: not
            conditions:
            - condition: state
              entity_id: !input climate_target
              state: 'off'
          sequence:
          #  climate on -> turn off
          - service: climate.turn_off
            data: {}
            entity_id: !input climate_target
        default: [] #  climate off -> continue
###############################################################################
###############################################################################
    - conditions:
      - condition: trigger
        id: trigger_steuerung_on
      sequence:
      #  Called by hold_temperature
      #  hold_temperature off to on -> check if t < goal
      - choose:
        - conditions:
          - condition: template
            value_template: '{{ t_current  < t_goal }}'
          sequence:
          #  t < goal is true -> check if heat on
          - choose:
            - conditions:
              - condition: state
                entity_id: !input climate_target
                state: 'off'
              sequence:
              #  climate off -> turn climate to heat mode
              - service: climate.set_hvac_mode
                data:
                  hvac_mode: heat
                entity_id: !input climate_target
            default: [] # climate already on -> continue
        default: [] # t < goal is false -> continue
###############################################################################
###############################################################################
    - conditions:
      - condition: trigger
        id: trigger_open
      sequence:
      # door/window open -> check hold_temperature
      - choose:
        - conditions:
          - condition: state
            entity_id: !input climate_auto_control_target
            state: 'on'
          sequence:
          #  hold_temperature on -> turn off hold_temperature
          - service: input_boolean.turn_off
            data: {}
            entity_id: !input climate_auto_control_target
        default:
        # hold_temperature off -> check climate on
        - choose:
          - conditions:
            - condition: not
              conditions:
              - condition: state
                entity_id: !input climate_target
                state: 'off'
            sequence:
            #  climate on -> turn off
            - service: climate.turn_off
              data: {}
              entity_id: !input climate_target
          default: [] #climate already off -> continue
###############################################################################
###############################################################################
    - conditions:
      - condition: trigger
        id: trigger_close
      sequence:
      # door/window closed -> check hold_temperature
      - choose:
        - conditions:
          - condition: state
            entity_id: !input climate_auto_control_target
            state: 'off'
          sequence:
          # hold_temperature off -> turn hold_temperature on
          - service: input_boolean.turn_on
            data: {}
            entity_id: !input climate_auto_control_target
        default: [] # hold_temperature on -> continue
###############################################################################
###############################################################################
    - conditions:
      - condition: trigger
        id: climate_to_auto
      #  '"climate auto -> 'heat' or 'off'"' 
      sequence:
      - choose:
        - conditions:
          - condition: template
            value_template: '{{ t_current  < t_goal }}'
          sequence:
          - service: climate.set_hvac_mode
            data:
              hvac_mode: heat
            entity_id: !input climate_target
        default: 
        - service: climate.set_hvac_mode
          data:
            hvac_mode: 'off'
          entity_id: !input climate_target
###############################################################################
###############################################################################
    - conditions:
      - condition: trigger
        id: climate_to_heat
      sequence:
      #  climate to heat -> check if hold_temperature is on
      - choose:
        - conditions:
          - condition: state
            entity_id: !input climate_auto_control_target
            state: 'off'
          sequence:
          # 'by climate on to heat: hold_temperature off -> turn on'
          - service: input_boolean.turn_on
            data: {}
            entity_id: !input climate_auto_control_target
        default: [] #  'by climate on to heat: hold_temperature on -> continue'
###############################################################################
###############################################################################
    - conditions:
      - condition: trigger
        id: trigger_t_above
      sequence:
      #  '"T > goal is true -> turn off climate"'
      - choose:
        - conditions: # check if on or auto
          - condition: not
            conditions:
            - condition: state
              entity_id: !input climate_target
              state: 'off'
          sequence:
          - service: climate.turn_off
            data: {}
            entity_id: !input climate_target 
        default: [] #  continue
###############################################################################
###############################################################################
    - conditions:
      - condition: trigger
        id: trigger_t_below
      sequence:
      #  T < goal - d for sensor or T < goal for climate is true -> check if heat on
      - choose:
        - conditions:
          - condition: state
            entity_id: !input climate_target
            state: 'off'
          sequence:
          #  climate off -> turn climate to heat
          - service: climate.set_hvac_mode
            data:
              hvac_mode: heat
            entity_id: !input climate_target
        default: [] #  climate already on -> continue
###############################################################################
###############################################################################
    default: []  #  Unknown trigger case
    #  '#### End of automation ####'

Hi,
Now I need your help, I tried the second version now (without Heat Ones).
Now it works sometimes, but sometimes it doesn’t.

I activate AutoHeat, set my temperature and when it gets over it the “below” sensor switches, but the heater is not deactivated.
The second problem is the error message with the binary_sensor, which I created as follows:

# Esszimmer
  - platform: template
    sensors:
      esszimmer_above_goal_t:
        friendly_name: "Esszimmer: T > T_goal"
        value_template: >-
          {{ states('sensor.average_esszimmer') | float > state_attr('climate.heizung_esszimmer', 'temperature') |float }}
  - platform: template
    sensors:
      esszimmer_below_goal_t:
        friendly_name: "Esszimmer: T < T_goal-dT"
        value_template: >-
          {{ states('sensor.average_esszimmer') | float < (state_attr('climate.heizung_esszimmer', 'temperature') |float - states('input_number.t_delta') | float) }}```

and then get this error message.
Can I leave out the “input_number. t_delta”?

Template warning: 'float' got invalid input 'unavailable' when rendering template '{{ states('sensor.average_schlafzimmer') | float < (state_attr('climate.heizung_schlafzimmer', 'temperature') |float - states('input_number.t_delta') | float) }}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2022.1

If I manually activate the automation and the temperature is reached, even then it does not turn off the thermostat:/
I have Fritz thermostats on the heaters, but that shouldn’t be the reason.

1 Like

Of couse, you can replace input_number. t_delta by a constant number (let it be 0.5 or similar).

You can avoid the warning by replacing

states('sensor.average_schlafzimmer') | float

by

float(states('sensor.average_schlafzimmer'), 0)

As long, as your thermostat has the modes “heat”, “off” and auto, it should work.
If it has presets, you can try to set it to “manual”.

Meanwhile I changed the blueprint a little bit, since one of my thermostat is a different one, and set always the temperature to 16°C, if you manually change the temperature (“auto → heat” is disabled now)

The temperature set by automation still works well.

Here is a blueprint, I use to set temperature profile during the day.

blueprint:
  name: Heizungssteuerung
  domain: automation
  input:
    climate_target:
      name: Thermostat
      description: Thermostat to be controlled
      selector:
        entity:
          domain: climate
    t_current_target:
      name: T_curr
      description: Current temperature in room.
      selector:
        entity:
          domain: sensor
    climate_trigger_t_above:
      name: Flag T > T_goal
      description: Flag, it the temperature T above T_goal
      selector:
        entity:
          domain: binary_sensor
    climate_trigger_t_below:
      name: Flag T < T_goal - T_delta
      description: Flag, it the temperature T below T_goal - T_delta
      selector:
        entity:
          domain: binary_sensor
    open_close_target:
      name: Door | Window - group
      description: Group of sensors for switching off the climate in "on"-state
      selector:
        entity:
          domain: group
    climate_auto_control_target:
      name: Manual switch for climate 
      description: Flag for activating / deactivating of climate control
      selector:
        entity:
          domain: input_boolean
mode: queued

variables:
  climate_target: !input climate_target
  t_current_target: !input t_current_target
  open_close_target: !input open_close_target
  climate_auto_control_target: !input climate_auto_control_target
  climate_trigger_t_above: !input climate_trigger_t_above
  climate_trigger_t_below: !input climate_trigger_t_below

  t_goal: "{{float(state_attr(climate_target, 'temperature'), 0)}}"
  t_current: "{{float(states[t_current_target].state, 0)}}"

  debug_mode: 'off'
  
trigger:
  - platform: state
    entity_id: !input open_close_target
    for: 00:00:45
    from: 'off'
    to: 'on'
    id: trigger_open
  - platform: state
    entity_id: !input open_close_target
    from: 'on'
    to: 'off'
    for: 00:00:10
    id: trigger_close
  - platform: state
    entity_id: !input climate_auto_control_target
    from: 'on'
    to: 'off'
    id: trigger_steuerung_off
  - platform: state
    entity_id: !input climate_auto_control_target
    from: 'off'
    to: 'on'
    id: trigger_steuerung_on
  - platform: state
    entity_id: !input climate_trigger_t_above
    to: 'on'
    from: 'off'
    id: trigger_t_above
  - platform: state
    entity_id: !input climate_trigger_t_below
    to: 'on'
    from: 'off'
    id: trigger_t_below
  - platform: state
    entity_id: !input climate_target
    to: heat
    id: climate_to_heat
#  - platform: state
#    entity_id: !input climate_target
#    to: auto
#    id: climate_to_auto

condition: []

action:
  - choose:
###############################################################################
###############################################################################
    - conditions:
      - condition: trigger
        id: trigger_steuerung_off
      sequence:
      #  hold_temperature on to off -> check climate on
      - choose:
        - conditions: # check if on or auto
          - condition: not
            conditions:
            - condition: state
              entity_id: !input climate_target
              state: 'off'
          sequence:
          #  climate on -> turn off
          - service: climate.turn_off
            entity_id: !input climate_target
        default: [] #  climate off -> continue
###############################################################################
###############################################################################
    - conditions:
      - condition: trigger
        id: trigger_steuerung_on
      sequence:
      #  Called by hold_temperature
      #  hold_temperature off to on -> check if t < goal
      - choose:
        - conditions:
          - condition: template
            value_template: '{{ t_current  < t_goal }}'
          sequence:
          #  t < goal is true -> check if heat on
          - choose:
            - conditions:
              - condition: state
                entity_id: !input climate_target
                state: 'off'
              sequence:
              #  climate off -> turn climate to heat mode
              - service: climate.turn_on
                entity_id: !input climate_target 
              - choose:
                - conditions:
                    - condition: not
                      conditions:
                      - condition: state
                        entity_id: !input climate_target
                        state: heat        
                  sequence:
                  #  climate off or auto -> turn climate to heat
                  - service: climate.set_hvac_mode
                    data:
                      hvac_mode: heat
                    entity_id: !input climate_target
                default: [] #  climate already on -> continue
            default: [] # climate already on -> continue
        default: [] # t < goal is false -> continue
###############################################################################
###############################################################################
    - conditions:
      - condition: trigger
        id: trigger_open
      sequence:
      # door/window open -> check hold_temperature
      - choose:
        - conditions:
          - condition: state
            entity_id: !input climate_auto_control_target
            state: 'on'
          sequence:
          #  hold_temperature on -> turn off hold_temperature
          - service: input_boolean.turn_off
            entity_id: !input climate_auto_control_target
        default:
        # hold_temperature off -> check climate on
        - choose:
          - conditions:
            - condition: not
              conditions:
              - condition: state
                entity_id: !input climate_target
                state: 'off'
            sequence:
            #  climate on -> turn off
            - service: climate.turn_off
              entity_id: !input climate_target
          default: [] #climate already off -> continue
###############################################################################
###############################################################################
    - conditions:
      - condition: trigger
        id: trigger_close
      sequence:
      # door/window closed -> check hold_temperature
      - choose:
        - conditions:
          - condition: state
            entity_id: !input climate_auto_control_target
            state: 'off'
          sequence:
          # hold_temperature off -> turn hold_temperature on
          - service: input_boolean.turn_on
            entity_id: !input climate_auto_control_target
        default: [] # hold_temperature on -> continue
###############################################################################
###############################################################################
#    - conditions:
#      - condition: trigger
#        id: climate_to_auto
#      #  '"climate auto -> 'heat' or 'off'"' 
#      sequence:
#      - choose:
#        - conditions:
#          - condition: template
#            value_template: '{{ t_current  < t_goal }}'
#          sequence:
#          #  climate off or auto -> turn climate to heat
#          - service: climate.turn_on
#            entity_id: !input climate_target 
#          - choose:
#            - conditions:
#                - condition: not
#                  conditions:
#                  - condition: state
#                    entity_id: !input climate_target
#                    state: heat        
#              sequence:
#              #  climate off or auto -> turn climate to heat
#              - service: climate.set_hvac_mode
#                data:
#                  hvac_mode: heat
#                entity_id: !input climate_target
#            default: [] #  climate already on -> continue
#        default: 
#            #  climate on -> turn off
#        - service: climate.turn_off
#          entity_id: !input climate_target
###############################################################################
###############################################################################
    - conditions:
      - condition: trigger
        id: climate_to_heat
      sequence:
      #  climate to heat -> check if hold_temperature is on
      - choose:
        - conditions:
          - condition: state
            entity_id: !input climate_auto_control_target
            state: 'off'
          sequence:
          # 'by climate on to heat: hold_temperature off -> turn on'
          - service: input_boolean.turn_on
            entity_id: !input climate_auto_control_target
        default: [] #  'by climate on to heat: hold_temperature on -> continue'
###############################################################################
###############################################################################
    - conditions:
      - condition: trigger
        id: trigger_t_above
      sequence:
    #  '"T > goal is true -> turn off climate"'
      - choose:
        - conditions: # check if on or auto
          - condition: not
            conditions:
            - condition: state
              entity_id: !input climate_target
              state: 'off'
          sequence:
          - service: climate.turn_off
            entity_id: !input climate_target 
        default: [] #  continue
###############################################################################
###############################################################################
    - conditions:
      - condition: trigger
        id: trigger_t_below
      sequence:
      #  T < goal - d for sensor or T < goal for climate is true -> check if heat on
      - choose:
        - conditions:
            - condition: and
              conditions:
              - condition: state
                entity_id: !input climate_auto_control_target
                state: 'on'
              - condition: not
                conditions:
                - condition: state
                  entity_id: !input climate_target
                  state: heat 
          sequence:
          #  climate off or auto -> turn climate to heat
          - service: climate.turn_on
            entity_id: !input climate_target 
          - choose:
            - conditions:
                - condition: not
                  conditions:
                  - condition: state
                    entity_id: !input climate_target
                    state: heat        
              sequence:
              #  climate off or auto -> turn climate to heat
              - service: climate.set_hvac_mode
                data:
                  hvac_mode: heat
                entity_id: !input climate_target
            default: [] #  climate already on -> continue
        default: [] #  climate already on -> continue
###############################################################################
###############################################################################
    default: []  #  Unknown trigger case
    #  '#### End of automation ####'

blueprint:
  name: Heizungssteuerung
  domain: automation
  input:
    climate_target:
      name: Thermostat
      description: Thermostat to be controlled
      selector:
        entity:
          domain: climate
    t_current_target:
      name: T_curr
      description: Current temperature in room.
      selector:
        entity:
          domain: sensor
    climate_trigger_t_above:
      name: Flag T > T_goal
      description: Flag, it the temperature T above T_goal
      selector:
        entity:
          domain: binary_sensor
    climate_trigger_t_below:
      name: Flag T < T_goal - T_delta
      description: Flag, it the temperature T below T_goal - T_delta
      selector:
        entity:
          domain: binary_sensor
    open_close_target:
      name: Door | Window - group
      description: Group of sensors for switching off the climate in "on"-state
      selector:
        entity:
          domain: group
    climate_auto_control_target:
      name: Manual switch for climate 
      description: Flag for activating / deactivating of climate control
      selector:
        entity:
          domain: input_boolean
mode: queued

variables:
  climate_target: !input climate_target
  t_current_target: !input t_current_target
  open_close_target: !input open_close_target
  climate_auto_control_target: !input climate_auto_control_target
  climate_trigger_t_above: !input climate_trigger_t_above
  climate_trigger_t_below: !input climate_trigger_t_below

#  t_goal: "{{float(state_attr(climate_target, 'temperature'), 0)}}"
#  t_current: "{{float(states[t_current_target].state, 0)}}"

  debug_mode: 'off'
  
trigger:
  - platform: state
    entity_id: !input open_close_target
    for: 00:00:45
    from: 'off'
    to: 'on'
    id: trigger_open
  - platform: state
    entity_id: !input open_close_target
    from: 'on'
    to: 'off'
    for: 00:00:10
    id: trigger_close
  - platform: state
    entity_id: !input climate_auto_control_target
    from: 'on'
    to: 'off'
    id: trigger_steuerung_off
  - platform: state
    entity_id: !input climate_auto_control_target
    from: 'off'
    to: 'on'
    id: trigger_steuerung_on
  - platform: state
    entity_id: !input climate_trigger_t_above
    to: 'on'
    from: 'off'
    id: trigger_t_above
  - platform: state
    entity_id: !input climate_trigger_t_below
    to: 'on'
    from: 'off'
    id: trigger_t_below
  - platform: state
    entity_id: !input climate_target
    to: heat
    id: climate_to_heat
#  - platform: state
#    entity_id: !input climate_target
#    to: auto
#    id: climate_to_auto

condition: []

action:
  - choose:
###############################################################################
###############################################################################
    - conditions:
      - condition: trigger
        id: trigger_steuerung_off
      sequence:
      #  hold_temperature on to off -> check climate on
      - choose:
        - conditions: # check if on or auto
          - condition: not
            conditions:
            - condition: state
              entity_id: !input climate_target
              state: 'off'
          sequence:
          #  climate on -> turn off
          - service: climate.turn_off
            entity_id: !input climate_target
        default: [] #  climate off -> continue
###############################################################################
###############################################################################
    - conditions:
      - condition: trigger
        id: trigger_steuerung_on
      sequence:
      #  Called by hold_temperature
      #  hold_temperature off to on -> check if t < goal
      - choose:
        - conditions:
          - condition: state
            entity_id: !input climate_trigger_t_below
            state: 'on'
          sequence:
          #  t < goal is true -> check if heat on
          - choose:
            - conditions:
              - condition: state
                entity_id: !input climate_target
                state: 'off'
              sequence:
              #  climate off -> turn climate to heat mode
              - service: climate.turn_on
                entity_id: !input climate_target 
              - choose:
                - conditions:
                    - condition: not
                      conditions:
                      - condition: state
                        entity_id: !input climate_target
                        state: heat        
                  sequence:
                  #  climate off or auto -> turn climate to heat
                  - service: climate.set_hvac_mode
                    data:
                      hvac_mode: heat
                    entity_id: !input climate_target
                default: [] #  climate already on -> continue
            default: [] # climate already on -> continue
        default: [] # t < goal is false -> continue
###############################################################################
###############################################################################
    - conditions:
      - condition: trigger
        id: trigger_open
      sequence:
      # door/window open -> check hold_temperature
      - choose:
        - conditions:
          - condition: state
            entity_id: !input climate_auto_control_target
            state: 'on'
          sequence:
          #  hold_temperature on -> turn off hold_temperature
          - service: input_boolean.turn_off
            entity_id: !input climate_auto_control_target
        default:
        # hold_temperature off -> check climate on
        - choose:
          - conditions:
            - condition: not
              conditions:
              - condition: state
                entity_id: !input climate_target
                state: 'off'
            sequence:
            #  climate on -> turn off
            - service: climate.turn_off
              entity_id: !input climate_target
          default: [] #climate already off -> continue
###############################################################################
###############################################################################
    - conditions:
      - condition: trigger
        id: trigger_close
      sequence:
      # door/window closed -> check hold_temperature
      - choose:
        - conditions:
          - condition: state
            entity_id: !input climate_auto_control_target
            state: 'off'
          sequence:
          # hold_temperature off -> turn hold_temperature on
          - service: input_boolean.turn_on
            entity_id: !input climate_auto_control_target
        default: [] # hold_temperature on -> continue
###############################################################################
###############################################################################
#    - conditions:
#      - condition: trigger
#        id: climate_to_auto
#      #  '"climate auto -> 'heat' or 'off'"' 
#      sequence:
#      - choose:
#        - conditions:
#          - condition: template
#            value_template: '{{ t_current  < t_goal }}'
#          sequence:
#          #  climate off or auto -> turn climate to heat
#          - service: climate.turn_on
#            entity_id: !input climate_target 
#          - choose:
#            - conditions:
#                - condition: not
#                  conditions:
#                  - condition: state
#                    entity_id: !input climate_target
#                    state: heat        
#              sequence:
#              #  climate off or auto -> turn climate to heat
#              - service: climate.set_hvac_mode
#                data:
#                  hvac_mode: heat
#                entity_id: !input climate_target
#            default: [] #  climate already on -> continue
#        default: 
#            #  climate on -> turn off
#        - service: climate.turn_off
#          entity_id: !input climate_target
###############################################################################
###############################################################################
    - conditions:
      - condition: trigger
        id: climate_to_heat
      sequence:
      #  climate to heat -> check if hold_temperature is on
      - choose:
        - conditions:
          - condition: state
            entity_id: !input climate_auto_control_target
            state: 'off'
          sequence:
          # 'by climate on to heat: hold_temperature off -> turn on'
          - service: input_boolean.turn_on
            entity_id: !input climate_auto_control_target
        default: [] #  'by climate on to heat: hold_temperature on -> continue'
###############################################################################
###############################################################################
    - conditions:
      - condition: trigger
        id: trigger_t_above
      sequence:
    #  '"T > goal is true -> turn off climate"'
      - choose:
        - conditions: # check if on or auto
          - condition: not
            conditions:
            - condition: state
              entity_id: !input climate_target
              state: 'off'
          sequence:
          - service: climate.turn_off
            entity_id: !input climate_target 
        default: [] #  continue
###############################################################################
###############################################################################
    - conditions:
      - condition: trigger
        id: trigger_t_below
      sequence:
      #  T < goal - d for sensor or T < goal for climate is true -> check if heat on
      - choose:
        - conditions:
            - condition: and
              conditions:
              - condition: state
                entity_id: !input climate_auto_control_target
                state: 'on'
              - condition: not
                conditions:
                - condition: state
                  entity_id: !input climate_target
                  state: heat 
          sequence:
          #  climate off or auto -> turn climate to heat
          - service: climate.turn_on
            entity_id: !input climate_target 
          - choose:
            - conditions:
                - condition: not
                  conditions:
                  - condition: state
                    entity_id: !input climate_target
                    state: heat        
              sequence:
              #  climate off or auto -> turn climate to heat
              - service: climate.set_hvac_mode
                data:
                  hvac_mode: heat
                entity_id: !input climate_target
            default: [] #  climate already on -> continue
        default: [] #  climate already on -> continue
###############################################################################
###############################################################################
    default: []  #  Unknown trigger case
    #  '#### End of automation ####'

Ah hab grad gesehen das du ja auch deutsch kannst :).
Du ich hab heute mal die v2 von dir ausprobiert, jetzt hatte ich grad wieder das Problem, das im Esszimmer die Temperatur erreicht wurde → Heizung aus → aber nicht wieder an als es kälter war :&

Nomal sollte das doch bei below Goal wieder an gehen oder nicht?
Deine Thermostat Darstellung gefällt mir, könntest du mir deine config dazu evtl. noch sharen?

thx! :slight_smile:

Aktuell ist es bei mir, am Beispiel für ein Zimmer, so implementiert

      wohnzimmer_above_goal_t:
        friendly_name: "Wohnzimmer: T > T_goal"
        value_template: >-
          {{ float( states('sensor.wohnzimmer_t') , 0) > float( state_attr('climate.wohnzimmer_thermostat', 'temperature') , 0) }}
      wohnzimmer_below_goal_t:
        friendly_name: "Wohnzimmer: T < T_goal-dT"
        value_template: >-
          {{ float( states('sensor.wohnzimmer_t') , 0) < (float( state_attr('climate.wohnzimmer_thermostat', 'temperature') , 0) - float( states('input_number.system_delta_goal_t') , 0)) }}

Du wolltest ja “delta_goal” vermeiden, deswegen müsste es so aussehen (nicht getestet, hier direkt angepasst)

      wohnzimmer_above_goal_t:
        friendly_name: "Wohnzimmer: T > T_goal"
        value_template: >-
          {{ float( states('sensor.wohnzimmer_t') , 0) > float( state_attr('climate.wohnzimmer_thermostat', 'temperature') , 0) }}
      wohnzimmer_below_goal_t:
        friendly_name: "Wohnzimmer: T < T_goal-dT"
        value_template: >-
          {{ float( states('sensor.wohnzimmer_t') , 0) < (float( state_attr('climate.wohnzimmer_thermostat', 'temperature') , 0) - 0.5) }}

sensor.wohnzimmer_t ist die aktuelle Temperatur im Zimmer.

Vergleiche, ob Du genau so es bei Dir hast (z.B. 0.5 und nicht 0,5 u.s.w).

Ich habe da noch eine Version gepostet, da heute irgendwie “template t_current < t_goal” nicht triggern wollte, habe da direkt auf den sensor.t_below umgestellt und Variablen gelöscht.

Also, theoretisch muss es so funktioneren :slight_smile: Vorausgesetzt Deine Thermostate lassen sich steuern.

Was ich gerade feststelle: t_curr (t_current_target) im Blueprint nach der letzten Anpassung obsolet und kann auch gelöscht werden.
Generell gilt: Hier ist der Fall implementiert, der für meine Anwendung angepasst ist. In Deinem Fall kann es sein, dass Du mal eine oder die andere entity gar nicht brauchst.

VG

Last version, I’m using.
I had some problems with triggering of the template state and replaced the ‘t_current < t_goal’ part with the 't_below" state. Since it is the replicated information.

blueprint:
  name: Heizungssteuerung
  domain: automation
  input:
    climate_target:
      name: Thermostat
      description: Thermostat to be controlled
      selector:
        entity:
          domain: climate
#    t_current_target:
#      name: T_curr
#      description: Current temperature in room.
#      selector:
#        entity:
#          domain: sensor
    climate_trigger_t_above:
      name: Flag T > T_goal
      description: Flag, it the temperature T above T_goal
      selector:
        entity:
          domain: binary_sensor
    climate_trigger_t_below:
      name: Flag T < T_goal - T_delta
      description: Flag, it the temperature T below T_goal - T_delta
      selector:
        entity:
          domain: binary_sensor
    open_close_target:
      name: Door | Window - group
      description: Group of sensors for switching off the climate in "on"-state
      selector:
        entity:
          domain: group
    climate_auto_control_target:
      name: Manual switch for climate 
      description: Flag for activating / deactivating of climate control
      selector:
        entity:
          domain: input_boolean
mode: queued

variables:
  climate_target: !input climate_target
#  t_current_target: !input t_current_target
  open_close_target: !input open_close_target
  climate_auto_control_target: !input climate_auto_control_target
  climate_trigger_t_above: !input climate_trigger_t_above
  climate_trigger_t_below: !input climate_trigger_t_below

#  t_goal: "{{float(state_attr(climate_target, 'temperature'), 0)}}"
#  t_current: "{{float(states[t_current_target].state, 0)}}"

  debug_mode: 'off'
  
trigger:
  - platform: state
    entity_id: !input open_close_target
    for: 00:00:45
    from: 'off'
    to: 'on'
    id: trigger_open
  - platform: state
    entity_id: !input open_close_target
    from: 'on'
    to: 'off'
    for: 00:00:10
    id: trigger_close
  - platform: state
    entity_id: !input climate_auto_control_target
    from: 'on'
    to: 'off'
    id: trigger_steuerung_off
  - platform: state
    entity_id: !input climate_auto_control_target
    from: 'off'
    to: 'on'
    id: trigger_steuerung_on
  - platform: state
    entity_id: !input climate_trigger_t_above
    to: 'on'
    from: 'off'
    id: trigger_t_above
  - platform: state
    entity_id: !input climate_trigger_t_below
    to: 'on'
    from: 'off'
    id: trigger_t_below
  - platform: state
    entity_id: !input climate_target
    to: heat
    id: climate_to_heat
#  - platform: state
#    entity_id: !input climate_target
#    to: auto
#    id: climate_to_auto

condition: []

action:
  - choose:
###############################################################################
###############################################################################
    - conditions:
      - condition: trigger
        id: trigger_steuerung_off
      sequence:
      #  hold_temperature on to off -> check climate on
      - choose:
        - conditions: # check if on or auto
          - condition: not
            conditions:
            - condition: state
              entity_id: !input climate_target
              state: 'off'
          sequence:
          #  climate on -> turn off
          - service: climate.turn_off
            entity_id: !input climate_target
        default: [] #  climate off -> continue
###############################################################################
###############################################################################
    - conditions:
      - condition: trigger
        id: trigger_steuerung_on
      sequence:
      #  Called by hold_temperature
      #  hold_temperature off to on -> check if t < goal
      - choose:
        - conditions:
          - condition: state
            entity_id: !input climate_trigger_t_below
            state: 'on'
          sequence:
          #  t < goal is true -> check if heat on
          - choose:
            - conditions:
              - condition: state
                entity_id: !input climate_target
                state: 'off'
              sequence:
              #  climate off -> turn climate to heat mode
              - service: climate.turn_on
                entity_id: !input climate_target 
              - choose:
                - conditions:
                    - condition: not
                      conditions:
                      - condition: state
                        entity_id: !input climate_target
                        state: heat        
                  sequence:
                  #  climate off or auto -> turn climate to heat
                  - service: climate.set_hvac_mode
                    data:
                      hvac_mode: heat
                    entity_id: !input climate_target
                default: [] #  climate already on -> continue
            default: [] # climate already on -> continue
        default: [] # t < goal is false -> continue
###############################################################################
###############################################################################
    - conditions:
      - condition: trigger
        id: trigger_open
      sequence:
      # door/window open -> check hold_temperature
      - choose:
        - conditions:
          - condition: state
            entity_id: !input climate_auto_control_target
            state: 'on'
          sequence:
          #  hold_temperature on -> turn off hold_temperature
          - service: input_boolean.turn_off
            entity_id: !input climate_auto_control_target
        default:
        # hold_temperature off -> check climate on
        - choose:
          - conditions:
            - condition: not
              conditions:
              - condition: state
                entity_id: !input climate_target
                state: 'off'
            sequence:
            #  climate on -> turn off
            - service: climate.turn_off
              entity_id: !input climate_target
          default: [] #climate already off -> continue
###############################################################################
###############################################################################
    - conditions:
      - condition: trigger
        id: trigger_close
      sequence:
      # door/window closed -> check hold_temperature
      - choose:
        - conditions:
          - condition: state
            entity_id: !input climate_auto_control_target
            state: 'off'
          sequence:
          # hold_temperature off -> turn hold_temperature on
          - service: input_boolean.turn_on
            entity_id: !input climate_auto_control_target
        default: [] # hold_temperature on -> continue
###############################################################################
###############################################################################
#    - conditions:
#      - condition: trigger
#        id: climate_to_auto
#      #  '"climate auto -> 'heat' or 'off'"' 
#      sequence:
#      - choose:
#        - conditions:
#          - condition: template
#            value_template: '{{ t_current  < t_goal }}'
#          sequence:
#          #  climate off or auto -> turn climate to heat
#          - service: climate.turn_on
#            entity_id: !input climate_target 
#          - choose:
#            - conditions:
#                - condition: not
#                  conditions:
#                  - condition: state
#                    entity_id: !input climate_target
#                    state: heat        
#              sequence:
#              #  climate off or auto -> turn climate to heat
#              - service: climate.set_hvac_mode
#                data:
#                  hvac_mode: heat
#                entity_id: !input climate_target
#            default: [] #  climate already on -> continue
#        default: 
#            #  climate on -> turn off
#        - service: climate.turn_off
#          entity_id: !input climate_target
###############################################################################
###############################################################################
    - conditions:
      - condition: trigger
        id: climate_to_heat
      sequence:
      #  climate to heat -> check if hold_temperature is on
      - choose:
        - conditions:
          - condition: state
            entity_id: !input climate_auto_control_target
            state: 'off'
          sequence:
          # 'by climate on to heat: hold_temperature off -> turn on'
          - service: input_boolean.turn_on
            entity_id: !input climate_auto_control_target
        default: [] #  'by climate on to heat: hold_temperature on -> continue'
###############################################################################
###############################################################################
    - conditions:
      - condition: trigger
        id: trigger_t_above
      sequence:
    #  '"T > goal is true -> turn off climate"'
      - choose:
        - conditions: # check if on or auto
          - condition: not
            conditions:
            - condition: state
              entity_id: !input climate_target
              state: 'off'
          sequence:
          - service: climate.turn_off
            entity_id: !input climate_target 
        default: [] #  continue
###############################################################################
###############################################################################
    - conditions:
      - condition: trigger
        id: trigger_t_below
      sequence:
      #  T < goal - d for sensor or T < goal for climate is true -> check if heat on
      - choose:
        - conditions:
            - condition: and
              conditions:
              - condition: state
                entity_id: !input climate_auto_control_target
                state: 'on'
              - condition: not
                conditions:
                - condition: state
                  entity_id: !input climate_target
                  state: heat 
          sequence:
          #  climate off or auto -> turn climate to heat
          - service: climate.turn_on
            entity_id: !input climate_target 
          - choose:
            - conditions:
                - condition: not
                  conditions:
                  - condition: state
                    entity_id: !input climate_target
                    state: heat        
              sequence:
              #  climate off or auto -> turn climate to heat
              - service: climate.set_hvac_mode
                data:
                  hvac_mode: heat
                entity_id: !input climate_target
            default: [] #  climate already on -> continue
        default: [] #  climate already on -> continue
###############################################################################
###############################################################################
    default: []  #  Unknown trigger case
    #  '#### End of automation ####'