Zustände sichern & abrufen: So verfeinerst du Home Assistant Automatisierungen!

Optimiere deine Home Assistant Automatisierungen mit präziser Zustandswiederherstellung. In diesem Video erfährst du, wie du den Anfangszustand deiner Geräte, sei es Beleuchtung, Rollos oder andere, gezielt in Automatisierungen integrierst. Erlerne die Kunst der Feinabstimmung für ein perfektes und zuverlässiges Smart-Home-Erlebnis. Entdecke, wie du mit Home Assistant deine individuellen Anforderungen erfüllen kannst und ein maßgeschneidertes, effizientes Automatisierungssystem schaffst.

Diese ZigBee Produkte verwende ich * :

Die Automatisierungsbeispiele als YAML Code könnt ihr hier nochmal nachvollziehen.

Automatisierungsbeispiel 1 ( Rollosteuerung bei Wind):

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: Rollosteuerung_bei_Wind
description: ""
trigger:
- platform: state
entity_id:
- input_boolean.wind
to: "on"
id: es ist windig
- platform: state
entity_id:
- input_boolean.wind
to: "off"
id: es ist nicht mehr windig
condition: []
action:
- if:
- condition: trigger
id:
- es ist windig
then:
- service: scene.create
data:
scene_id: zustandeliasrollos
snapshot_entities:
- cover.elia_rollo_links
- cover.elia_rollo_rechts
- service: cover.open_cover
target:
entity_id:
- cover.elia_rollo_links
- cover.elia_rollo_rechts
data: {}
- if:
- condition: trigger
id:
- es ist nicht mehr windig
then:
- service: scene.turn_on
target:
entity_id: scene.zustandeliasrollos
metadata: {}
mode: single
alias: Rollosteuerung_bei_Wind description: "" trigger: - platform: state entity_id: - input_boolean.wind to: "on" id: es ist windig - platform: state entity_id: - input_boolean.wind to: "off" id: es ist nicht mehr windig condition: [] action: - if: - condition: trigger id: - es ist windig then: - service: scene.create data: scene_id: zustandeliasrollos snapshot_entities: - cover.elia_rollo_links - cover.elia_rollo_rechts - service: cover.open_cover target: entity_id: - cover.elia_rollo_links - cover.elia_rollo_rechts data: {} - if: - condition: trigger id: - es ist nicht mehr windig then: - service: scene.turn_on target: entity_id: scene.zustandeliasrollos metadata: {} mode: single
alias: Rollosteuerung_bei_Wind
description: ""
trigger:
  - platform: state
    entity_id:
      - input_boolean.wind
    to: "on"
    id: es ist windig
  - platform: state
    entity_id:
      - input_boolean.wind
    to: "off"
    id: es ist nicht mehr windig
condition: []
action:
  - if:
      - condition: trigger
        id:
          - es ist windig
    then:
      - service: scene.create
        data:
          scene_id: zustandeliasrollos
          snapshot_entities:
            - cover.elia_rollo_links
            - cover.elia_rollo_rechts
      - service: cover.open_cover
        target:
          entity_id:
            - cover.elia_rollo_links
            - cover.elia_rollo_rechts
        data: {}
  - if:
      - condition: trigger
        id:
          - es ist nicht mehr windig
    then:
      - service: scene.turn_on
        target:
          entity_id: scene.zustandeliasrollos
        metadata: {}
mode: single

Automatisierungsbeispiel 2 ( Scene Save TV Lampe)

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: Scene Save TV Lampe
description: ""
trigger:
- platform: state
entity_id:
- input_boolean.helfer_bewegungsmelder
to: "on"
condition: []
action:
- service: scene.create
data:
scene_id: zustandtvbeleuchtung
snapshot_entities:
- light.tv_bloom_eg_links
- light.tv_bloom_eg_rechts
- service: light.turn_on
target:
entity_id:
- light.tv_bloom_eg_links
- light.tv_bloom_eg_rechts
data:
brightness_pct: 100
rgb_color:
- 255
- 0
- 0
- delay:
hours: 0
minutes: 0
seconds: 15
milliseconds: 0
- service: scene.turn_on
target:
entity_id: scene.zustandtvbeleuchtung
metadata: {}
- service: scene.delete
data: {}
target:
entity_id: scene.zustandtvbeleuchtung
mode: single
alias: Scene Save TV Lampe description: "" trigger: - platform: state entity_id: - input_boolean.helfer_bewegungsmelder to: "on" condition: [] action: - service: scene.create data: scene_id: zustandtvbeleuchtung snapshot_entities: - light.tv_bloom_eg_links - light.tv_bloom_eg_rechts - service: light.turn_on target: entity_id: - light.tv_bloom_eg_links - light.tv_bloom_eg_rechts data: brightness_pct: 100 rgb_color: - 255 - 0 - 0 - delay: hours: 0 minutes: 0 seconds: 15 milliseconds: 0 - service: scene.turn_on target: entity_id: scene.zustandtvbeleuchtung metadata: {} - service: scene.delete data: {} target: entity_id: scene.zustandtvbeleuchtung mode: single
alias: Scene Save TV Lampe
description: ""
trigger:
  - platform: state
    entity_id:
      - input_boolean.helfer_bewegungsmelder
    to: "on"
condition: []
action:
  - service: scene.create
    data:
      scene_id: zustandtvbeleuchtung
      snapshot_entities:
        - light.tv_bloom_eg_links
        - light.tv_bloom_eg_rechts
  - service: light.turn_on
    target:
      entity_id:
        - light.tv_bloom_eg_links
        - light.tv_bloom_eg_rechts
    data:
      brightness_pct: 100
      rgb_color:
        - 255
        - 0
        - 0
  - delay:
      hours: 0
      minutes: 0
      seconds: 15
      milliseconds: 0
  - service: scene.turn_on
    target:
      entity_id: scene.zustandtvbeleuchtung
    metadata: {}
  - service: scene.delete
    data: {}
    target:
      entity_id: scene.zustandtvbeleuchtung
mode: single

Home Assistant, Adaptive Steuerung von Lichtern

Möchte du deine Lichter auch in der Farbtemperatur und Helligkeit in Abhängigkeit vom Stand der Sonne, oder in einem definierten Zeitfenster steuern ? Die Home Assistant Integration Adaptive Lightning ermöglicht dir das auf einfacher Weise. Dieses Video zeigt dir die Installation und Konfiguration der Integration.

Die von mir verwendeten ZigBee Produkte* :

Links:

Adaptive Lighting: basnijholt/adaptive-lighting: Adaptive Lighting custom component for Home Assistant (github.com)

5 Home Assistant Automatisierungen für Einsteiger

Hier findest du 5 Automatisierungen für Einsteiger. Dabei werden Bewegungsmelder & Lichter, Zeitpläne, Helfer, Shortcuts und Temperaturthermostate verwendet. Diese 5 Beispiele sollen dir helfen, eigene Ideen in deinem smarten Heim umzusetzen.

Diese ZigBee Produkte verwende ich *:

Automatisierung 1:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: Automatisierung 1
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.bewegungsmelder_flur_haustur_eg_occupancy
from: "off"
to: "on"
id: Bewegung ausgelöst
- platform: state
entity_id:
- binary_sensor.bewegungsmelder_flur_haustur_eg_occupancy
from: "on"
to: "off"
for:
hours: 0
minutes: 5
seconds: 0
id: Bewegungsmelder zurückgesetzt
condition: []
action:
- if:
- condition: trigger
id:
- Bewegung ausgelöst
then:
- service: light.turn_on
target:
entity_id: light.flur_eg_haustur_deckenlampe
data: {}
- if:
- condition: trigger
id:
- Bewegungsmelder zurückgesetzt
then:
- service: light.turn_off
target:
entity_id: light.flur_eg_haustur_deckenlampe
data: {}
mode: single
alias: Automatisierung 1 description: "" trigger: - platform: state entity_id: - binary_sensor.bewegungsmelder_flur_haustur_eg_occupancy from: "off" to: "on" id: Bewegung ausgelöst - platform: state entity_id: - binary_sensor.bewegungsmelder_flur_haustur_eg_occupancy from: "on" to: "off" for: hours: 0 minutes: 5 seconds: 0 id: Bewegungsmelder zurückgesetzt condition: [] action: - if: - condition: trigger id: - Bewegung ausgelöst then: - service: light.turn_on target: entity_id: light.flur_eg_haustur_deckenlampe data: {} - if: - condition: trigger id: - Bewegungsmelder zurückgesetzt then: - service: light.turn_off target: entity_id: light.flur_eg_haustur_deckenlampe data: {} mode: single
alias: Automatisierung 1
description: ""
trigger:
  - platform: state
    entity_id:
      - binary_sensor.bewegungsmelder_flur_haustur_eg_occupancy
    from: "off"
    to: "on"
    id: Bewegung ausgelöst
  - platform: state
    entity_id:
      - binary_sensor.bewegungsmelder_flur_haustur_eg_occupancy
    from: "on"
    to: "off"
    for:
      hours: 0
      minutes: 5
      seconds: 0
    id: Bewegungsmelder zurückgesetzt
condition: []
action:
  - if:
      - condition: trigger
        id:
          - Bewegung ausgelöst
    then:
      - service: light.turn_on
        target:
          entity_id: light.flur_eg_haustur_deckenlampe
        data: {}
  - if:
      - condition: trigger
        id:
          - Bewegungsmelder zurückgesetzt
    then:
      - service: light.turn_off
        target:
          entity_id: light.flur_eg_haustur_deckenlampe
        data: {}
mode: single

Automatisierung 2:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: Automatisierung 2
description: Steckdose Zeitplan
trigger:
- platform: state
entity_id:
- schedule.steckdose_schalten
from: "off"
to: "on"
id: Zeitplan aktiv
- platform: state
entity_id:
- schedule.steckdose_schalten
from: "on"
to: "off"
id: Zeitplan inaktiv
condition: []
action:
- if:
- condition: trigger
id:
- Zeitplan aktiv
then:
- service: switch.turn_on
target:
entity_id: switch.smartplugstudio
data: {}
- if:
- condition: trigger
id:
- Zeitplan inaktiv
then:
- service: switch.turn_off
target:
entity_id: switch.smartplugstudio
data: {}
mode: single
alias: Automatisierung 2 description: Steckdose Zeitplan trigger: - platform: state entity_id: - schedule.steckdose_schalten from: "off" to: "on" id: Zeitplan aktiv - platform: state entity_id: - schedule.steckdose_schalten from: "on" to: "off" id: Zeitplan inaktiv condition: [] action: - if: - condition: trigger id: - Zeitplan aktiv then: - service: switch.turn_on target: entity_id: switch.smartplugstudio data: {} - if: - condition: trigger id: - Zeitplan inaktiv then: - service: switch.turn_off target: entity_id: switch.smartplugstudio data: {} mode: single
alias: Automatisierung 2
description: Steckdose Zeitplan
trigger:
  - platform: state
    entity_id:
      - schedule.steckdose_schalten
    from: "off"
    to: "on"
    id: Zeitplan aktiv
  - platform: state
    entity_id:
      - schedule.steckdose_schalten
    from: "on"
    to: "off"
    id: Zeitplan inaktiv
condition: []
action:
  - if:
      - condition: trigger
        id:
          - Zeitplan aktiv
    then:
      - service: switch.turn_on
        target:
          entity_id: switch.smartplugstudio
        data: {}
  - if:
      - condition: trigger
        id:
          - Zeitplan inaktiv
    then:
      - service: switch.turn_off
        target:
          entity_id: switch.smartplugstudio
        data: {}
mode: single

Automatisierung 3:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: Automatisierung 3
description: Sonnenaufgang / Untergang
trigger:
- platform: sun
event: sunrise
offset: "-01:00:00"
id: Sonnenaufgang Beleuchtung aus
- platform: sun
event: sunset
offset: "01:00:00"
id: Sonnenuntergang Beleuchtung an
condition: []
action:
- if:
- condition: trigger
id:
- Sonnenaufgang Beleuchtung aus
then:
- service: light.turn_off
data: {}
target:
entity_id: light.carport_aussen_wandlampe
- if:
- condition: trigger
id:
- Sonnenuntergang Beleuchtung an
then:
- service: light.turn_on
data: {}
target:
entity_id: light.carport_aussen_wandlampe
mode: single
alias: Automatisierung 3 description: Sonnenaufgang / Untergang trigger: - platform: sun event: sunrise offset: "-01:00:00" id: Sonnenaufgang Beleuchtung aus - platform: sun event: sunset offset: "01:00:00" id: Sonnenuntergang Beleuchtung an condition: [] action: - if: - condition: trigger id: - Sonnenaufgang Beleuchtung aus then: - service: light.turn_off data: {} target: entity_id: light.carport_aussen_wandlampe - if: - condition: trigger id: - Sonnenuntergang Beleuchtung an then: - service: light.turn_on data: {} target: entity_id: light.carport_aussen_wandlampe mode: single
alias: Automatisierung 3
description: Sonnenaufgang / Untergang
trigger:
  - platform: sun
    event: sunrise
    offset: "-01:00:00"
    id: Sonnenaufgang Beleuchtung aus
  - platform: sun
    event: sunset
    offset: "01:00:00"
    id: Sonnenuntergang Beleuchtung an
condition: []
action:
  - if:
      - condition: trigger
        id:
          - Sonnenaufgang Beleuchtung aus
    then:
      - service: light.turn_off
        data: {}
        target:
          entity_id: light.carport_aussen_wandlampe
  - if:
      - condition: trigger
        id:
          - Sonnenuntergang Beleuchtung an
    then:
      - service: light.turn_on
        data: {}
        target:
          entity_id: light.carport_aussen_wandlampe
mode: single

Automatisierung 4:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: Automatisierung 4
description: Temperatur Kühlschrank
trigger:
- platform: numeric_state
entity_id:
- sensor.temperatursensor_kuhlschrank_buro_temperature
for:
hours: 0
minutes: 1
seconds: 0
above: 15
condition: []
action:
- service: notify.notify
data:
message: Der Kühlschrank erreicht eine kritische Temperatur
title: Kühltemperatur Achtung !
mode: single
alias: Automatisierung 4 description: Temperatur Kühlschrank trigger: - platform: numeric_state entity_id: - sensor.temperatursensor_kuhlschrank_buro_temperature for: hours: 0 minutes: 1 seconds: 0 above: 15 condition: [] action: - service: notify.notify data: message: Der Kühlschrank erreicht eine kritische Temperatur title: Kühltemperatur Achtung ! mode: single
alias: Automatisierung 4
description: Temperatur Kühlschrank
trigger:
  - platform: numeric_state
    entity_id:
      - sensor.temperatursensor_kuhlschrank_buro_temperature
    for:
      hours: 0
      minutes: 1
      seconds: 0
    above: 15
condition: []
action:
  - service: notify.notify
    data:
      message: Der Kühlschrank erreicht eine kritische Temperatur
      title: Kühltemperatur Achtung !
mode: single

Automatisierung 5:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: Automatisierung 5
description: ""
trigger:
- platform: state
entity_id:
- sensor.nachtmodus_action
from: null
condition: []
action:
- service: input_boolean.toggle
target:
entity_id: input_boolean.smarthome_nachtmodus
data: {}
- if:
- condition: state
entity_id: input_boolean.smarthome_nachtmodus
state: "on"
then:
- service: light.turn_off
data: {}
target:
entity_id:
- all
- if:
- condition: state
entity_id: input_boolean.smarthome_nachtmodus
state: "off"
then:
- service: light.turn_on
target:
entity_id:
- light.flur_og_treppe_deckenlampe
- light.flur_eg_treppe_deckenlampe
data: {}
mode: single
alias: Automatisierung 5 description: "" trigger: - platform: state entity_id: - sensor.nachtmodus_action from: null condition: [] action: - service: input_boolean.toggle target: entity_id: input_boolean.smarthome_nachtmodus data: {} - if: - condition: state entity_id: input_boolean.smarthome_nachtmodus state: "on" then: - service: light.turn_off data: {} target: entity_id: - all - if: - condition: state entity_id: input_boolean.smarthome_nachtmodus state: "off" then: - service: light.turn_on target: entity_id: - light.flur_og_treppe_deckenlampe - light.flur_eg_treppe_deckenlampe data: {} mode: single
alias: Automatisierung 5
description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.nachtmodus_action
    from: null
condition: []
action:
  - service: input_boolean.toggle
    target:
      entity_id: input_boolean.smarthome_nachtmodus
    data: {}
  - if:
      - condition: state
        entity_id: input_boolean.smarthome_nachtmodus
        state: "on"
    then:
      - service: light.turn_off
        data: {}
        target:
          entity_id:
            - all
  - if:
      - condition: state
        entity_id: input_boolean.smarthome_nachtmodus
        state: "off"
    then:
      - service: light.turn_on
        target:
          entity_id:
            - light.flur_og_treppe_deckenlampe
            - light.flur_eg_treppe_deckenlampe
        data: {}
mode: single