Did you wait to have the value go below the given value, then go above it, and stay above it without interruption for exactly three minutes? Or did you expect it to fire because it was already so for three minutes? Because the second thing I asked is not how it works:
I expect to trigger the fire when “esp32” is above “inverter” for three minutes. Not directly when “esp32” is above “inverter” for a single measurement because they have different update intervals. This currently causes false fires and is correctly after all sensors are up to date. I tried to prevent this using “for” condition.
For three minutes, that is clear. But you did not answer my question. When did it “fail” to do so in your opinion. When it was already more then three minutes above the limit, or did you test when the value started below(!!!) and then it rose above, stayed above continuously without going below, and then was exactly three minutes after it rose above? Because leave even one of those things out then it does not fire.
I would also leave out the below: null line because that might produce unexpected results.
(edit: sorry, I mistook the trace for AI generated automation garbage. I edited my last rant out, I’m happy to help).
Ok, I try to describe it more precisely:
In general the esp32 is below inverter state, this is the starting point. When now esp32 rose above inverter the automation trigger “fails”, because it does not check this state for three minutes. I expect a fire event only if esp32 is above inverter for three minutes.
If esp32 goes below inverter during the three minutes nothing should happen and the process starts again when esp32 is above inverter again.
I checked the statistics and esp32 is not above inverter for three minutes but automation trigger was fired.
Yes, it is clear now. However, you said it was the same as the post you referred to. In that post it did not fire, so that was my assumption. Now you say it did fire, but too soon.
The trace you gave does not show the value of the limit you tested for. I do not immediately see anything weird, but I also cannot see what the state of the invertor sensor is, so it is hard to tell if that value is the cause. Is it a positive value, or negative?
On second thought, I do think I know what is wrong. The limit is set when the trigger is primed. It expects an input_number. I think I read before it does not allow a sensor value that is constantly changing. So the value may have been lower for three minutes, but compared to some (arbitrary) value it saw when loading.
So what you should do is create a template sensor to compare the values (either subtract them, or create a binary sensor to compare them), and then a trigger on that sensor, using the delay. Another option is to do the calculation in a value template in the numeric state condition, and use a fixed boundary.
Not obvious behaviour. I’d solve this problem with a template binary sensor helper set to be on if one variable is higher than the other, then use that in a state trigger with the for time set.