Need to learn: Door open for 5 minutes

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.


But I can’t get this rule to work.

What am I doing wrong.

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.

I understand and have to rethink my whole rule.

Thanks for your reply.

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”.

1 Like

Great, I’ll try as soon as possible.

JKB121
Your proposal can be made simpler.
Eg. as shown here.


I must not have been good at explaining myself.

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.

But as explained by josh, that’s not an option

Can you help me better understand the delay?

I’m trying to understand why you would check the temperature immediately and then wait 5 or 10 minutes to send the notification.

I suspect there is a way to accomplish what you want, but I just don’t understand the timing that you want.

Yes, communication is a difficult discipline,

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.

Hope my explanation can be understood.

You could do something like this.

TRIGGER
Door stays open for 5 mins
Door stays open for 15 mins

FLOW
IF (AND)
door has stayed open for 5 mins
temp is less than 3°C
THEN
send notification

IF
door has stayed open for 15 mins
IF (AND)
temp is greater than 3°C
temp is less then 12°C
THEN
send notification

Terri
Fantastic - you are the best.

I did as you recommended and it works exactly as I wanted it to.

Thank you so much for your help.
:star_struck:

1 Like

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.

Thanks - I learn something every day