As part of a longer rule, I want to turn on a light as an indication that a door has been open for more than 5 minutes.
In my experiments, I use variables as symbols of real doors and also variables as symbols of time and light. Then I don’t have to go and open and close doors. (I am too lazy).
This rule works fine.
Your trigger is changes to true and the first condition is stayed true for 5 minutes, so the condition will never match.
The rule will trigger from the variable changing and then immediately check if the variable has stayed true for the past 5 minutes which will never be true.
If you only want the rule to trigger if the variable has stayed true for 5 minutes, you should make that adjustment directly in the trigger.
Admittedly, this can be done with 2 rules. This sends me a message when the basement door has been left open for 5 minutes. You would just need the action to be “LIGHT” “TURN ON”.
What I want is to ask in the TRIGGER if the door is open.
And then down in TRIGGER ask:
If the temperature is less than X degrees, notify me after 5 minutes
If the temperature is Y degrees, let me know after 10 minutes.
I want to receive a notification if the temperature is less than 3℃ AND the door has been open for 5 min., but if the temperature is less than 12℃ I only need to be notified when 15 minutes have passed.
One minor comment I would make is that you might consider making your state stays condition shorter than the trigger by a few seconds. Otherwise you might end up with a timing issue where the trigger uses the event to verify that the device stayed the expected value for the specified duration, but the state might be milliseconds different (depending on your smart home hub) so the condition could fail.
If you only have those two triggers, then you could also use any reasonable time amount and use the THEN and ELSE paths of the condition:
TRIGGER
Door stays open for 5 mins
Door stays open for 15 mins
FLOW
IF
door has stayed open for 10 mins**
THEN
IF (AND)
temp is greater than 3°C
temp is less then 12°C
THEN
send notification
ELSE
IF
temperature is less than 3*C
THEN
send notification
** The main condition is any value greater than 5 minutes and less than 15 minutes since our primary goal is to differentiate between the 5 and 15 minute triggers. When the 5 minute trigger is fired, the state stays condition should be right around 5 minutes, so if we use a value like 10 minutes, then when it is true that means it must be the 15 minute trigger that we are in, else we are looking at a 5 minute trigger.