This is really just an excuse for me to learn Go in my off time. I would not depend on this library for anything serious. Proceed with caution. I have not run this on Windows or Linux.
This project uses GOMODULES. No need to clone to your GOPATH.
- Make sure your
GOBIN
is correctly setup. - Follow https://developers.meethue.com/develop/get-started-2/ and get your UserId and the bridge IP.
export HUE_CLI=http://<BRIDGE IP>/api/<YOUR IP>/
in your shell config.$ go build -o hue
$ go install hue.go
$ hue
Shows you available rooms set up on your bridge. Pretend you have a kitchen and office:
$ hue
usage: hue [<flags>] <command> [<args> ...]
Phillips Hue CLI
Flags:
--help Show context-sensitive help (also try --help-long and --help-man).
Commands:
help [<command>...]
Show help.
lights
Get light info
office off
Turn office lights on
office on
Turn office lights off
kitchen off
Turn kitchen lights on
kitchen on
Turn kitchen lights off
Run hue lights
to get the JSON for all of your lights.
Run hue office on
to turn your office lights on.
Run hue kitchen off
to turn your kitchen lights off.
Individual light control, scene control, dunno what else.