I've followed a youtube tutorial on configuring a rPi with a magnetic reed switch and relay switch to allow for my garage door to be opened and closed via Homekit on my iPhone. It works great.
The only thing now that I'd like to figure out is how to start a countdown timer each time the door is open, and if the timer reaches zero, close the garage door. And if the garage door happens to be closed before the timer reaches zero, the timer should be terminated.
What's the best approach for something like this?
I'm pretty sure that the tutorial scripts included the install of rpi.gpio. I can run "gpio readall" from a terminal prompt, and I can see that pin 12 is "1" when the door is closed, and "0" when the door is open.