Skip to content

p-conrad/klc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

KLC – Elgato Key Light Control Script

A simple, low-dependency Bash script for controlling Elgato Key Lights over the network using their HTTP API.

πŸ“‹ Description

klc is a CLI tool for discovering, querying, and controlling Elgato Key Lights using their native HTTP interface. It supports toggling the light, adjusting brightness, and setting the color temperature β€” all without requiring any heavy frameworks or package managers.

πŸ’‘ Why This Script?

Elgato Key Lights expose an unauthenticated HTTP API (see here), and many tools already exist to interact with them.

However:

  • One tool I tried offered a GUI but outright refused to work.
  • Another was written in Go and brought in a full framework just to send a few HTTP requests β€” the logic was completely obscured.
  • A Python tool required a pip install and came with a handful of dependencies.
  • A seemingly promising Bash project prioritized output formatters (JSON, XML, YAML, ...) over actually turning the light on.

So I wrote my own β€” just a clean Bash script with:

  • βœ… No dependencies beyond avahi-browse, curl, and jq
  • βœ… No installers, no GUIs, no package managers
  • βœ… Clear, readable logic

✨ Features

  • πŸ•΅οΈβ€β™‚οΈ Auto-discovers the first available Elgato Key Light on the network via avahi
  • 🧠 Caches the discovered IP for faster reuse on subsequent calls
  • πŸ’‘ Turns light on/off
  • πŸ”† Adjusts brightness (NUM, increase, decrease, min, max)
  • 🌑️ Adjusts temperature in either Mired or Kelvin units
  • ⚑ Accepts abbreviated commands (e.g. br, temp, inc, dec)

πŸš€ Usage

$ klc on
$ klc off
$ klc status
$ 
$ klc brightness 75         # brightness to 75%
$ klc brightness increase
$ klc brightness decrease
$ klc brightness min
$ klc brightness max
$ 
$ klc temperature 5000      # Kelvin input
$ klc temperature 200       # Mired input
$ klc temperature increase
$ klc temperature decrease
$ klc temperature min
$ klc temperature max

You can abbreviate most commands:

  • status: s, st
  • brightness: b, br, bright
  • temperature: t, te, temp
  • increase: i, inc
  • decrease: d, dec

⚠️ Caveats

  • 🧭 The script always uses the first discovered device via Avahi.
  • 🎚️ Temperature values can be entered as Kelvin or Mired. Conversion rounding is approximate but visually negligible.
  • βž• Only one command can be executed per call (e.g., you can't change brightness and temperature at once).

πŸ“¦ Requirements

  • bash
  • avahi-browse (for discovery)
  • curl (for HTTP requests)
  • jq (for parsing JSON)

All are commonly available on modern Linux distributions and macOS with Homebrew.

πŸ“ Installation

Just clone or copy the script. No build, no install, no hassle.

$ chmod +x klc
$ ./klc on

For better calling convenience, you may choose to append the script's location to your PATH or copy it into your executables directory:

$ PATH=$(readlink -f .):$PATH   # Option 1: temporary (for this shell session only)
$ cp klc ~/.local/bin           # Option 2: permanent (path may be different on your system)
$ sudo cp klc /usr/bin          # Option 3: permanent, system-wide (if you really want to)

πŸ› οΈ Contributions

Contributions are welcome.

πŸ“„ License

MIT β€” Do what you want, but don't blame me if your lights go disco mode. πŸ˜‰

About

A simple, low-dependency bash script for controlling Elgato Key Lights.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages