Licht Automation schaltet Licht nicht mehr aus, wenn Lux Wert über soll

Hallo zusammen,

ich habe vor Kurzem eine simple Automation erstellt, die abends wenn der Lux Wert 100 unterschreitet, aktiv werden soll. Sprich, das Licht im Flur soll dann an gehen bei Bewegung.
Hat anfangs auch ganz normal funktioniert aber seit ein paar Tagen ist mir aufgefallen, dass morgens Licht dauerhaft leuchtet, obwohl es sich eigentlich automatisch abschalten müsste, wenn der Luxwert über 100 steigt, was eigentlich der Fall ist.

Hier mal mein Yaml Code. Vielleicht hat jemand ne Idee. Bin noch nicht so fit in Automationen.

alias: Nachtlicht Flur bei Bewegung (Flur oder Bad)
description: >-
  Schaltet das Nachtlicht im Flur bei Bewegung im Flur oder Bad ein und
  nach 30 Sekunden ohne Bewegung wieder aus.
triggers:
  - entity_id:
      - binary_sensor.bwm_flur_occupancy
      - binary_sensor.bwm_bad_occupancy
    to: "on"
    trigger: state
  - entity_id:
      - binary_sensor.bwm_flur_occupancy
      - binary_sensor.bwm_bad_occupancy
    to: "off"
    for: "00:00:30"
    trigger: state
conditions:
  - condition: numeric_state
    entity_id: sensor.bwm_flur_illuminance
    below: 100
actions:
  - choose:
      - conditions:
          - condition: or
            conditions:
              - condition: state
                entity_id: binary_sensor.bwm_flur_occupancy
                state: "on"
              - condition: state
                entity_id: binary_sensor.bwm_bad_occupancy
                state: "on"
        sequence:
          - target:
              entity_id: light.nachtlicht_flur
            data:
              brightness_pct: 1
            action: light.turn_on
      - conditions:
          - condition: and
            conditions:
              - condition: state
                entity_id: binary_sensor.bwm_flur_occupancy
                state: "off"
              - condition: state
                entity_id: binary_sensor.bwm_bad_occupancy
                state: "off"
        sequence:
          - target:
              entity_id: light.nachtlicht_flur
            action: light.turn_off
            data: {}
mode: restart

Steht da ein Fehler, wenn du bei der Automation auf Traces schaust?

Das hier steht drin, sonst nichts:

Ich hatte das Licht dann manuell im Dashboard ausgeschaltet.

Moin,

kenne Deine Geräte nicht, aber ich hatte es einmal, dass nach einem Update, die Lux-Werte eines Zigbee Präsenzmelders, seltsam waren, dadurch wurde das Licht bei schönstem Sonnenschein eingeschaltet, erst als ich das in den Einstellungen angepasst hatte, musst den Wert mit X multiplizieren, damit die Automation, erst wieder bei < 2000 Lux funktioniert hat.
Als dann wohl eine Korrektur kam, musste ich den Multiplikator wieder herausnehmen, sonst wäre ich nie auf unter 2000 gekommen :slight_smile:

Will sagen, schau mal wie die Lux Werte des BWM sind.

VG
Bernd

Hallo,
das Problem ist die und wenn Bedingung. Das sollte bei komplexeren Automationen besser in den Dann Teil rein.

alias: Nachtlicht Flur bei Bewegung (Flur oder Bad)
description: >-
  Schaltet das Nachtlicht im Flur bei Bewegung im Flur oder Bad ein und nach 30
  Sekunden ohne Bewegung wieder aus.
triggers:
  - entity_id:
      - binary_sensor.bwm_flur_occupancy
      - binary_sensor.bwm_bad_occupancy
    to: "on"
    trigger: state
  - entity_id:
      - binary_sensor.bwm_flur_occupancy
      - binary_sensor.bwm_bad_occupancy
    to: "off"
    for: "00:00:30"
    trigger: state
conditions: []
actions:
  - choose:
      - conditions:
          - condition: numeric_state
            entity_id: sensor.bwm_flur_illuminance
            below: 100
          - condition: or
            conditions:
              - condition: state
                entity_id: binary_sensor.bwm_flur_occupancy
                state: "on"
              - condition: state
                entity_id: binary_sensor.bwm_bad_occupancy
                state: "on"
        sequence:
          - target:
              entity_id: light.nachtlicht_flur
            data:
              brightness_pct: 1
            action: light.turn_on
      - conditions:
          - condition: and
            conditions:
              - condition: state
                entity_id: binary_sensor.bwm_flur_occupancy
                state: "off"
              - condition: state
                entity_id: binary_sensor.bwm_bad_occupancy
                state: "off"
        sequence:
          - target:
              entity_id: light.nachtlicht_flur
            action: light.turn_off
            data: {}
mode: restart

1 „Gefällt mir“

Ah ok. Super. Habs abgeändert. Ich hoffe, das klappt dann morgen früh. Werde berichten. Danke.

Guten Morgen,

es läuft jetzt tatsächlich so wie es soll.
Vielen Dank an @rstuck und alle anderen.

:crayon:by HarryP: Zusammenführung Doppelpost (bei Änderungen oder hinzufügen von Inhalten bitte die „Bearbeitungsfunktion“ anstatt „Antworten“ zu nutzen)