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 🙏

© 2024 – Pkg Stats / Ryan Hefner

homebridge-hue-daylight-sync

v1.4.0

Published

A Homebridge plugin for syncing Hue lights with daylight

Downloads

1,102

Readme

Hue Daylight Sync

npm version npm downloads GitHub Issues GitHub pull requests

Hue Daylight Sync: Automated Philips Hue Light Adjustment for Natural Daylight Cycles

Hue Daylight Sync is a Homebridge plugin that automatically adjusts your Philips Hue lights based on the natural daylight cycle. It calculates the ideal color temperature throughout the day based on your geographical location and smoothly transitions your lights to match.

Demo

Features

  • Natural Bell Curve Color Temperature Transitions
  • Smooth, Gradual Changes: The plugin now uses a cosine function to create a smooth, bell-shaped curve for color temperature transitions throughout the day.
  • Enhanced Natural Lighting: Mimics the natural progression of daylight, providing a more comfortable and realistic lighting environment.
  • Automatic color temperature adjustment based on time of day
  • Customizable warm and cool temperature ranges
  • Geolocation-based calculations for accurate sunlight mimicking
  • Manual override option with automatic mode switch

Auto Mode and Manual Adjustments

  • Auto Mode: Automatically adjusts your lights' color temperature based on the time of day. Enabled by default.
  • Manual Adjustments: Changing the brightness slider or color temperature in the Home app will disable Auto Mode, allowing you to set your preferred lighting.
  • Re-Enabling Auto Mode: To resume automatic adjustments, simply toggle the "Auto Mode" switch back on in the Home app.

Prerequisites

  • Homebridge installed on your system
  • Philips Hue Bridge with API access - Hue Guide
  • Philips Hue color temperature capable lights

Installation

  1. Install the plugin through Homebridge UI or manually:
npm install -g homebridge-hue-daylight-sync
  1. Configure the plugin in your Homebridge config.json or through the Homebridge UI.

Configuration

Add the following to your Homebridge config.json file:

{
  "platforms": [
    {
      "platform": "HueDaylightSync",
      "name": "Hue Daylight Sync",
      "bridgeIp": "YOUR_HUE_BRIDGE_IP",
      "apiToken": "YOUR_HUE_API_TOKEN",
      "latitude": 51.5072,  // Replace with your latitude
      "longitude": 0.1276,  // Replace with your longitude
      "warmTemp": 2700,
      "coolTemp": 3000,
      "curveExponent": 3,
      "updateInterval": 300000,
      "inputDebounceDelay": 750,
      "defaultAutoMode" : true
    }
  ]
}

Configuration Options

| Option | Type | Description | Default | |--------|------|-------------|---------| | bridgeIp | string | The IP address of your Hue Bridge | Required | | apiToken | string | Your Hue API token | Required | | latitude | number | Your geographical decimal degrees latitude. Example: 51.5072 for London, but use your location's coordinates | Required | | longitude | number | Your geographical decimal degrees longitude. Example: 0.1276 for London, but use your location's coordinates | Required | | warmTemp | number | Warmest color temperature in Kelvin | 2700 | | coolTemp | number | Coolest color temperature in Kelvin | 3000 | | curveExponent | number | Adjusts the steepness of the transition curve | 3 | | updateInterval | number | Interval in milliseconds between temperature updates | 300000 (5 minutes) | | inputDebounceDelay | number | Delay in milliseconds to prevent rapid successive updates | 750 | | defaultAutoMode | boolean | Enable Auto Mode by default | true |

Note: For latitude and longitude, you must enter the coordinates for your specific location. The values shown in the example are for London, UK - make sure to replace these with your own coordinates.

You can find your coordinates using online services like Google Maps or websites like https://www.latlong.net/

Usage

Once installed and configured, the plugin will appear in your Home app as a light accessory with an additional switch for the Auto Mode.

  • Toggle the main switch to turn the Daylight Sync on or off.
  • Use the brightness slider to manually adjust the color temperature.
  • Toggle the Auto Mode switch to enable or disable automatic temperature adjustments.

When Auto Mode is enabled, the plugin will automatically adjust your Hue lights' color temperature throughout the day to match natural daylight patterns.

Troubleshooting

If you encounter any issues:

  1. Check your Homebridge logs for any error messages.
  2. Ensure your Hue Bridge IP and API token are correct.
  3. Verify that your latitude and longitude are set correctly.
  4. Make sure your Hue lights support color temperature adjustments.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License.

Acknowledgements