That works very good, but it acts too often when it’s heavy sunny and heavy cloudy. Shutters open and closes sometimes very often which I want to avoid.
I want now that the numeric condition must be 10 minutes above 65000 lux to close the shutters; starts service: cover.set_cover_position.
The “FOR” is not working in automations. How can I get the “FOR” working?
Is this the right way? Working with a binary sensor?
Template binary sensors support a delay_on option, which is functionally the same as for: in your condition.
What I’ve done in a similar situation though is use multiple numeric state triggers, requiring the light level to be above a threshold for different time periods, the higher the threshold, the shorter the period. Given that you’re requiring the sensor to be above 65000, there’s no reason not to include that in the trigger.
I always thought that I need to activate/trigger the sun sensor first for changes and then the given value.
It makes sense!
A shame that it is cloudy today so I can’t test with real life situation, but it makes sense!
So I can set the limits and time in lovelace or adjust them dynamically by other automations.
I am not 100% sure, but with all the new rewrites of the templates and automations coming up in 0.115, I hope I will soon be able to change it to sometihng like
I use automations to set the values of the input_numbers and input_datetimes based on different parameters.
In the winter, the sun is not as strong, but lower in the sky, so it is more annoying at lower lux levels (shining through the windows). In the summer, I don’t need it to trigger before the level is really high, as a sun high in the sky, although brighter in lux measurements it shines less through the windows.