Code Monkey home page Code Monkey logo

rpioalert's Introduction

RPIO Alert

Turning Raspberry PI GPIO off and on base on temper device value

Installation

python3 setup.py install

Usage

Run manually

usage: __main__.py [-h] [-rpc] [-v] [-stop] [-off_first]
                   [--lcd {sainsmart_charlcd_led,adafruit_charlcd_rgb,adafruit_charlcd_mono}]
                   [--pin PIN] [--off OFF] [--on ON] [--rpc_listen RPC_LISTEN]
                   [--rpc_port RPC_PORT]

optional arguments:
  -h, --help            show this help message and exit
  -rpc                  Start rpc server
  -v, --verbose         Log verbosity
  -stop                 Cleanup on stop service
  -off_first            Check OFF condition first, then ON condition
  --lcd {sainsmart_charlcd_led,adafruit_charlcd_rgb,adafruit_charlcd_mono}
                        Use I2C LCD 16x2 to show status
  --pin PIN             GPIO Pin
  --off OFF             Pin Off condition, format: <temp|hum>:<eq|lt|lte|gt|gt
                        e>:<value>:[or|and|xor|nand|nor|xnor]
  --on ON               Pin On condition, format: <temp|hum>:<eq|lt|lte|gt|gte
                        >:<value>:[or|and|xor|nand|nor|xnor]
  --rpc_listen RPC_LISTEN
                        Listen address, default all 0.0.0.0
  --rpc_port RPC_PORT   Listen port, default 15555

--pin can be specified multiple time, useful for giving signal when condition reach and show current state e.g using RGB LED

--on or --off condition can be specified multiple time, default logic AND will be use between condition if empty

Condition will be check by priority, default is ON condition then OFF condition. If first condition is reach, the second one will be skip until next iteration. Use -off_first to check OFF condition first.

If multiple temper device installed, average value from those device will be use for comparison

--lcd is optional to show temper status in the installed lcd, currently only support adafruit and sainsmart

Systemd

Copy rpioalert.service to /etc/systemd/system/rpioalert.service Change the user inside this file to the user in temper group, and enable systemd

sudo systemctl enable rpioalert.service
sudo systemctl daemon-reload
sudo systemctl start rpioalert.service

rpioalert's People

Contributors

wiryonolau avatar

Watchers

James Cloos 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.