Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/TeMPOraL/hju

Simple command line (CLI) controller for Hue lights, written in Common Lisp.
https://github.com/TeMPOraL/hju

cli command-line common-lisp hue-bridge hue-lights roswell script

Last synced: 2 months ago
JSON representation

Simple command line (CLI) controller for Hue lights, written in Common Lisp.

Lists

README

        

#+title: HJU - A simple command line Hue lights controller in Common Lisp.
#+startup: hidestars

Hju lets you control your Hue lights straight from the command line!

Supports all color gamut conversions (for RGB mode) specified by Hue documentation to date (as of 2016-12).

* Installation

Requirements:
- [[https://github.com/roswell/roswell][roswell]]
- [[https://www.quicklisp.org/beta/][quicklisp]]

You can run the script directly or, better, build an executable first with roswell.

#+BEGIN_SRC sh
ros build hju.ros
#+END_SRC

* Usage

Ensure you have an user registered on Hue bridge for this application (in the future, this process
will be done from this tool, but now it has to be done manually). Refer to [[https://www.developers.meethue.com/documentation/getting-started][Hue API documentation]]
for this process.

#+BEGIN_SRC sh
$ ./hju --help
hju - a simple command line controller for Hue lights
Version: 0.5

Usage:
hju [options...] [args]

Use "hju -h" or "hju --help" for complete list of options.

Options:
-h, --help Display this text.
-v, --verbose Make output verbose.
-b BRIDGE, --bridge=BRIDGE Use different bridge URL than the default.
-u USER, --user=USER Use different user ID than the default.
-t TRANSITION, --transition=TRANSITION Use specified transition time (in tenths of a second).

TRANSITION is given in seconds, can be fractional. Default value: 0.4.
Terminate options with -- if -h or -v is used last.

Defaults are taken from the config file .hju in your home directory.
The format of that file is:
(setf *bridge-url* "bridge URL" *user-id* "USER ID")

Commands:
status Display status of Hue bridge and all lights.
list Just list available lights and their status.
on LIGHTS Turn on LIGHTS.
off LIGHTS Turn off LIGHTS.
toggle LIGHTS Toggle LIGHTS.
reset LIGHTS Reset LIGHTS to the values I (the author) like.
blink LIGHTS Blink LIGHTS.
set LIGHTS rgb R G B Set color of LIGHTS to rgb(R, G, B) (each component in [0.0 ... 1.0]).
set LIGHTS rgb #RRGGBB Set color of LIGHTS to #RRGGBB (hex).
set LIGHTS rgb #RGB Set color of LIGHTS to #RRGGBB (hex).
set LIGHTS hue HUE Set hue of LIGHTS to HUE [0...65535].
set LIGHTS sat SAT Set saturation of LIGHTS to SAT [0...254].
set LIGHTS bri BRI Set brightness of LIGHTS to BRI [1...254].
set LIGHTS ct CT Set color temperature of LIGHTS to CT in Mired.
set LIGHTS ctk CTK Set color temperature of LIGHTS to CTK in Kelvins.
set LIGHTS xy X Y Set color of LIGHTS to coordinates (X, Y) in CIE color space.

LIGHTS can be given as a comma-separated list of numbers or prefixes of their names.
LIGHTS can also be given as "all", which will make the command affect all lights.

Examples:
hju on living,bathroom
hju off bat
hju set 1,3 rgb #11FF11
#+END_SRC

* Configuration
Hju searches for its configuration file in following places:
- =$HOME/.hju=
- =$HOME/.config/hju/.hju=

If a configuration file is present there, it will be loaded, making it no longer required to pass
bridge URL and user ID as command line arguments.

The template for config file is as follows:

#+BEGIN_SRC lisp
(setf *bridge-url* "IP address of your Hue bridge"
*user-id* "your user ID")
#+END_SRC

* To be done
See [[https://github.com/TeMPOraL/hju/issues][issues]] for a list of planned features and known problems.