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.
swamp extension pull @keeb/keylightCreate 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=9123port defaults to 9123 and can be omitted.
# 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=trueTemperature 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.
After running sync, on, off, toggle, or set, the model stores:
state— current power state, brightness, and temperature, plus aupdatedAttimestamp.info— product name, firmware version, serial number, and display name (only written bysync).
Reference stored state in workflows with CEL:
data.latest("keylight", "state").attributes.on
data.latest("keylight", "state").attributes.brightness
- 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.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.tsRequires pactl (PulseAudio) and swamp on $PATH. The script controls the
keylight-cozy model — edit the swamp() call to target a different model.
MIT — see LICENSE.txt for details.