Dear all:
New to Home Assistant and hope can get some hints on where to look for my issue with automation. I have made the below automation to “open” blinds (it actually closes it), when the outdoor light is above 50000lx for more than 15 minutes and weather condition allows to open it:
During a day it only gets triggered once - that’s when the outdoor lx goes above 50000lx for 15 minutes. However in some cases the condition blocks the action, and I’d like to trigger again when the trigger condition is still met. How to do it then? I can make a trigger for every change of the sun sensor, however in condition I can’t specify number state above value “For” xx minutes.
Any suggestion where I should look? Thank you!
Thanks - I can add a time pattern to check condition periodically - however the issue is I cannot say Number X is greater than Y for Z minutes under condition.
Having only this part in the triggers will make it trigger everytime that sensor change.
No, idea how to get the “for” part easily in the condition though.
Only thing I could come up with was another template sensor to indicate the time the sensor was in one condition.
Don’t add a time pattern. That will make it worse.
No you can’t do that in one go. But you can add a numeric condition is larger than something, and then a new condition state is empty in both to and from and for 15 minutes.
Those two combined will be the same
If you want a rolling number, then you will have to look into the history/statistic parts.
A rolling number is when you look back 15 minutes and select the lowest number, but when that number expires then you again look back and find the lowest number in the past 15 minutes.
For this search back in the past values you need to use the recorder and some history/statistic sensor.
Thanks - sounds too complex for what I need. The only reason I have for is because I have another automation to open it when it’s dark, I’d like to avoid the senario that it keeps up and down during a cloudy day
Don’t make this more complex than it needs to be. Create a new “threshold” sensor (devices & services → helpers → threshold sensor).
Select your luminance sensor as the input, and use “above 50000” as the settings.
Now you have a new binary sensor that will be ON when lux is above 50000.
As hellis81 said earlier enter all your triggers as conditions and all your conditions as triggers, except replace the numeric state trigger & condition with a state trigger using your new threshold sensor. Since it is a state trigger, it allows “for” as an option in the conditions.
I believe what Wally said is the easiest.
Create a statistics sensor.
Use this as the trigger and condition.
And add all the triggers to conditions and conditions to triggers.
Good to learn that - I didn’t know I can use for for state in conditions.
And threshold sensor itself is interesting: would it be possible to say the binary sensor is ON when light > 50000 and OFF when light drops <30000?
So what I want is to close blind above 50000, and open blind below 30000.
Many thanks for your hint!
The for is supported in condition for non-numbers - I think that solves all the problems with a price of additional sensor.
Just reading it up: I really wish something could allow me to:
Turn on when value > 50000
Stay on until value drops < 30000
Turn off when value < 30000
It will solve so many things for me:
Temperature warning - flipping between 19.9 and 20.0 (annoying)
My ventilation summer/winter → 14 degree summer, stays until it goes down below 10.
Question is whether threshold sensor actually support it?
Edit: would this work?
Got it; you can use a State Condition, which support the for option, to confirm the Threshold Binary Sensor’s value has been on for at least 15 minutes.
FWIW, this section explains the Threshold Binary Sensor’s behavior depending on which options are used.
If I have understood the documentation correctly,
that configuration will turn on the binary_sensor when light level increases above 40000+10000=50000 and turn off when it decreases below 30000.
I guess I will get the same problem why I posted here?
The trigger only runs once and stays on for the rest of the day, the condition will only be evaluated once