I tried to make what seemed to me a pretty straight-forward automation, but turned out to be more complicated than I thought.
I want that my shutter will be half-closed during the day, and fully opened during the night.
So I did two simple automations: (1) if lightlevel goes below 25,000 and stays like this for more than 2 minutes - open shutter; (2) if lightlevel goes above 25,000 and stays like this for more than 2 minutes - close shutter.
Simple, isn’t it? Not exactly.
The thing is, that when lightlevel is close to the 25,000 threshold, sometimes there suddenly may be a cloud in the sky (or other software glitch), which decreases lightlevel to 24,500, and after 30 seconds or so, it goes back 26,000. At this moment, when it goes above 25,000 - the shutter is being closed, which is not good, because the lightlevel was not changed, except those 30 seconds glitch.
Thanks Tom. That’s what I had until now.
But I wanted to go a step further.
Say if it is a rainy day, I don’t want the shutters to be closed during the day.
I want the shutters to be synced with the actual light outside.
Also, my next step is to adjust the lighting in my house according to the light level outside, and then I will encounter the same issue - lights will go on and off repeatedly and I don’t want this to happen.
It won’t solve the problem.
Say my current lightlevel is 20,000. There’s a cloud and then it decreases to 17,000, and after 30 seconds it goes back to 20,000 and stays like this for half an hour. The shutters will still be closed, where in actual they’re not supposed to do any action.
I would not recommand using Statistics sensor. Or maybe it has changed. But I tested it one year ago the computed average value was not a temporal value !!!
For exemple : let’s say illumination is 0 for 9 minutes and then 10 for 1 minute, the output average over the last 10 minutes would be “5” with Statistics !!
Thank you guys!
I installed the average sensor, and it seems to work fine. It’s already night time where I live, so I can’t test it right now.
Shaad - on Git it says - “when calculating the average, it does not take into account how much time the temperature value was kept” - Isn’t it what we wanted to avoid that occurs in the statistics sensor?