Skip to content

andrimanna/homebridge-Gpio-Switch

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
}