Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hue

A command-line tool for controlling Philips Hue lights over your local Wi-Fi network.

Requirements

  • A Philips Hue bridge on your local network
  • Rust toolchain (to build from source)

Installation

cargo install --path .

Setup

Run once to connect to your bridge:

hue init

This will:

  1. Auto-discover the bridge on your network
  2. Prompt you to press the physical link button on the bridge
  3. Register the app and save credentials to ~/.config/hue-cli/config.json

If auto-discovery fails, provide the bridge IP manually:

hue init --bridge-ip 192.168.1.100

You only need to do this once. The credentials are stored permanently and reused for every subsequent command.

Commands

List rooms

hue groups

Shows all rooms configured in your Hue app. Use these names with the other commands.

Brightness

hue dim "living room" 80   # set to 80%
hue dim "living room" 0    # turn off
hue dim "living room" 100  # full brightness

Level is a percentage from 0 to 100. Setting 0 turns the lights off.

Color

hue rgb "living room" 255 128 0    # warm orange
hue rgb "living room" 0 0 255      # blue
hue rgb "living room" 255 255 255  # white

Values are standard RGB, 0–255 per channel. The tool converts to the CIE xy color space the Hue API requires.

Color temperature

hue warm "living room" 370   # warm white
hue warm "living room" 153   # cool daylight
hue warm "living room" 500   # candlelight

Sets the color temperature in mirek (153–500). Use this instead of rgb when you want white light — it drives the bulb's dedicated white LED element, which produces better results than an RGB approximation.

Feel Mirek
Daylight 153
Neutral white 250
Warm white 370
Candlelight 500

On / Off

hue on "living room"
hue off "living room"

Presets

Presets let you save a named lighting configuration and apply it with a single command.

Save a preset (creates or replaces):

hue preset save partymode --group "living room" --dim 60 --rgb 255,0,128

At least one of --dim, --rgb, or --mirek must be provided.

Add more rooms to an existing preset:

hue preset add partymode --group "kitchen" --dim 40 --rgb 200,0,100
hue preset add evening    --group "bedroom" --dim 30 --mirek 400

Apply a preset:

hue preset apply partymode

List all presets:

hue preset list

Inspect a preset:

hue preset show partymode

Delete a preset:

hue preset delete partymode

Notes

  • Room names are case-insensitive — "Living Room" and "living room" both work.
  • The tool uses the Hue API v2 over HTTPS. The bridge uses a self-signed certificate, which the tool accepts automatically.
  • Credentials are stored in plain text at ~/.config/hue-cli/config.json. Anyone on your Wi-Fi network can control your lights, and access to that file gives them a ready-made API key to do so.

About

Philips Hue CLI

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages