Das ist gut möglich, dass es da um Verzögerung ging. Das Video war in Englisch und da kann es bei mir schon mal passieren, dass ich ein Detail vielleicht falsch verstehe.
Hab es nun geändert, ist es so korrekt?
Ich kenne es noch von Javascript so, dass man versucht unnötiges Triggern bzw. schalten zu vermeiden. Ist dies auch in HA relevant? Daher habe ich z.B. als Bedingung angegeben, dass das Licht nur ausgeschaltet werden soll, wenn es auch an ist.
alias: BWM_DR_Eingang
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.dr_eingang_bwm_bewegung
from: "off"
to: "on"
id: Bewegung erkannt
- platform: state
entity_id:
- binary_sensor.dr_eingang_bwm_bewegung
from: "on"
to: "off"
id: keine Bewegung mehr erkannt
for:
hours: 0
minutes: 1
seconds: 0
condition: []
action:
- choose:
- conditions:
- condition: and
conditions:
- condition: trigger
id:
- Bewegung erkannt
- condition: sun
before: sunrise
after: sunset
sequence:
- service: light.turn_on
target:
entity_id: light.dr_eingang_sa_led
data: {}
- conditions:
- condition: and
conditions:
- condition: state
entity_id: light.dr_eingang_sa_led
state: "on"
- condition: trigger
id:
- keine Bewegung mehr erkannt
sequence:
- service: light.turn_off
metadata: {}
data: {}
target:
entity_id:
- light.dr_eingang_sa_led
mode: restart