Golang Hue SDK & Command Line Interface
A successful command will give you no feedback. If you want one, you can use -v
argument.
After each command, the exit code can be found in the $?
variable. No error if exit code equals 0.
- Get latest release of ghue CLI on https://github.com/yesnault/ghue/releases
- Get IP of your bridge. See http://www.developers.meethue.com/documentation/getting-started to check how to discover your bridge's IP.
- Press button on your bridge
- If your IP is
192.168.0.17
, execute./ghue config create --ip 192.168.0.17 --save
- Get All your lights, execute
./ghue lights all
- Switch Off a light :
./ghue lights state 1 --on=false
- Switch On a light :
./ghue lights state 1 --on=true
- Switch On a light and set brightness to minimum :
./ghue lights state 1 --on=true --bri=1
- View all other lights parameters :
./ghue lights state -h
Usage:
ghue [command]
Available Commands:
config Config commands: ghue config --help
lights Lights commands: ghue lights --help
groups Groups commands: ghue groups --help
schedules Schedules commands: ghue schedules --help
sensors Sensors commands: ghue sensors --help
scenes Scenes commands: ghue scenes --help
info Info commands: ghue info --help
rules Rules commands: ghue rules --help
update Update ghue to the latest release version: ghue update
version Display Version of ghue: ghue version
Flags:
-c, --configFile string configuration file, default is /Users/yvonnickesnault/.ghue/config.json (default "/Users/yvonnickesnault/.ghue/config.json")
-f, --format string choose format output. One of 'json', 'yaml' and 'pretty' (default "pretty")
-h, --help help for ghue
-v, --verbose verbose output
- Lights
- Get all lights
- Get new lights
- Search for new lights
- Get lights attributes and state
- Set lights attributes (rename)
- Set light state
- Delete Light
- Groups
- Get all groups
- Create group
- Get group attributes
- Set group attributes
- Set group state
- Delete group
- Schedules
- Get all schedules
- Create schedule
- Get schedule attributes
- Set schedule attributes
- Delete schedule
- Scenes
- Get all scenes
- Create scene
- Modify scene
- Recall scene
- Delete scene
- Get scene
- Sensors
- Get all sensors
- Create sensor
- Find new sensors
- Get new sensors
- Get sensor
- Update sensor
- Delete sensor
- Change sensor config
- Rules
- Get all rules
- Get rule
- Create rule
- Update rule
- Delete rule
- Configuration
- Create user
- Get configuration
- Modify configuration
- Delete user from whitelist
- Get full state (datastore)
- Info
- Get all timezones
mkdir -p $(go env GOPATH)/src/github.com/yesnault
cd $(go env GOPATH)/src/github.com/yesnault
git clone [email protected]:yesnault/ghue.git
cd $(go env GOPATH)/src/github.com/yesnault/ghue/cli
go build && ./cli -h