npm.io
0.0.12 • Published 7 years ago

homebridge-teleruptor

Licence
MIT
Version
0.0.12
Deps
2
Size
7 kB
Vulns
1
Weekly
0

Homebridge Teleruptor

Controls channel relays with a Raspberry Pi using HomeKit and creates behaviour of a push button to control lights.

Hardware

The hardware used.

  1. Raspberry Pi 3 Model B+
  2. Multi channel relay board connected to GPIO pins
  3. opto-couplers used to detect on/off state of lights

The raspberry pi can then control the state of the lights. Normal push buttons are still usable.

Installation

  1. Install homebridge using: sudo npm install --unsafe-perm -g homebridge
  2. Install this plugin using: sudo npm install -g --unsafe-perm homebridge-teleruptot
  3. Update your configuration file. See config-sample.json in this repository for a sample.

Sample Configuration

{ "bridge": { "name": "TeleruptorServer", "username": "CC3DCE:FD", "port": 51826, "pin": "031-45-158" },

"description": "Teleruptor",

"accessories": [ { "accessory": "Teleruptor", "name": "Teleruptor-1", "pin": 7, "inputpin": 12, "invert": false, "default_state": false, "duration_ms": 100 }, { "accessory": "Teleruptor", "name": "Teleruptor-2", "pin": 11, "inputpin": 14, "invert": false, "default_state": false, "duration_ms": 100 } ],

"platforms": [] }

Accessory Configuration Options

Name Meaning
accessory Accessory type. Teleruptor (REQUIRED)
name Default name for the accessory. (REQUIRED)
pin Which pin number to use for this accessory. (REQUIRED)
inputpin Which pin number to use for reading status of the light. (REQUIRED)
invert If true, output on pin is LOW for ON, and HIGH for OFF. (Default: false)
default_state State to set on start of homebridge. true for ON, false for OFF. (Default: false/OFF)
duration_ms Length of the Pulse that is given in milliseconds (Default: 20)

Keywords