MyQ’s hub comes with a sensor you put on the door that will tell you when the garage is opened or closed.
You need to specify a GPS location and then set it to auto-close/open when a certain distance from it. It won’t auto-close if you’re in the garage that way.