Garage Door AutoClose - Seeking Sequence Expression Masters

Hi All,

Over the last few years I’ve been adding more and more sensors to my garage. There are IR Beams across the doors, reed sensors, tilt sensors and now ultrasonic distance sensors (reporting both distance and is something ‘parked’ in the space).

I’ve largely got a handle on the automatic opening of the door when arriving, thanks to some funky PLEG and the iPhone locator preventing the 2 cars and 3 iPhones resulting in unexpected door action.

So what I’d like to implement now, is for the garage door to automatically close when I reverse out, and I’m clear of the door. For simplicity, let’s consider 1 door.

Available Triggers:

tGarage_Tilt - an indicator if the door is open or closed
tGarage_Beam - an indicator if the IR beam across the door is broken and therefore door is obstructed.
tGarage_Sensor - magnetic reed sensor indicating if the door is open or closed
tParked_Status - if the parking sensor has something less than 25cm in front of it (ie, car is in the parking space).
pDistance - this updates every 5 seconds and is cm from the wall, 1-150cm or 0 if nothing is in range. (device property).

Desired behaviour:

From being parked, the door is opened and car reverses out. Once suitably clear of the garage, the door closes.

Likely sequence of events:
Door Opens
Beam is broken
Parking status changes
Distance increases
Distance reads 0 (nothing in range)
Beam is cleared

I’ve had a few attempts and so far I’ve got something that triggers multiple times on the reverse out, but also triggers again when I’m driving in. So throwing this out to people smarter than me for ideas on how to manage the sequence and timing.

Hopefully we can develop the gold standard PLEG template for Garage automation (I don’t think there are any additional sensors that could be involved).

I would be interested in this as well

Shameless bump for anyone that may have additional insight or experience to share.