Skip to main content

Heizung Switch Zeitplan

Per Switch kann der Zeitplan aktiviert oder deaktiviert werden. Dabei wird die dann korrekte Temperatur gesendet.

Zeitplan AUS bedeutet Komfort Temperatur

Code:

alias: Heizung Switch Zeitplan
description: ""
trigger:
  - platform: state
    entity_id:
      - input_boolean.heizung_wc_zeitplan
      - input_boolean.heizung_eingang_zeitplan
      - ...input_boolean.heizung_flur_zeitplan
      - input_boolean.heizung_buero_zeitplan
      - input_boolean.heizung_werkstatt_zeitplan
      - input_boolean.heizung_ez_zeitplan
      - input_boolean.heizung_wz_zeitplan
      - input_boolean.heizung_sz_zeitplan
      - input_boolean.heizung_gruen_zeitplan
      - input_boolean.heizung_rosa_zeitplan
      - input_boolean.heizung_lydi_zeitplan
      - input_boolean.heizung_kinderbad_zeitplan
      - input_boolean.heizung_carrera_zeitplan
      - input_boolean.heizung_wcdg_zeitplan
      - input_boolean.heizung_studio_zeitplan
    id: ZeitplanOFF
    to: "off"
  - platform: state
    entity_id:
      - input_boolean.heizung_wc_zeitplan
      - input_boolean.heizung_eingang_zeitplan
      - ...input_boolean.heizung_flur_zeitplan
      - input_boolean.heizung_buero_zeitplan
      - input_boolean.heizung_werkstatt_zeitplan
      - input_boolean.heizung_ez_zeitplan
      - input_boolean.heizung_wz_zeitplan
      - input_boolean.heizung_sz_zeitplan
      - input_boolean.heizung_gruen_zeitplan
      - input_boolean.heizung_rosa_zeitplan
      - input_boolean.heizung_lydi_zeitplan
      - input_boolean.heizung_kinderbad_zeitplan
      - input_boolean.heizung_carrera_zeitplan
      - input_boolean.heizung_wcdg_zeitplan
      - input_boolean.heizung_studio_zeitplan
    id: ZeitplanON
    to: "on"
condition:
  - condition: state
    entity_id: input_boolean.urlaub
    state: "off"
action:
  - variables:
      room: "{{ trigger.entity_id.split('_')[2] }}"
      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 }}"
      window_state: "{{ states('binary_sensor.fenster_' + room + '_open_close') }}"
      temp: |
        {% if scheduler_state %}
          {{ eco_temp }}
        {% else %}
          {{ comfort_temp }}
        {% endif %}
  - choose:
      - conditions:
          - condition: trigger
            id: ZeitplanOFF
        sequence:
          - if:
              - "{{ not scheduler_state }}"
            then:
              - if:
                  - "{{ window_state }} == 'off'"
                then:
                  - service: input_number.set_value
                    data_template:
                      value: "{{ device_temp }}"
                    target:
                      entity_id: "{{ comfort }}"
      - conditions:
          - condition: trigger
            id: ZeitplanON
        sequence:
          - service: climate.set_temperature
            data:
              hvac_mode: heat
              temperature: "{{ temp }}"
            target:
              entity_id: "{{ device }}"
mode: parallel
max: 20