andrimanna / homebridge-Gpio-Switch

Read a switch and expose it in HomeBridge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

homebridge-gpio-switch

This Homebridge plugin enables you to read the state of a switch connected to the gpio and expose it in HomeBridge as StatelessProgrammableSwitch. It support single, double and long press.

Setup

  1. Wire whatever kind of switch (pushbutton is better) you prefer to your Raspberry Pi with a pullup resistor.

  1. Install this plugin
cd /usr/local/lib/node_modules
git clone https://github.com/andrimanna/homebridge-Gpio-Switch
npm install -g --unsafe-perm rpi-gpio
  1. Edit your /root/.homebridge/config.json and integrate your switch in the accessories array. The pins of the Raspberry Pi require root rights to control them. Accessory JSON config looks like:
{
    "accessory": "SPSwitch",
    "name": "Pulsante",
    "pin": 3
}

About

Read a switch and expose it in HomeBridge

License:GNU General Public License v3.0


Languages

Language:JavaScript 100.0%