1.0.0 • Published 7 months ago

@heher/sunset-lights v1.0.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
7 months ago

SunsetLights

Program to run every minute that will set all currently on Hue lights to slowly dim to an orange-ish color as the sun sets.

Installation

  1. Create an .env file inside the SunsetLights folder with your latitude and longitude.
SUNSET_LAT=<your latitude>
SUNSET_LONG=<your longitude>
  1. Install node modules:
npm i

Usage

# inside the SunsetLights folder
$ node runLights.js

The first time you do this, the API needs to create a new user on your Hue hub.

You may see this error:

The Link button on the bridge was not pressed. Please press the Link button and try again.

In that case, you should press the huge button on the top of the hub and try again.

Once this runs the first time, it will create a new user on your hub and then store that username and the bridge's IP address as new keys in your .env file. As long as you keep that username, the program will just use that instead of creating a new one every time.

Crontab

To get this to run every minute, set crontab:

crontab -e

NOTE: Replace <absolute_path_to_index.js_file> with the, like, actual path.

* * * * * node <absolute_path_to_index.js_file>