凯尔文 - 色调机器人
Kelvin is a little helper bot who will automate the lights in your house. Its job is to adjust the color temperature and brightness in your home based on your local sunrise and sunset times and custom intervals defined by you. Think of it as f.lux or Apple's Night Shift for your home.
Imagine your lights shine in an energetic but not too bright blue color to get you started in the early morning. On sunrise your lights will change to a more natural color temperature to reflect the sunlight outside. On sunset they will slowly fade to a warmer and softer color scheme perfectly suited to Netflix and chill. When it's time to go to bed Kelvin will reduce the intensity even more to get you into a sleepy mood. It will keep this reduced setting through the night so you don't get blinded by bright lights if you have to get up at night...
If you want to give Kelvin a try, there are some things you will need to benefit from its services:
Got all these? Great, let's get started!
kelvin.exe on Windows or by typing ./kelvin in your terminal on macOS, Linux and other Unix-based systems.
You should see an output similar to the following snippet:2017/03/22 10:45:41 Kelvin v1.1.0 starting up...
2017/03/22 10:45:41 Looking for updates...
2017/03/22 10:45:41 ⚙ Default configuration generated
2017/03/22 10:45:41 ⌘ No bridge configuration found. Starting local discovery...
2017/03/22 10:45:44 ⌘ Found bridge. Starting user registration.
PLEASE PUSH THE BLUE BUTTON ON YOUR HUE BRIDGE...…As an alternative to manual installation you can also pull the official docker image from docker hub.
docker pull stefanwichmann/kelvindocker run -d -e TZ=Europe/Berlin -p 8080:8080 stefanwichmann/kelvin (replace Europe/Berlin with your local timezone)docker ps should now report your running containerdocker logs {CONTAINER_ID} to see the kelvin output (You can get the valid ID from docker ps)http://{DOCKER_HOST_IP}:8080/. The interface asks for a password (any username). Kelvin generates it on first start; find it in the startup log (docker logs {CONTAINER_ID}) or in the password field of config.json./etc/opt/kelvin/ to your host filesystem. If you alter the configuration you have to restart Kelvin through the web interface or by running docker restart {CONTAINER_ID}.Kelvin will create it's configuration file config.json in the current directory and store all necessary information to operate in it. By default it is fully usable and looks like this:
…As the configuration file is a simple text file in JSON format you can display and edit it with you favorite text editor. Just make sure you keep the JSON structure valid. If something goes wrong fix it using JSONLint or just delete the config.json and let Kelvin generate a configuration from scratch.
The configuration contains the following fields:
| Name | Description |
|---|---|
| bridge | This element contains the IP and username of your Philips Hue bridge. Both values are usually obtained automatically. If the lookup fails you can fill in this details by hand. Learn more |
| location | This element contains the latitude and longitude of your location on earth. Both values are determined by your public IP. If this fails, is inaccurate or you want to change it manually just fill in your own coordinates. |
| schedules | This element contains an array of all your configured schedules. See below for a detailed description of a schedule configuration. |
Each schedule must be configured in the following format:
| Name | Description |
|---|---|
| name | The name of this schedule. This is only used for better readability. |
| associatedDeviceIDs | A list of all devices/lights that should be managed according to this schedule. Kelvin will print an overview of all your devices on startup. You should use this to associate your lights with the right schedule. ATTENTION: Every light should be associated to only one schedule. If you skip an ID this device will be ignored. |
| enableWhenLightsAppear | If this element is set to true Kelvin will be activated automatically whenever you switch an associated light on. If set to false Kelvin won't take over until you enable a Kelvin Scene or activate it via web interface. |
| defaultColorTemperature | This default color temperature will be used between sunrise and sunset. Valid values are between 1000K and 6500K. See Wikipedia for reference values. If you set this value to -1 Kelvin will ignore the color temperature and you can change it manually. ATTENTION: The supported color temperature minimum will vary between bulb models. Kelvin will respect these limits automatically. |
| defaultBrightness | This default brightness value will be used between sunrise and sunset. Valid values are between 0% and 100%. If you set this value to -1 Kelvin will ignore the brightness and you can change it manually. |
| beforeSunrise | This element contains a list of timestamps and their configuration you want to set between midnight and sunrise of any given day. The time value must follow the hh:mm format. colorTemperature and brightness must follow the same rules as the default values. |
| afterSunset | This element contains a list of timestamps and their configuration you want to set between sunset and midnight of any given day. The time value must follow the hh:mm format. colorTemperature and brightness must follow the same rules as the default values. |
After altering the configuration you have to restart Kelvin. Just kill the running instance (Ctrl+C or kill $PID) or send a HUP signal (kill -s HUP $PID) to the process to restart (unix only).
Kelvin has the ability to detect certain light scenes you have programmed in your hue system. If you activate one of these Kelvin scenes it will take control of the light and manage it for you. You can use this feature to reactivate Kelvin after manually changing the light state or to associate Kelvin with a certain button on your Hue Tap for example.
In order to use this feature you have to create a scene in your Hue System via a Hue app. The name of this new scene has to contain the word kelvin and the name of the schedule you want to control. Once you saved this scene Kelvin will associate all relevant lights to it and update the state every minute to fit your schedule. Now you can simple activate this scene whenever you want to active Kelvin.
Let's look at an example:
livingroom which should be activated only on the second tap of your Hue Tap.Activate Kelvin in Livingroom or Livingroom (Kelvin). The exact name doesn't matter as long as the words kelvin and the name of the schedule are part of this scene name.enableWhenLightsAppear to false in the schedule livingroom.livingroom if you activate the scene on the second tap.A Raspberry Pi is the perfect device to run Kelvin on. It's cheap, it's small and it consumes very little energy. Any model of the Raspberry Pi will be sufficient, but we don't provide binary releases for revision 1 and the first generation Raspberry Pi Zero anymore. To set up Kelvin on a Raspberry Pi follow the installation guide here. Once your Raspberry Pi is up and running (booting, connected to your network and the internet) download the latest linux_armv7 release and follow the steps in Installation.
Running Kelvin as a systemd process provides an easily managed background process.
There are a couple assumptions made:
/home/pi/kelvin/kelvinpi user, and have sudo user permissions…If you are using Kelvin on a different system with Systemd you have to adjust the kelvin.service file according to your needs.
If anything goes wrong keep calm and follow these steps:
Make sure the Philips Hue bridge is configured and working in your network. Kelvin will need it to communicate with your lights. If you got the Hue app running on your smartphone you should be fine. Otherwise follow the Philips Hue manual to configure your lights.
To identify the IP address of your bridge open this link in your browser. After you got the IP address enter http:///debug/clip.html into your browser. You should see the debug page of you hue bridge. If this fails please follow the Philips Hue manual to configure your bridge.
Make sure the Philips Hue bridge is reachable from the computer Kelvin will run on. Enter the command ping in a terminal window or on a remote console. You should see packages reaching the destination IP address. If this fails you might have a network issue.
Make sure you downloaded the latest release for your operating system and CPU architecture. If you are not sure stick to the most appropriate amd64 release or arm if you are using a Raspberry Pi.
暂无开放 Issues,或尚未同步最近议题。