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

gardenlight-accfactory

v0.0.3

Published

Standalone HomeKit garden light zones using Raspberry Pi hardware PWM

Downloads

75

Readme

HomeKit Garden Light System

version

Parts

  • Raspberry Pi supported by rpio
  • MOSFET interfaces for PWM light control
  • Dimmable garden lights

Use Node.js 22, 24 or 26. Hardware PWM requires access to /dev/mem, normally through root permissions. GPIO pins use BCM numbering.

Garden Light Configuration

The following options are available in the gardenLight object in gardenlight_config.json. One HomeKit accessory contains the configured light zones.

For example:

{
  "gardenLight": {
    "name": "Garden Light System",
    "manufacturer": "n0rt0nthec4t",
    "model": "HomeKit Garden Light System",
    "zones": [
      {
        "name": "Path Lights",
        "pin": 12,
        "enabled": true
      },
      {
        "name": "Garden Lights",
        "pin": 13,
        "enabled": true
      }
    ]
  }
}

| Name | Description | Default | |--------------|-------------------------------------------------------|-----------------------------| | hkUsername | Automatically generated HomeKit username | Generated on first startup | | manufacturer | Manufacturer of the garden light system | n0rt0nthec4t | | model | Model of the garden light system | HomeKit Garden Light System | | name | Name of the HomeKit accessory | Garden Light System | | serialNumber | Serial number of the garden light system | Generated on first startup | | zones | Array of configured light zones | Required |

The following options are available in each gardenLight.zones entry.

| Name | Description | Default | |---------|----------------------------------------------|-------------------| | enabled | Enable this zone in HomeKit and GPIO setup | true | | name | Name of the light zone | Light 1, Light 2… | | pin | BCM hardware PWM pin: 12, 13, 18 or 19 | Required |

GPIO 12 and 18 share PWM channel 0; GPIO 13 and 19 share channel 1. Enable at most one zone per channel, for up to two independent light zones. Disabled zones retain their configuration without creating HomeKit services or opening GPIO. Configuration validation or save failures stop startup with an error. Generated HomeKit identities are saved atomically before the accessory is published.

The Garden Lights page provides zone Add/Remove controls, names, PWM pin choices and Enabled checkboxes. Add selects a free PWM channel, and pin choices exclude channels assigned to other zone cards. With both channels assigned, remove a zone before adding another. Accessory identity and manufacturer settings remain in the JSON configuration. With no enabled zones, the Web UI remains available when its port is configured, and no accessory is published.

Web UI saves and restores replace the configuration file; startup validates it after restart. Saved changes take effect after restart. All zones start off with brightness at 100%. Brightness changes while a zone is off keep its output off. Outputs are switched off and closed on shutdown.

Configuration Options

The following options are available in the options object in gardenlight_config.json.

| Name | Description | Default | |------------------|---------------------------------------------------------|------------| | debug | Detailed debugging | false | | eveHistory | Provide power transition history in EveHome | true | | hkPairingCode | HomeKit pairing code: "xxx-xx-xxx" or "xxxx-xxxx" | 031-45-154 | | webUIPort | Web UI port; 0 disables the Web UI | 0 | | webUIBearerToken | Web UI password; an empty value disables authentication | Empty |

When an options object is present, set eveHistory explicitly to true to enable history. Each zone retains its own power history; Eve displays the first enabled zone's stream.

Web ports must be integers from 0 to 65535. Invalid port values disable the Web UI. For example, webUIPort: 8581 enables the UI at http://<pi-address>:8581. The UI provides configuration, pairing, logs, backup and restore. Its restart action exits with status 1 so a process manager configured to restart on failure can relaunch the application.