check, if the power stays for at least 2 minutes below 5W
if it stays below 5W for two minutes, send me a notification
if it goes above 5W within that two minutes, stop the automation
I think, that wait_for_trigger could be a thing, but I dont know, how I can do an action, only if a timeout occurs. I would like to have something like that:
I don’t know of a way to do that. But what you could do is start a timer, and cancel it if the right conditions occur. You can see if timers are running when a trigger happens too.
Well, probably a lot different. I avoid wait for triggers, because they do not survive restarts. Timers do restore after restarts.
But looking back at your question, you do not need timers at all. You can create an automation with a trigger: power is below 5 for two minutes. It will not trigger if the power is below 5 for less time. That trigger also implies it was above it before that, so it basically that covers all. Unless you really want to know it was less long.
If you do want to do different things based on timeout or not, you could simply test the state again after the wait for. If the state is not what you waited for, it timed out.