I’m trying to make an automation to close my covers when LUX goes bellow 1.6 with no luck.
I read a lot of posts about this but I can’t figure out what’s wrong. When I try to run the automation manually it works fine. If I cover the lux sensor for 5 minutes it goes bellow 1.6 but the lights don’t turn off.
I did this experiment after 12:00:00.
alias: Luzes Por do Sol
description: ""
trigger:
- platform: numeric_state
entity_id: sensor.multisensor_brightness
for:
minutes: 1
below: 1.6
condition:
- condition: time
after: "12:00:00"
before: "23:00:00"
action:
- service: switch turn_on
target:
entity_id:
- switch.luz_da_entrada
- switch.luz_do_ginasio
- switch.luz_do_jardim
- switch.luz_do_terraco
- switch.candeeiro_do_hall
mode: single
Be aware that a Numeric State Trigger will trigger only when the sensor’s value crosses the threshold of 1.6. In other words, it triggers the moment the value decreases from above 1.6 to below 1.6.
If your experiment successfully triggered the automation, it will have produced a trace. Examine the automation’s trace to learn why the lights didn’t turn on.
To test it, go to Developer Tools > States and, in the Entity column, click on sensor.multisensor_brightness. It will make all of the sensor’s information appear in a form at the top of the page.
In the form’s State field, replace 36.72 (or whatever value is displayed as long as it’s above 1.6) with 1.5 and then click the Set State button.
After 2 seconds, a persistent notification should appear (orange bell icon at the bottom of the left-hand menu). Click the orange bell icon to display the notification. It will report the time when the automation triggered and the sensor’s value (which should be the value you entered 1.5).