npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@aibui/homebridge-gpio-garagedoor

v1.0.2

Published

Raspberry Pi GPIO based Garage Door plugin for Homebridge

Downloads

331

Readme

homebridge-gpio-garagedoor

npm version Downloads

Raspberry Pi GPIO based Garage Door plugin for Homebridge

This plugin allows you to control and monitor your garage door using Raspberry Pi GPIO pins through HomeKit.

Features

  • Door Control: Open/close garage door via HomeKit
  • Door Status: Real-time monitoring of door position (open/closed)
  • Safety: Prevents operation while door is moving
  • Configurable: Support for both Normally Open (NO) and Normally Closed (NC) sensors
  • Modern: Built for Homebridge v1.6+ with full TypeScript support

Requirements

  • Homebridge v1.6.0 or higher
  • Node.js v18.15.0 or higher
  • Raspberry Pi with GPIO access
  • Garage door relay connected to GPIO pin
  • Door position sensor (optional but recommended)

Installation

Option 1: Homebridge Config UI X (Recommended)

  1. Search for homebridge-gpio-garagedoor in the Homebridge Config UI X plugin store
  2. Install the plugin
  3. Configure using the graphical interface

Option 2: Command Line

npm install -g homebridge-gpio-garagedoor

Configuration

Basic Configuration

{
  "accessories": [
    {
      "accessory": "GPIOGarageDoor",
      "name": "Garage Door",
      "doorSwitchPin": 23,
      "doorSensorPin": 24,
      "isNCSensor": false,
      "doorOpensInSeconds": 15
    }
  ]
}

Configuration Options

| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | accessory | string | ✅ | - | Must be "GPIOGarageDoor" | | name | string | ✅ | - | Display name for the garage door | | doorSwitchPin | number | - | - | GPIO pin connected to garage door relay | | doorSensorPin | number | - | - | GPIO pin connected to door position sensor | | isNCSensor | boolean | - | false | Set to true if using Normally Closed sensor | | doorOpensInSeconds | number | - | 15 | Time for door to fully open/close | | id | string | - | auto-generated | Unique identifier for the accessory |

Hardware Setup

Door Switch (Relay)

  • Connect relay control pin to specified doorSwitchPin
  • Relay should momentarily activate garage door opener (like a button press)
  • Typical activation time: 1 second

Door Sensor (Optional but Recommended)

  • Magnetic Reed Switch: Mount magnet on door, sensor on frame
  • Limit Switch: Mechanical switch activated when door is closed
  • Normally Open (NO): Circuit closed when door is closed (default)
  • Normally Closed (NC): Circuit open when door is closed (set isNCSensor: true)

Wiring Diagram

Raspberry Pi                  Garage Door System
                             
GPIO Pin (Switch) ──→ Relay ──→ Door Opener Terminals
                             
GPIO Pin (Sensor) ──→ Door Position Sensor
Ground           ──→ Common Ground

Troubleshooting

Common Issues

  1. Permission Denied: Run Homebridge with proper GPIO permissions

    sudo usermod -a -G gpio homebridge
  2. GPIO Already in Use: Check if other processes are using the GPIO pins

    lsof /dev/gpiomem
  3. Door State Incorrect: Check sensor wiring and isNCSensor setting

Debug Mode

Enable debug logging by setting the Homebridge debug mode:

DEBUG=* homebridge

Hardware Compatibility

  • Raspberry Pi: All models with 40-pin GPIO header
  • GPIO Library: Uses onoff library for GPIO control
  • Door Operators: Compatible with most garage door openers that accept dry contact closure

Version History

  • v1.0.0: Modern Homebridge v1.6+ support, TypeScript rewrite, improved error handling
  • v0.2.2: Legacy version (Homebridge v0.2.5+)

Contributing

Issues and pull requests are welcome on GitHub.

License

ISC License - see LICENSE file for details.