Skip to main content

Heizung set Default Temperatur

Per Push Button lässt sich die Temperatur aus den Speicher Entitäten an das Thermostat senden.

Code:

alias: Heizung Set Default Temperature
description: ""
trigger:
    - platform: state
      entity_id:
        - input_button.set_zeitplan_wc
        - input_button.set_zeitplan_eingang
        - ...
condition:
    - condition: state
      entity_id: input_boolean.urlaub
      state: "off"
action:
    - variables:
        room: "{{ trigger.entity_id.split('_')[3] }}"
        device: "{{ 'climate.thermostat_' + room }}"
        comfort: "{{ 'input_number.thermostat_' + room + '_comfort' }}"
        eco: "{{ 'input_number.thermostat_' + room + '_eco' }}"
        device_temp: "{{ state_attr( device, 'temperature') }}"
        eco_temp: "{{ states(eco) }}"
        comfort_temp: "{{ states(comfort) }}"
        scheduler: "{{ 'schedule.heizung_' + room + '_eco' }}"
        scheduler_state: "{{ states(scheduler) | bool }}"
        scheduler_switch: "{{ states('input_boolean.heizung_' + room + '_zeitplan') | bool }}"
        temp: |
          {% if scheduler_state %}
            {{ eco_temp }}
          {% else %}
            {{ comfort_temp }}
          {% endif %}
    - service: climate.set_temperature
      data:
        hvac_mode: heat
        temperature: "{{ temp }}"
      target:
        entity_id: "{{ device }}"
mode: parallel
max: 20