Light should go on for 2 minutes when there is movement and darkness

Hi there,

I want one of the lights to switch on for 2 minutes when there is movement in the room. But only if the brightness is below 50 lux.
Then the light should switch off again.
If there is movement in between, the time should be counted again.
Unfortunately, I cannot manage this simple automation.
I would be very happy about help.

LG Werner

I’ve tried so far:

German:
Hallo,

ich möchte, dass das eine Leuchte bei Bewegung im Raum für 2 Minuten einschaltet. Aber nur wenn die Helligkeit unter 50 Lux beträgt.
Dannach soll die Leuchte wieder ausschalten.
Wenn zwischendurch Bewegung ist, soll die Zeit neu gezählt werden.
Leider gelingt mir diese einfache Automatisierung nicht.
Ich würde mich sehr über Hilfe freuen.

LG Werner

Das habe ich bisher versucht:

- id: '1630255756476'
  alias: Licht Eingang EIN per Bewegung und Lux
  description: ''
  trigger:
  - platform: state
    entity_id: binary_sensor.lumi_lumi_sensor_motion_aq2_ias_zone
    from: 'off'
    to: 'on'
  condition:
  - condition: state
    entity_id: sensor.lumi_lumi_sensor_motion_aq2_8190c306_illuminance
    state: <50
  action:
  - type: turn_on
    device_id: e82844cd579aa95f8d98134e820cccde
    entity_id: light.lc13_paulmann_level_light_color_on_off
    domain: light
  mode: single
- id: '1630255879751'
  alias: Licht Eingang AUS wenn keine Bewegung
  description: ''
  trigger:
  - platform: state
    entity_id: binary_sensor.lumi_lumi_sensor_motion_aq2_ias_zone
    from: 'on'
    to: 'off'
    for: '120'
  condition: []
  action:
  - type: turn_off
    device_id: e82844cd579aa95f8d98134e820cccde
    entity_id: light.lc13_paulmann_level_light_color_on_off
    domain: light
  mode: single

You can try this-

trigger:
  - platform: state
    entity_id: binary_sensor.lumi_lumi_sensor_motion_aq2_ias_zone
    to: 'on'
    id: 'ON'
  - platform: state
    entity_id: binary_sensor.lumi_lumi_sensor_motion_aq2_ias_zone
    to: 'off'
    for: '00:02:00'
    id: 'OFF'
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: 'ON'
          - condition: state
            entity_id: light.lc13_paulmann_level_light_color_on_off
            state: 'off'
          - condition: numeric_state
            entity_id: sensor.lumi_lumi_sensor_motion_aq2_8190c306_illuminance
            below: '50'
        sequence:
          - service: light.turn_on
            target:
              entity_id: light.lc13_paulmann_level_light_color_on_off
    default:
      - service: light.turn_off
        target:
          entity_id: light.lc13_paulmann_level_light_color_on_off
1 Like

Many many thanks. That works great. Thanks.

Greetings Werner

Vielen herzlichen Dank. Das funktioniert super. Danke.

Gruß Werner