GithubHelp home page GithubHelp logo

wvolz / garage-control Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 37 KB

Node.js program to control a garage door via a raspberry pi.

License: MIT License

JavaScript 61.19% CSS 9.89% Shell 24.41% HTML 4.51%
garage-door raspberry-pi garage-opener relay garage gpio javascript

garage-control's Introduction

Garage

Node.js app to control a garage door opener via a Raspberry Pi. This is based heavily off of Garage Node.

It has the following additional features:

  • Realtime state monitoring
  • Email notifications of state change
  • State changes are logged to a database

Requirements

  • node.js v4.4.x
  • systemd or forever to run the script long term (init/service scripts provided)
  • Express
  • Pug - For the one view template.
  • onoff - GPIO access
  • socket-io
  • database driver of your choice (tested with pg)
  • nodemailer
  • winston

Installation

  1. Checkout code from github into a local directory
  2. Install nodejs: On Debian based systems you can run the following to install node: [sudo] apt-get install nodejs npm
  3. Install node dependencies: npm install
  4. Copy init or systemd service script to the correct place
  5. Copy config.js.sample to config.js and change for your hardware
  6. Start process: service garage-control start
  7. Check process is running: service garage-control status

Configuration

Configuration is accomplished via a file called 'config.js'. Rename the file 'config.js.sample' to 'config.js' and edit the following variables to get started:

  • GARAGE_PIN - GPIO # controlling the relay connected to the garage opener.
  • GARAGE_DOWN - GPIO # connected to sensor indicating the garage is down.
  • GARAGE_UP - GPIO # connected to sensor indicating the garage is up.
  • RELAY_ON - Relay on state.
  • RELAY_OFF - Relay off state.
  • RELAY_TIMEOUT - How long the relay should stay on before turning off.
  • DB_CONNECT_STRING - database connection string
  • DB_LOG_TABLE - table in the DB used to store door state changes
  • SMTP_SERVER - smtp server to use for emails
  • notify_from - who state change emails should come from (email address/name)
  • notify_to - who state change emails should be sent to

Parts

  • Raspberry Pi B v2 (or something more current)
  • 4-8 GB SDcard with Raspbian "jessie"
  • Edimax EW-7811Un (WiFi dongle, b/g/n)
  • SainSmart 2-Channel Relay
  • Seco-Larm SM-217Q
  • Cat 5 cable for wiring (It's what I had on hand)
  • Power supply for the Pi

Links

garage-control's People

Contributors

wvolz avatar

Watchers

 avatar  avatar  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.