Little help for my "Please Close Door" rule?

Goal: If any door is left open for longer than 20 minutes, notify. When closed, notify 'thanks'

I have the trigger set as door stays open for 20 minutes, then capture the device name, notify - then wait for all doors to be closed - and then notify again 'thanks for closing'.

It often works perfect, but something's amiss because it isn't always the right door. For example, right now the "Screen Door" is open, yet "Mud Door" is what was captured? Any ideas?

I wonder if it might actually be picking up the last door that opened rather than the one that stayed open for the duration (20 minutes)?

I think so too, but it's not been open for 20 minutes, so it shouldn't have triggered the rule, right?

You are having the same issues as Wrong triggered %device%. Basically, you’ll have two options: 1) individual rules or 2) using a local variable to track the devices. There is an example at the end of the thread that would work for a single rule (Wrong triggered %device% - #16 by pseudonym).


Ah, that looks like exactly my same situation. Looks like I can manage it will within one rule, just bed to define conditions for each and sequence the IF statements. Thanks all!!

1 Like

@bobbyD wouldn’t this be considered a bug?
Shouldn’t the device that actually triggers the rule be the one captured in %device% ?

Just did a quick test to confirm how it works:

Essentially, as we saw in your rule, it waits for any of the triggers to remain on for the duration, and will show the last trigger. I suspect that this is the intended functionality.

In order for this to work the way you’d like, to show what triggered the rule the first time, you would need to cloned the rule and each clone would be triggered by one of the events.

First, select one of the triggers, then clone the rule - you will be offered the option to modify the trigger to the 2nd one. Do this until you have one rule each.

Not sure if this can be done, but adding a toggle to the trigger that would allow to select if the first or the last trigger should be the recorded within the “%devices%” could be a way around this. Tagging @bravenel in case this might be of interest.

If I said I would give $100 if anyone who could hold their breath for ten minutes, should the person who just closed their mouth get the money or the one turning blue? :bust_in_silhouette:

Did some further testing and one use case that certainly could be a problem is where the switch 1 is turned on, then 2 is turned on, then 1 is turned off…

Also of interest - if the trigger is separated in 2, the same scenario results in a rule that doesn’t trigger:

In that scenario, switch 2 is just ignored.

I believe this apparent bug with multiple triggers with "stay" (or wait for multiple event with "duration") was previously observed elsewhere, but hasn't been confirmed by staff to my knowledge :

I can reproduce that %device% can be set wrong in this case. A fix for that will be in the next release. When stays is used, %device% will be set to the device that stayed, not the most recent one to have been touched as it is now.


Gosh I love this community and the HE staff :slight_smile:
You guys are all awesome, thanks!!

1 Like