It is always unfortunate when the garage door is left open when you leave for an extended period of time. This has happened to me a couple of times. By leaving the garage door open, I was inviting unwanted guests into the garage. An unwanted guest can be animals looking for a meal and spreading trash all over. It could also be another person that sees an opened garage door as an invitation to visit. Fortunately, this has not happened to me. It did, however, force me to figure out a solution to notify me when the garage door is opened.

Security Considerations/Requirements

  • A solution must provide me and my wife with a notification when the garage door is in an open state.
  • It must not relinquish control of monitoring to another service.
    • This required the door to be monitored by a device at home and not send data to another server.
  • An on-premise solution required the device to not have any open services.

Raspberry PI to the Rescue

The solution was to configure a Raspberry PI to service my garage door. The configuration required a relay, a magnetic switch, and access to Google’s email API. The relay was used to interface with the garage door. This allowed the Raspberry PI to close/open the garage door. However, to close the door, the Raspberry PI needs to know the current state of the garage door. This is where the magnetic switch was used to determine the state of the door.

When the garage door was in an open state, the Raspberry PI would notify me. This notification repeats every hour until the garage door is in a closed state. To enable notifications, I configured the Raspberry PI to send emails using Google’s Gmail API. Google’s API allowed the Raspberry (Read more...)