I have two automations (for the dining and living room) that turns on my lights when the luminance will drop below 15 lux. This works most of the time flawless, however last time I noticed that the automation sometimes triggers when it shouldn’t.
As you can see in the screenshots below the automation is triggered at 0:28:36. At that moment de state of sensor.luminance_woonkamer changes from 8lux to 0 lux. And binary_sensor.motion_woonkamer is “off”. So the question is why the automation triggers? This behaviour occurs with both my automations (dining room and living room) each with a different device.
- alias: 'lampen woonkamer aan'
trigger:
- platform: numeric_state
entity_id: sensor.luminance_woonkamer
below: 15
- platform: state
entity_id: binary_sensor.motion_woonkamer
to: 'on'
condition:
- condition: state
entity_id: light.woonkamer
state: 'off'
- "{{ trigger.from_state is not none }}"
- condition: state
entity_id: binary_sensor.home
state: 'on'
- condition: state
entity_id: binary_sensor.sleeping
state: 'off'
- condition: numeric_state
entity_id: sensor.luminance_woonkamer
below: input_number.lux_threshold
action:
- service: homeassistant.turn_on
entity_id: light.woonkamer