homebridge-contact-sensor

A Homebridge plugin for a contact sensor via GPIO of a Raspberry Pi.


Keywords
contact, sensor, raspberry, pi, siri, homebridge, homebridge-plugin, ios, homekit, gpio
License
ISC
Install
npm install homebridge-contact-sensor@0.0.2

Documentation

homebridge-contact-sensor

This Homebridge plugin enables you to control a contact sensor switch.

Setup

  1. Wire a contact senor to your Raspberry Pi.

  1. Install this plugin
npm i -g homebridge-contact-sensor
  1. Rename the sample-config.json to config.json and integrate your sensors in the accessories array. The pins of the Raspberry Pi require root rights to control them. Therefore you have to save your config file not in your users directory. Put it under /root/.homebridge/config.json and run homebridge as root. If you are already running homekit with other apps integrate the accessories into your config.json and move your config file to the path above.

Accessory JSON config looks like:

{
    "accessory": "ContactSensor",
    "name": "ContactSensor1",
    "pin": 2
}