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
      - input_button.set_zeitplan_flur
      - input_button.set_zeitplan_buero
      - input_button.set_zeitplan_werkstatt
      - input_button.set_zeitplan_ez
      - input_button.set_zeitplan_wz
      - input_button.set_zeitplan_sz
      - input_button.set_zeitplan_gruen
      - input_button.set_zeitplan_rosa
      - input_button.set_zeitplan_lydi
      - input_button.set_zeitplan_kinderbad
      - input_button.set_zeitplan_carrera
      - input_button.set_zeitplan_wcdg
      - input_button.set_zeitplan_studio
condition:
  - condition: state
    entity_id: input_boolean.urlaub
    state: "off"
action:
  - variables:
      room: "{{ trigger.entity_id.split('_')[3] }}"
      device: "{{ 'climate.thermostat_' + room }}"
      climate_state: "{{ states('input_boolean.heizung_' + room + '_on_off') | bool }}"
      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 %}
  - if:
      - condition: template
        value_template: "{{ climate_state }}"
    then:
      - service: script.turn_on
        data:
          variables:
            room: "{{ room }}"
            temp: "{{ temp }}"
        target:
          entity_id: script.heizung_set_temperature
    else:
      - service: climate.set_temperature
        data:
          temperature: 5
        target:
          device_id: "{{ device }}"
mode: parallel
max: 20