I have the following automation configured
- alias: Turn on lights when it gets dark while anybody home
trigger:
platform: numeric_state
entity_id: sensor.kinoteatr_datchik_osveshchennosti_165
value_template: "{{ states.sensor.kinoteatr_datchik_osveshchennosti_165.state | float }}"
below: 30
for: 00:05:00
condition:
condition: state
entity_id: binary_sensor.occupied
state: 'on'
action:
- service: scene.turn_on
entity_id: scene.kitchen_light_on
the expected behaviour is turn on the lights when lux sensor changes from value above 30 to value below 30 with 5 min delay.
It works in most cases. But the automation is triggered when lux sensor changes from 0 to anything in range 1-30 that is definitely wrong.
Actually there are 2 automations this one and another that turns lights off when lux sensor gets above 40. Idea is to turn on lights if it is too dark and off when it gets bright enough again.
So I get lights turned on when it is rainy and off when the sun returns also the lights are automatically turned on in the dusk. But in the early morning when sun rises lights are turned on while I do no need it - there is no moment when lux value crosses 30 threshold but automation is still triggered…
Need help with getting it work or any hint on why numeric_state may work like this…