Automation testing condition with delay with respect to trigger

HA has changed a bit in the last few years, so wanted to share how I got this to work:

TLDR; put a “condition” in the “Then Do”/Actions section.

This automation checks if the motion detector in the garage goes off, checks if the garage door is closed and if the automation itself has not fired in the last 5 min (de-bouncing the sensor) and then checks for 3 seconds if the garage door opens, else notifies me that someone is in the garage.