I already had a Domoticz system running, and wanted to be able to monitor and close my two doors. Since I have two doors, I ruled out any commercial options, too much money for me.
I ended up using a ESP board (Wemos mini D1) connected to a couple of relays. The relays are wired in parallel across the same wires as the open/close button. To open/close, I close the relay for about 1/2 a second, to short the wires.
I also have two magnetic reed switches, to detect if the doors are closed. Same switches used in home alarm systems, so readily available.
The ESP is running ESP Easy, which makes it easy to setup and communicate with Domoticz.
Domoticz is running a script, which sends me a text if either door has been open for more than 10 mins. I could auto close, but I don't. I have a virtual switch setup in Domoticz that lets me close the doors. I also have a cam that I can use to check the doors if I get this message, and am not at home.
I used dzvents for the script. This is a kind of add on to lua, but it makes it easier to address the switches and stuff.