Skip to content

keeb/keylight

Repository files navigation

@keeb/keylight

Control an Elgato Key Light from swamp workflows. The extension talks directly to the Key Light's built-in HTTP API (port 9123) — no Elgato Control Center software required. Turn the light on or off, toggle it, and dial in brightness and color temperature, all from a swamp model definition.

Installation

swamp extension pull @keeb/keylight

Configuration

Create a model that points at your Key Light's IP address:

swamp model create keylight @keeb/keylight \
  --arg host=10.0.0.245 \
  --arg port=9123

port defaults to 9123 and can be omitted.

Usage

# Sync current state and device info
swamp model method run keylight sync

# Power control
swamp model method run keylight on
swamp model method run keylight off
swamp model method run keylight toggle

# Set brightness (0–100) and/or color temperature
swamp model method run keylight set --arg brightness=60
swamp model method run keylight set --arg temperature=200
swamp model method run keylight set --arg brightness=80 --arg temperature=250 --arg on=true

Color temperature

Temperature is expressed in mired (micro reciprocal degrees), which is the unit the Elgato API uses natively:

Mired Kelvin Character
143 ~7000 K Cool / Daylight
200 ~5000 K Neutral White
250 ~4000 K Warm White
344 ~2900 K Warm / Tungsten

Lower mired = cooler (bluer) light. Higher mired = warmer (more orange) light.

Resources

After running sync, on, off, toggle, or set, the model stores:

  • state — current power state, brightness, and temperature, plus a updatedAt timestamp.
  • info — product name, firmware version, serial number, and display name (only written by sync).

Reference stored state in workflows with CEL:

data.latest("keylight", "state").attributes.on
data.latest("keylight", "state").attributes.brightness

Prerequisites

  • The Key Light must be reachable on the local network (UDP mDNS or static IP).
  • No authentication is required — the Key Light's REST API is unauthenticated.
  • Firmware 1.0.3 or later recommended (API shape is stable across all current firmware versions).

Discord voice watch

discord-voice-watch.ts is a standalone Deno script that polls PulseAudio every 2 seconds and turns the Key Light on when Discord opens a voice channel and off when it closes.

deno run --allow-run discord-voice-watch.ts

Requires pactl (PulseAudio) and swamp on $PATH. The script controls the keylight-cozy model — edit the swamp() call to target a different model.

License

MIT — see LICENSE.txt for details.

About

Swamp extension for controlling an Elgato Key Light

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors