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-suncalc-2

v1.1.1

Published

Homebridge plugin for SunCalc

Readme

homebridge-suncalc-2

Suncalc plugin for Homebridge that publishes occupancy sensors aligning with Suncalc's time periods

| Suncalc Time Period | HomeKit Sensor Name | | ------------------- | --------------------------------------------------- | | nightEnd | Morning Twilight - Astronomical twilight starts | | nauticalDawn | Nautical Dawn - Nautical twilight starts | | dawn | Civil Dawn - Civil twilight starts | | sunrise | First Light - Sun starts appearing over the horizon | | sunriseEnd | Morning Golden Hour - Sun is up, golden hour starts | | goldenHourEnd | Daytime - Golden hour ends, full day starts | | solarNoon | Solar Noon - Sun is at its highest point in the sky | | goldenHour | Evening Golden Hour - Evening golden hour starts | | sunsetStart | Sunset - Sun starts setting | | sunset | Evening Twilight - Sun falls below the horizon | | dusk | Civil Dusk - Civil twilight ends | | nauticalDusk | Nautical Dusk - Nautical twilight ends | | night | Nightfall - Astronomical twilight ends | | nadir | Deepest Night - Darkest part of the night |

This is intended for use in triggering scenes using times like sunrise and sunset, or adjacent to those events like the start of golden hour.

Modes (new in v1.1.0)

Allows the user to select how many sensors are created in case 14 is too many. Modes include:

  • Full: all 14 Suncalc periods
  • Extended: sunrise, sunset, and both morning and evening golden hours
  • Basic: sunrise and sunset only

Offset (Sunrise/Sunset only)

Triggering from a time relative to sunset/sunrise can be useful for light triggers, if the other time periods are not suitable. This plugin allows you to specify an offset for the end of sunrise, and the beginning of sunset. For instance, if you want to trigger a scene to start 30 minutes before sunset, you can specify an sunsetStart offset of -30 in the config. This fires the trigger 30 minutes earlier than normal, allowing your lights to come on as it gets darker at your location.

Installation

  1. Install Homebridge using your preferred method (you've probably done this already)
  2. Install this plugin using by searching in the Homebridge UI or by running: npm install -g homebridge-suncalc-2
  3. Use a website like GPS Coordinates to get your location's coordinates.
  4. Save the configuration and restart Homebridge when prompted.

Configuration

{
    "instances": [
        {
            "name": "Long Beach",
            "mode": "full",
            "location": {
                "lat": 33.7527056,
                "lon": -118.1907613
            },
            "offset": {
                "sunriseEnd": 0,
                "sunsetStart": 0
            }
        }
    ],
    "platform": "Suncalc2Platform"
}

Fields:

  • instances is an array which contains one or more of the following: (required).
  • name is the name of the published accessory (required, unique).
  • mode is a value of full, extended, or basic (required).
  • location contains your location coordinates (required).
  • offset contains offset values in minutes of when that event should be fired for sunrise/sunset. (optional).
  • platform must be "Suncalc2Platform" (required).