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:
- If automation #1 fires, have it set a flag using a virtual toggle
- Automation #2 fires if the door is closed and the flag has been set.
- 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?