Skip to content

DawtCom/pi_garage_alert

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pi Garage Alert

Raspberry Pi Python script to email, tweet, or send an SMS if a garage door is left open.

Screenshot of garage door SMS alert

Quick Start

Here is a heavily condensed quick start guide. New users are strongly encouraged to read the full documentation at http://www.richlynch.com/code/pi_garage_alert.

  1. Equipment required
  2. Raspberry Pi model A or B 1. 2GB or larger SD card for the RPi filesystem 1. Magnetic sensor (e.g. http://www.smarthome.com/7455/Seco-Larm-SM-226L-Garage-Door-Contacts-for-Closed-Circuits/p.aspx) 1. USB wifi adapter (if not using Ethernet) 1. USB power supply for RPi
  3. Connect one wire of the magnetic sensor to a GPIO pin on the RPi and the other to a ground pin on the RPi. It is a good idea to put a 1kohm resistor in series with the sensor to protect the RPi from damage if anything is misconfigured.
  4. Raspberry Pi initial setup
    1. Follow the guide at http://elinux.org/RPi_Easy_SD_Card_Setup to write the Raspbian image to the SD card.
    2. Boot the RPi and at raspi-config, expand the filesystem, set the "pi" account password, set the hostname, and enable SSH.
    3. Reboot the Raspberry Pi
  5. Edit /etc/wpa_supplicant/wpa_supplicant.conf and configure the RPi to connect to your wifi network.
  6. Regenerate the ssh keys for security.
  7. Update the packages with sudo apt-get update && sudo apt-get upgrade, then install the dependencies:
    sudo apt-get install python-setuptools python-dev libffi-dev
    sudo easy_install pip
    sudo pip install sleekxmpp
    sudo pip install tweepy
    sudo pip install twilio
    sudo pip install requests
    sudo pip install requests[security]
  8. Optional email configuration
    1. Configure postfix to send mail using Google SMTP, or your ISP's SMTP server
  9. Optional twitter configuration
    1. On https://dev.twitter.com/apps/new, create a new application
  10. Optional twillio (SMS) configuration
    1. Sign up for a Twilio account at http://www.twilio.com.
  11. Copy bin/pi_garage_alert.py to /usr/local/sbin
  12. Copy etc/pi_garage_alert_config.py to /usr/local/etc. Edit this file and specify the garage doors you have and alerts you'd like.
  13. Copy init.d/pi_garage_alert to /etc/init.d
  14. Configure and start the service with
    sudo update-rc.d pi_garage_alert defaults
    sudo service pi_garage_alert start
  15. At this point, the Pi Garage Alert software should be running. You can view its log in /var/log/pi_garage_alert.log

Other Uses

The script will work with any sensor that can act like a switch. Some alternate uses include:

  • Basement or washing machine leak sensors
  • Window sensors

About

Email/tweet/SMS if a garage door is left open

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 87.5%
  • Shell 12.5%