Hi!
Please help me understand:
The following automation is supposed to turn on the light when motion of either of two motion sensors is detected. This is constricted by the condition that the light in the concerned room is very dim.
This part of the script is working fine.
Moreover the script is supposed to turn off the light again when no motion of either of the two motion sensors is detected for the period of two minutes.
This fails however, the light stays on.
I don’t see why and would like to understand my misconception.
Thanks!
alias: Küchenlicht auto
description: Schaltet helligkeitsabhängig die Küchenbeleuchtung bei Bewegung
trigger:
- type: motion
platform: device
device_id: 86e38ad9b4f4687d621ef546532fafa7
entity_id: 8cdaaf34341ad2863af7283d6653dc93
domain: binary_sensor
- type: motion
platform: device
device_id: c9552c79bc0557c4abcb919e6c135d0e
entity_id: 6a8d07c1edd3d966612eb2492e340c4f
domain: binary_sensor
condition:
- type: is_illuminance
condition: device
device_id: c9552c79bc0557c4abcb919e6c135d0e
entity_id: feecf5105402f42de2c5a404c1d22502
domain: sensor
enabled: true
below: 20
action:
- service: light.turn_on
metadata: {}
data:
brightness_pct: 75
target:
device_id: a6c01d7aa4559b4a87d950cca94551b3
- if:
- type: is_no_motion
condition: device
device_id: c9552c79bc0557c4abcb919e6c135d0e
entity_id: 6a8d07c1edd3d966612eb2492e340c4f
domain: binary_sensor
for:
hours: 0
minutes: 2
seconds: 0
- type: is_no_motion
condition: device
device_id: 86e38ad9b4f4687d621ef546532fafa7
entity_id: 8cdaaf34341ad2863af7283d6653dc93
domain: binary_sensor
for:
hours: 0
minutes: 2
seconds: 0
then:
- service: light.turn_off
metadata: {}
data:
transition: 20
target:
device_id: a6c01d7aa4559b4a87d950cca94551b3
mode: single