At our house, my wife parks the car in the garage and I park in the driveway. Using the front door is inconvenient most of the time, so we primarily enter/exit the house through the garage. Depending on who is coming and going when, and who is working or playing outside, we often leave the garage door open much of the day on weekends and during the summer.
Unfortunately, because no one takes ultimate responsibility for closing the garage door at the end of the day, it was quite common to wake up in the morning to find the garage door had been left open all night.
This was my first ‘home automation’ project, which involved a lot of research and learning about ESP8266 boards, MQTT, installing and playing with Home Assistant, etc. So though it was a pretty simple project, I learned a lot from doing it.
Design a solution such that the garage door will close automatically if left open at night.
Other considerations:
In a nutshell, after much research, I followed the plans for GarHAge , so that all of this could be integrated into Home Assistant . I didn’t have HA set up yet at the time, so this project required doing that too. HA has since become my central hub for nearly everything.
I installed a magnetic reed switch like this that would serve to monitor the open/close state of the garage door. You can see where I attached it near the top of the garage door.
I installed an ESP8266 NodeMCU board and a relay in a small plastic enclosure.
Then I mounted the enclosure on top of the garage door opener. It’s powered with a simple 5v USB wall wart plugged into the same outlet as the garage door opener. (Note: the picture shows it held on with painter’s tape. That was just temporary until I got some velcro. It needed to be secure, as the opener vibrates a lot when operating.)
Finally, I wired the NodeMCU to the reed switch by running some low voltage speaker wire along the center of the ceiling. Then, I connected a jumper from the NodeMCU to the same connection point on the garage door opener where the wired, wall-mounted remote is connected.
So, the NodeMCU actually serves two purposes. 1. It tracks the state of the reed switch and reports to Home Assistant whether the garage door is open or closed. 2. It receives commands from Home Assistant and sends a pulse to the garage door opener which opens or closes the door, just like a wired, wall-mounted controller would.
Going beyond the GarHAge setup:
A series of HA automations does/achieves the following:
And finally, because sometimes I ride my bike on the trainer or someone is doing something in the garage that the motion sensor doesn’t pick up, I added a ‘motion sensor override’ input boolean sensor. This allows us to turn off the automation that turns off the lights so they’ll stay on if we need.