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 🙏

© 2026 – Pkg Stats / Ryan Hefner

homebridge-garage-piface

v3.1.0

Published

Homebridge platform plugin for garage door and gate control using Raspberry Pi with PiFace Digital board

Readme

Garage door and gate opener platform plugin for Homebridge on Raspberry Pi with a PiFace Digital board.

Suitable for any device — garage door, gate motor — that requires a brief relay contact to trigger open/close. Supports open/closed magnetic sensors for real-time state monitoring. Multiple doors/gates can be configured in a single platform entry.


Prerequisites

These steps must be completed before installing the plugin.

1. Enable SPI

sudo raspi-config
# Interface Options → SPI → Yes
sudo reboot

2. Install build tools

sudo apt-get install -y git build-essential

3. Compile and install PiFace libraries

# libmcp23s17
git clone --depth=1 https://github.com/piface/libmcp23s17.git /tmp/libmcp23s17
cd /tmp/libmcp23s17 && make && sudo make install

# libpifacedigital
git clone --depth=1 https://github.com/piface/libpifacedigital.git /tmp/libpifacedigital
cd /tmp/libpifacedigital && make && sudo make install

sudo ldconfig

Installation

Install via the Homebridge UI (recommended) or from the terminal:

sudo hb-service add homebridge-garage-piface

Note: If the PiFace libraries were installed after the plugin, rebuild the native module:

cd /var/lib/homebridge/node_modules/homebridge-garage-piface
sudo env PATH="/opt/homebridge/bin:$PATH" /opt/homebridge/bin/npm rebuild node-pifacedigital
sudo hb-service restart

Migration from v2.x

Version 3.x converts the plugin from accessory to platform type. The postinstall script migrates your existing config automatically when you update via the Homebridge UI.

After the update, a full service restart is required — either from the Homebridge UI (menu → Restart Service) or from the terminal:

sudo hb-service restart

Note: The "Restart Homebridge" button only restarts the bridge process. Use Restart Service to also restart Config UI X and clear the plugin type cache.


Configuration

Configure via the Homebridge UI plugin settings, or edit config.json directly.

"platforms": [
  {
    "platform": "GaragePiFace",
    "name": "Garage PiFace",
    "accessories": [
      {
        "name": "Garage",
        "switchOutput": 0,
        "switchValue": 1,
        "switchPressTimeInMs": 1000,
        "closedSensorInput": 0,
        "closedSensorValue": 1,
        "openSensorInput": 1,
        "openSensorValue": 1,
        "pollInMs": 4000,
        "opensInSeconds": 15
      },
      {
        "name": "Gate",
        "switchOutput": 1,
        "switchValue": 1,
        "switchPressTimeInMs": 500,
        "opensInSeconds": 20
      }
    ]
  }
]

Parameters

| Parameter | Required | Default | Description | | --- | --- | --- | --- | | name | yes | — | Display name in HomeKit | | switchOutput | yes | — | PiFace output relay index (0–7) | | switchValue | | 1 | Relay active value: 1 = ACTIVE_HIGH, 0 = ACTIVE_LOW | | switchPressTimeInMs | | 1000 | Duration the relay stays active (ms) | | closedSensorInput | | — | PiFace input pin for closed position sensor (0–7) | | closedSensorValue | | 1 | Input value when door is closed | | openSensorInput | | — | PiFace input pin for open position sensor (0–7) | | openSensorValue | | 1 | Input value when door is open | | pollInMs | | 4000 | Sensor polling interval (ms) | | opensInSeconds | | 10 | Time for the door to fully open or close (s) |

If neither sensor input is configured, the plugin relies on last known state.


Hardware wiring

Wiring diagram

The PiFace Digital board provides 8 open-collector outputs (relays 0–1 are physical relays) and 8 inputs with pull-up resistors.

  • Connect the relay output to the door/gate motor trigger terminals.
  • Connect magnetic sensors to the input pins. Set closedSensorValue / openSensorValue to 1 for normally-open contacts, 0 for normally-closed.

Credits

Based on homebridge-garage-gate-opener by MForge.org.