I have an automation setup with a light sensor and a motion sensor. Everything worked well until I encountered a problem with the automation logic. I configured the automation to turn on the light when the luminance is above 200 lux. However, in the morning, the light levels are unstable, causing the sensor to occasionally drop below 200 lux for about a minute before rising again. During this fluctuation, the automation triggers and turns on the light.
Does anyone have a solution for this?
I want the automation to consider the light level for the last 2 minutes before the trigger to ensure that it remains above 200 lux
Unfortunately you have provided no code showing what you have done so far so I’m going to do a little guessing.
If you have used a numeric_state trigger you have a parameter there called for: I suggest you use that and set it so that the light level you want is checked to be stable about 4x longer than you think you might need, so like 5 minutes maybe. That should give you a more stable reading.
Thanks for your reply, @Sir_Goodenough. Here is the full code I’m using.
I utilize motion sensors, light sensors, and a camera to trigger actions, with specific conditions to restrict them.
One of my triggers is a numeric_state trigger set for 15 minutes, which is only useful at night when the light sensor reads below 200 lux.
In my situation, the motion or camera triggers activate the automation. At that moment, the light sensor is below 200 lux, the condition is met, the light turns on