#Trigger an automation only if a door was open for more than 2 minutes and it was closed.

1 messages · Page 1 of 1 (latest)

random lava
#

We have a door that shouldn't be open very long. I have an automation that sends us a slack message if the door was open for more than 2 minutes. This was easy and straightforward. Call this automation #1.

Now I want to have a message sent that the door was closed, but only in the condition the other automation fired. Call this automation #2.

I can see only one way to do this, which is to:

  1. If automation #1 fires, have it set a flag using a virtual toggle
  2. Automation #2 fires if the door is closed and the flag has been set.
  3. Automation #2 clears the flag after firing.

Is there another way that removes the toggle? Can I just check to see if the door has been open for more than 2 minutes in Automation #2?