Skip to main content

Heizung Absenkung Zeit


 

Code

alias: Heizung Absenkung Zeit
description: ""
trigger:
  - platform: state
    entity_id:
      - schedule.heizung_wc_eco
      - schedule.heizung_eingang_eco
      - ...
    id: AbsenkungStart
    to: "on"
  - platform: state
    entity_id:
      - schedule.heizung_wc_eco
      - schedule.heizung_eingang_eco
      - ...
    to: "off"
    id: AbsenkungEnd
condition:
  - condition: state
    entity_id: input_boolean.urlaub
    state: "off"
action:
  - variables:
      room: "{{ trigger.entity_id.split('_')[1] }}"
      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 }}"
  - if:
      - "{{ scheduler_switch }}"
    then:
      - choose:
          - conditions:
              - condition: trigger
                id: AbsenkungStart
            sequence:
              - service: input_number.set_value
                data_template:
                  value: "{{ device_temp }}"
                target:
                  entity_id: "{{ comfort }}"
              - service: climate.set_temperature
                data_template:
                  temperature: "{{ eco_temp }}"
                target:
                  entity_id: "{{ device }}"
          - conditions:
              - condition: trigger
                id: AbsenkungEnd
            sequence:
              - service: climate.set_temperature
                data_template:
                  temperature: "{{ comfort_temp }}"
                target:
                  entity_id: "{{ device }}"
mode: parallel
max: 20