Problem mit YAMA V11, Lichtsteuerung über Bewegungsmelder und Lichtsensor

Ich hatte hier, da die Frage mehrfach pro Woche auftaucht, mal ne Automatisierung beschrieben

Da kann man bei den Aktionen eine kleine Verzögerung einbauen

description: ""
mode: single
triggers:
  - entity_id:
      - binary_sensor.bwm_occupancy
    id: motion-on
    from: "off"
    to: "on"
    trigger: state
  - entity_id:
      - binary_sensor.bwm_occupancy
    id: motion-off
    from: "on"
    to: "off"
    for:
      hours: 0
      minutes: 2
      seconds: 30
    trigger: state
conditions: []
actions:
  - delay:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 250
  - choose:
      - conditions:
          - condition: trigger
            id:
              - motion-on
          - condition: numeric_state
            entity_id: sensor.bwm_illuminance_lux
            below: 50
        sequence:
          - target:
              entity_id: light.xy
            data: {}
            action: light.turn_on
      - conditions:
          - condition: trigger
            id:
              - motion-off
        sequence:
          - target:
              entity_id: light.xy
            data: {}
            action: light.turn_off

Geht natürlich auch mit der IF ELSE Variante.