Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

homebridge-contactsensor

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

homebridge-contactsensor

Contact sensor interrupt GPIO input plugin for Homebridge

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

homebridge-contactsensor

Contact sensor GPIO input plugin for Homebridge

Installation

  1. Install Homebridge using npm install -g homebridge
  2. Install this plugin npm install -g homebridge-contactsensor
  3. Install the RPi.GPIO library and Python (sorry) (included in e.g. Raspbian by default)
  4. Update your configuration file - see below for an example

Wiring diagram

Example of connecting three contact sensors to GPIO:

Three normally-closed contact sensors

Currently the inputs are assumed to be normally-closed to ground, floating when pressed (internal pull-up resistor enabled). That is, the contact sensor will "closed" when 0, and "open" (as in, the door or whatever is open, not necessarily the electronics) when 1. TODO: configurable active-low/high

Configuration

  • accessory: "ContactSensor"
  • name: descriptive name
  • pins: object of names to GPIO physical pins

Example configuration:

    "accessories": [
        {
            "accessory": "ContactSensor",
            "name": "Contact Sensors",
            "pins": {
                "Switch A": 24,
                "Switch B": 26,
                "Switch C": 22
            }
        }
    ]

Creates a ContactSensor service for each pin.

What use are contact sensors? You can control other devices when they are opened or closed. For example, you could automatically turn on a light when you open your door.

See also

License

MIT

Keywords

FAQs

Package last updated on 11 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc