Coder Social home page Coder Social logo

alarmpi's Introduction

Alarm Pi

A pi based program for monitoring contact inputs from a wired alarm system and sending those events to a home automation platform

Features

  • Watches for contact closure on a configured gpio pin
  • Register a callback type on open/close
  • Web ui to see status
  • Web api request to see status (GET /status)

Image of Home

Configuration

See config example. The config.json may be placed in /etc/alarmpi, .alarmpi in your $HOME directory, or in the current working directory

Extra settings

In extreme cases you may need to set the following, the default values are below

   "AppName": "alarmpi",
   "HttpActionTimeout": "15s",
   "Chip": "gpiochip0"

Other Integration

Hubitat

Expects a config entry like below, with the maker api pasted in and %s replacing the device id and the command

  "integrations": {
      "hubitat": "http://192.168.1.5/apps/api/8/devices/%s/%s?access_token=25345qwe469a73"
   }
}

Install

Copy binary to a suitable location, service file included for linux/raspi

Attaching Sensors to you pi

GPIO Confiugration

It's a good idea to add to your /boot/config.txt the following

gpio=0-53=ip,pd

This instructs the pi to set pins 0-53 as inputs and pull down. Alter as necessary for your install

Contact sensors (Doors/Windows)

Attach one leg of the sensor to 3.3v and the other to a GPIO PIN (Care should be taken here, if your pins are in some weird state and not reading input you can damage things)

Motion sensors

Using pir motion sensors that have 3 leges, connect in the following manner:

  • leg 1 v+ to 5v on the pi
  • leg 2 high/low to GPIO pin of choice
  • leg 3 gnd to gnd on pi

This is an example of a product that works

Run

To run execute on the command line, the default port is 8000, but can be changed in the configuration

./alarmpi

Pin Entries

Fill out a entry for each pin in the interface

Label

The label to be presented i.e Hallway, Front Door, etc.

Type

The type of event to trigger on, options are "http" for making a HTTP GET request or "exec" for executing a local program

Http

Http will execute the url provided in the "Open" and "Close fields"

Hubitat

Will execute a appropriate command on the maker api for the provided id in "Open" and "Closed" fields

Exec

Exec will execute a script named in "Open" or Closed and pass in the following arguments

  • Name: gpio16
  • State: open|closed
  • Label: Front Door

It will essentially execute as if you were running the following

./callback_script.sh gpio16 open "Front Door"

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.