AND condition for sensors

I have 2 sensors (motion and door).
What I want to achieve:
The light turns off, when no motion is detected for 3 minutes AND the door is closed.

My configuration:

- id: '1602343126878'
  alias: Kellereingang aus
  description: ''
  trigger:
  - platform: device
    type: turned_off
    device_id: bdbc4a8b0b0a11eb8d96eddc75008509
    entity_id: light.kellereingang
    domain: light
    for:
      hours: 0
      minutes: 3
      seconds: 0
  - type: not_opened
    platform: device
    device_id: 8bb8f27d0b0711eb8e219362f89d11dc
    entity_id: binary_sensor.tursensor_kellereingang
    domain: binary_sensor
  condition:
  - condition: and
    conditions:
    - type: is_no_motion
      condition: device
      device_id: a96187e40b0a11eb87fdb5e92d5eb029
      entity_id: binary_sensor.kellereingang4
      domain: binary_sensor
    - type: is_not_open
      condition: device
      device_id: 8bb8f27d0b0711eb8e219362f89d11dc
      entity_id: binary_sensor.tursensor_kellereingang
      domain: binary_sensor
  action:
  - type: turn_off
    device_id: bdbc4a8b0b0a11eb8d96eddc75008509
    entity_id: light.kellereingang
    domain: light
  mode: single

The sensors are doing their job just fine.
Issue: The automation never triggers and I scratch my head why.
Anyone an idea what is wrong?

You’re monitoring the light not the motion sensor in your first trigger.

Hmpf, idiot me!

Thank you so much. :slight_smile:

1 Like