Skip to content

HFreni/lifx-dmx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lifx-dmx

A small bridge that listens for sACN (E1.31) on the local network and drives LIFX and Philips Hue bulbs over LAN, so you can control smart lights from any lighting console that speaks sACN (qLab, ETC Eos, MagicQ, Onyx, Hog, grandMA, Chamsys, Resolume, Lightkey, Vezer, etc.).

A web UI handles patching: pick a bulb, pick a universe + DMX start address, pick a profile (RGB / HSI / RGBW / 16-bit / CT / dimmer), done.

License: MIT

Features

  • sACN multicast receiver — joins universes only when patches need them.
  • Priority-based source merging — multiple sACN sources on the same universe are merged per ANSI E1.31 §6.2.3 (highest priority wins, sticky on ties, terminated/preview flags respected, idle-priority frames ignored).
  • LIFX LAN — auto-discovery, raw-UDP SetColor packets (no ack overhead) capped at 10 Hz per bulb with 300 ms smoothing.
  • Philips Hue — bridge auto-discovery, in-app pairing flow (press the link button), local CLIP API control capped at 10 Hz per light.
  • Color memory + hold-through-blackout — preserves hue/saturation through console intensity dips so an RGB blackout doesn't flash through warm white on the way back up.
  • Web patcher at http://localhost:3737:
    • Add/remove patches with live HSBK preview swatches.
    • Identify (flash) any bulb in one click.
    • DMX monitor view of every active universe.
    • Patches persist to data/patches.json.

Channel profiles

ID Channels Layout
dim 1 Dimmer
ct 2 Kelvin, Intensity
rgb 3 R, G, B
hsi 3 Hue, Saturation, Intensity
rgbd 4 R, G, B, Dimmer
drgb 4 Dimmer, R, G, B
rgbw 4 R, G, B, White
hsik 4 Hue, Saturation, Intensity, Kelvin
drgbw 5 Dimmer, R, G, B, White
rgbcw 5 R, G, B, Cool White, Warm White
hsi16 6 H_hi, H_lo, S_hi, S_lo, I_hi, I_lo (16-bit each)
rgbw16 8 R, G, B, W — each 16-bit (HI then LO)
hsi16k 8 H, S, I, K — each 16-bit (HI then LO)
drgbw16 10 Dim, R, G, B, W — each 16-bit (HI then LO)

Requirements

  • Node 18 or newer.
  • Your computer must be on the same Layer-2 network as both the lighting console and the bulbs — sACN uses multicast, LIFX/Hue use LAN UDP/HTTP.
  • Open ports: UDP 5568 (sACN), UDP 56700 (LIFX discovery), TCP 3737 (web UI, configurable via PORT).

Run from source

git clone https://github.com/hfreni/lifx-dmx.git
cd lifx-dmx
npm install
npm start
# → open http://localhost:3737

Override the HTTP port with PORT=4000 npm start.

Build a standalone macOS binary

npm run build:mac        # Apple Silicon
npm run build:mac-x64    # Intel

Output lands in dist/lifx-dmx (~50 MB, includes a bundled Node runtime). Run it from anywhere — it writes its config (patches.json, hue-bridges.json) into a data/ directory next to the executable.

Because the binary is unsigned, first-run on macOS will require either:

xattr -d com.apple.quarantine ./lifx-dmx

…or right-click the binary in Finder and choose Open to bypass Gatekeeper.

Pairing a Hue bridge

  1. Open the web UI.
  2. In Philips Hue bridges, click Discover (or enter the IP manually).
  3. Press the round button on the top of the Hue Bridge.
  4. Within 30 seconds, click Press link button, then pair.
  5. Lights from the bridge appear in the bulb list and patch dropdown.

The pairing token is stored in data/hue-bridges.json — treat this file like a credential; it grants full local control of the bridge.

Architecture

sACN multicast ──▶ SacnReceiver ──▶ Patcher ──▶ DeviceRegistry ──┬─▶ LifxAdapter (raw UDP)
                                                                  └─▶ HueAdapter (CLIP API)

Each adapter exposes a uniform setColor(id, hsbk) interface where HSBK is canonicalized as { hue: 0-360, saturation: 0-100, brightness: 0-100, kelvin: 2500-9000 }. Per-bulb update ticks throttle to each platform's safe max rate.

Files

  • src/server.js — HTTP/WS server entrypoint
  • src/sacn.js — multicast E1.31 receiver + source merging
  • src/patcher.js — DMX → HSBK routing, color memory, hold-through-blackout
  • src/converter.js — channel profiles
  • src/devices/index.js — vendor registry
  • src/devices/lifx.js — LIFX adapter
  • src/devices/lifx-protocol.js — minimal LIFX UDP encoder
  • src/devices/hue.js — Philips Hue adapter
  • src/store.js — atomic JSON file storage
  • public/ — single-page web UI
  • data/ — runtime state (patches + Hue bridges; gitignored)

Notes

  • LIFX bulbs cap practically at ~20 Hz before WiFi back-pressure shows up. We send fire-and-forget SetColor packets directly via UDP at 10 Hz with 300 ms transition smoothing to avoid the ack/retry cycle.
  • Hue's local API rate limit is ~10 commands/sec/light. We respect this.
  • For dimmer-driven modes (rgbd, drgb, dim), brightness 0 fully turns off Hue lights (they ignore color when off, which is correct).

Contributing

Issues and pull requests welcome. The codebase is intentionally small — read the source before opening anything substantial so we're starting from the same understanding of the trade-offs.

License

MIT — see LICENSE.

Releases

Packages

Contributors

Languages