Git Product home page Git Product logo

pi_garage_alert's Introduction

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]
    sudo pip install slackclient
  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

pi_garage_alert's People

Contributors

rllynch avatar rorpage avatar acookoz avatar tuhsteh avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.