Skip to main content

Lumen

Desktop control for Philips Hue lights, built for Linux/Wayland (Hyprland, but the UI runs anywhere pywebview's GTK/WebKit backend does). Everything goes through the bridge's local API (CLIP v2): no cloud, and no dependency on the mobile app once paired.

Lumen's Rooms page: room cards with scenes and per-lamp brightness

Three commands sharing the same configuration:

  • hue-webui - the desktop app: a Vue 3 UI in a native pywebview window, with a system-tray icon.
  • hue - command-line client, ideal for keyboard shortcuts.
  • hue-sync - screen sync (ambilight) without the GUI.

Features

  • Bridge pairing directly in the app: the bridge is found on the local network (mDNS), then one press of its button. Dark/light theme, English/French UI.
  • Rooms and zones as cards: group control (on/off + brightness), and per lamp a colour wheel, brightness, white temperature and the effects the lamp supports (candle, fire, prism...). Unplugged lamps show as unreachable instead of pretending to be on.
  • Scenes grouped by room/zone, with a thumbnail generated from the scene's real colours. Gallery scenes with a palette can also play dynamically. Create, edit and delete scenes (captures the current light state of every lamp in the group - the bridge requires the full set, not a partial capture).
  • Create, edit and delete rooms and zones, from one editor. A room holds devices and mirrors your physical setup (a lamp lives in exactly one room); a zone holds individual lights and zones may overlap. "Identify" makes a lamp breathe once to tell which is which.
  • Screen sync / ambilight - see below: live channel preview, screen picker, colour boost, smoothing, frame rate, black-bar detection, and Entertainment areas created and edited in the app.
  • Real-time updates: the UI reflects changes made elsewhere (phone, wall switch, another app) live, via the bridge event stream (SSE).
  • System tray: every room and zone with its scenes, all off, settings; closing the window minimizes to tray, so a running screen sync keeps streaming.
  • Optional: a room or zone switched off while the computer sleeps and back on at wake-up; a status-bar module (Waybar, Noctalia - see the CLI section).
  • The bridge's TLS certificate is pinned at pairing, and Lumen follows the bridge on its own if the router gives it a new IP.
Lamp sheet: colour wheel, brightness, whites and effects Scenes page: scenes grouped by room and zone
Screen sync running: live colour of each channel Rooms page in the light theme

Screenshots use the app's built-in demo data.

Screen sync (ambilight)

Lumen averages regions of your screen and streams them to the lamps over the Hue Entertainment API, at up to 50 frames per second.

Create an Entertainment area on the Sync page (+ NEW) or in the official Hue app, then start the sync (or run hue-sync). Each lamp follows the slice of the screen matching its position in that area, so left lamps follow the left of the picture. In the area editor, a lamp can also follow only the top or the bottom of the picture (a lamp above or below the screen), a narrow slice, or the whole width (an ambient lamp); "Identify" makes a lamp breathe once.

Screen capture drives a system binary rather than a Python binding, and the first backend that works is used:

Backend Needs Notes
wlroots wf-recorder Hyprland, Sway. Fastest, never prompts.
portal gst-launch-1.0 (gst-plugin-pipewire), pw-dump Universal: GNOME, KDE, wlroots. Asks which screen on every start.
x11 ffmpeg Plain X11 sessions.

Settings hold the screen to capture, a color boost (screen averages are washed out; lamps need the push) and the frame rate. Screen and color boost apply to a running sync; changing the frame rate needs a stop and start.

Pairing must have produced a client_key - it is the DTLS secret. Configs from older versions may lack it, in which case re-pair once.

Installation

Quick install (Arch/CachyOS):

./install.sh

Installs the system packages below via pacman (asks first), builds the UI, installs hue/hue-webui/hue-sync with pipx (falls back to pip install --user), offers the desktop launcher, and cleans up hue-gui if an older install left it behind. ./install.sh -y skips every prompt.

From PyPI (any distro; no Node needed, the UI ships prebuilt):

pipx install --system-site-packages lumen-hue

The app needs PyGObject, WebKitGTK and an AppIndicator library from your distro first - PyGObject binds the system GTK, so it can't come from pip, and --system-site-packages is what lets the app see it. On Arch: python-gobject webkit2gtk-4.1 libayatana-appindicator; on Debian/Ubuntu, e.g. python3-gi gir1.2-webkit2-4.1 gir1.2-ayatanaappindicator3-0.1. The hue CLI alone needs none of that.

Manual install, or on another distro - requires Python >= 3.10 and Node.js/npm (build-time only, for the UI):

# from the project directory
cd webui && npm install && npm run build && cd ..
# recommended (isolated environment; the flag lets it see the system PyGObject)
pipx install --system-site-packages .
# or
pip install --user .

This installs hue, hue-webui and hue-sync.

On Arch/CachyOS, install the UI's runtime pieces from the system instead of via pip:

sudo pacman -S python-pywebview webkit2gtk-4.1 python-gobject \
               python-pystray python-pillow libayatana-appindicator \
               nodejs npm
# run the app without installing the package
python -m huectl          

Screen sync needs openssl (already present on most systems) plus one capture backend from the table above:

# Hyprland / Sway
sudo pacman -S wf-recorder
# any other compositor, through the desktop portal
sudo pacman -S gstreamer gst-plugin-pipewire pipewire-utils xdg-desktop-portal

Bridge detection, and following the bridge when the router gives it a new IP, use mDNS through avahi-browse (already running on most desktops):

sudo pacman -S avahi && sudo systemctl enable --now avahi-daemon

Without it, first detection falls back to the Philips cloud service, and an IP change has to be entered by hand (Setup > Change IP).

Launcher / autostart

Copy packaging/lumen.desktop into ~/.local/share/applications/. To start minimized to the tray at session login (Hyprland), set start_minimized in Setup > Appearance, then:

exec-once = hue-webui

The tray icon requires a tray host (Waybar's tray module, or your shell's systray). Without a host, the window simply stays visible.

First run

hue-webui

On first run the pairing screen detects the bridge (or enter its IP), you press the bridge button, then click "Pair". Keys are stored in ~/.config/huectl/config.json (chmod 600).

CLI

hue discover                 # find the bridge
hue auth                     # press the bridge button
hue lights                   # list lamps
hue rooms                    # rooms and zones
hue scenes                   # scenes
hue status                   # each room/zone: brightness or off
hue status "Living room"     # one room, zone or lamp
hue on "Living room"         # turn a room/zone on ("all" = every light)
hue toggle "Left lamp"       # toggle a lamp
hue bri "Living room" 60     # brightness 0-100
hue bri "Living room" +10    # relative
hue color "Lamp" #ff3300     # color
hue ct "Living room" warm    # warm white (or 3000, neutral, cool)
hue scene "Relax"            # activate a scene
hue raw GET /clip/v2/resource/light   # raw API access

Screen sync from the terminal:

hue-sync --list              # list Entertainment areas
hue-sync                     # ambilight from the screen
hue-sync --output DP-2       # capture one monitor
hue-sync --saturation 2.0    # stronger colors
hue-sync --test              # rainbow pattern, to check the pipeline

Example Hyprland shortcuts:

bind = $mod, F1, exec, hue toggle "Living room"
bind = $mod, F2, exec, hue scene "Relax"
bind = $mod SHIFT, F1, exec, hue bri "Living room" +15

Status bar

hue status --json [target] prints one line in Waybar's custom-module format: text (60% or off), alt and class (on/off, for format-icons and CSS), percentage, and a tooltip listing every room and zone. Unplugged lamps count as off, as in the app. Any other bar that runs a command can show the plain hue status "Living room" instead.

Waybar (~/.config/waybar/config.jsonc, then add "custom/hue" to a modules list):

"custom/hue": {
    "exec": "hue status --json \"Living room\"",
    "return-type": "json",
    "interval": 5,
    "signal": 8,
    "format": "hue {}",
    "on-click": "hue toggle \"Living room\"; pkill -RTMIN+8 waybar",
    "on-scroll-up": "hue bri \"Living room\" +10; pkill -RTMIN+8 waybar",
    "on-scroll-down": "hue bri \"Living room\" -10; pkill -RTMIN+8 waybar"
}

The pkill -RTMIN+8 refreshes the module right after a click instead of at the next 5 s tick (it matches "signal": 8). Dim the module when the lights are off with #custom-hue.off { opacity: 0.5; } in style.css.

Noctalia (v5): Lumen ships a bar widget plugin in packaging/noctalia/lumen/: a bulb with the brightness, click to toggle, scroll for brightness, the rooms in the tooltip. ./install.sh offers to install and enable it; by hand:

cp -r packaging/noctalia/lumen ~/.local/share/noctalia/plugins/
noctalia msg plugins enable local/lumen

Then put it in a bar. Add the widget with Noctalia's bar settings, or in TOML:

[widget.hue]
type = "local/lumen:hue"
target = "Living room"   # room, zone or lamp; leave out for every light

[bar.default]
end = [ "tray", "hue", "volume" ]   # wherever it should sit

Mind which file holds your bar layout: once a bar was edited from Noctalia's settings window, its lanes live in ~/.local/state/noctalia/settings.toml and override config.toml - add "hue" there, then noctalia msg config-reload. noctalia msg plugin local/lumen:hue all refresh forces an update, e.g. from a keybind that just ran hue.

Project layout

huectl/                Python backend + entry points
  config.py            config load/save
  bridge.py            CLIP v2 HTTP client + discovery
  i18n.py              English/French strings, shared with the UI
  cli.py               command-line interface (hue) - has its own color math,
                        no dependency on the UI or on Qt
  webapp.py            pywebview shell, JS<->Python bridge (Api class),
                        SSE/sync background threads, system tray (hue-webui)
  webui_dist/          built Vue app (generated, gitignored - see below)
  huestream.py         HueStream v2 frame protocol
  entertainment.py     Entertainment configurations and channels
  dtls_stream.py       DTLS-PSK transport over the system openssl
  capture.py           screen capture backends, region averaging
  portal.py            xdg-desktop-portal ScreenCast
  sync.py              color sources, channel mapping, hue-sync entry point

webui/                 Vue 3 UI source, built to huectl/webui_dist/ (npm run
                        build) - a sibling dist/ would sit outside the huectl
                        package and never reach an installed wheel
  src/components/      design-system pieces (cards, sheets, sliders, icons)
  src/pages/           Rooms/Zones/Scenes/Sync/Setup
  src/store/           reactive app state + all calls into Api
  src/lib/             CLIP v2 <-> view-model mapping, colour math (a JS port
                        of the same sRGB<->xy conversions the CLI itself uses)
  src/composables/     theme and i18n

Technical notes

  • The bridge exposes its API over HTTPS with a self-signed certificate (verify=False); authentication uses the hue-application-key header.
  • Colors are converted in sRGB both ways (RGB<->xy) to stay faithful to the picked color - ported independently in the CLI (cli.py) and the web UI (webui/src/lib/huecolor.js), verified to agree with each other.
  • A scene's actions must cover every light currently in its room/zone - the bridge rejects a partial list with "Light action targets not matching lights in referenced group" (confirmed against a real bridge). The Scene Editor always re-captures the full group, never a subset.
  • The Philips mobile app's real product photos are not available through the bridge; Lumen draws its own inline-SVG icons instead.
  • DTLS-PSK for Entertainment uses the system openssl binary, not a Python DTLS binding (python-mbedtls is unmaintained and does not build against Mbed TLS 3.x).
  • Screen capture never grabs one frame at a time: a grim call costs about 120 ms whatever the resolution, which caps it near 8 fps. Continuous streams are used instead, and only the newest frame is kept so the lamps cannot drift behind the screen. Starting sync with no explicit monitor picked on a multi-monitor Hyprland setup will fail the fast wlroots path and fall through to the portal backend instead - the UI always resolves "Automatic" to a real output name via hyprctl first to avoid that path entirely.
  • The portal backend asks which screen to share on every start; nothing sends the portal's persist_mode option yet to suppress that (a real follow-up now that portal.py is plain GDBus.
  • The x11 capture backend is written but has not been exercised on a real X11 session.
  • WebKitGTK's DMABUF renderer can crash on load (Wayland protocol error) on hybrid Intel+NVIDIA setups; hue-webui sets WEBKIT_DISABLE_DMABUF_RENDERER=1 before import to avoid it.

Releasing

  1. Bump __version__ in huectl/__init__.py - the only place it lives.
  2. Commit, then tag and push: git tag v1.1.0 && git push origin master v1.1.0.
  3. The Release workflow builds the UI and the package, checks the tag matches the version, and publishes to PyPI through Trusted Publishing (no token stored anywhere). Run it by hand from the Actions tab to check a build without publishing.

License

GNU General Public License v3.0 or later (GPL-3.0-or-later). See LICENSE.

Metadata

Release files for lumen-hue 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lumen-hue 1.1.0
File Size Uploaded Provenance Actions
lumen_hue-1.1.0.tar.gz 164.2 kB With provenance Details for lumen_hue-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lumen-hue 1.1.0
File Interpreter ABI Platform Actions
lumen_hue-1.1.0-py3-none-any.whl Python 3 none any Details for lumen_hue-1.1.0-py3-none-any.whl

Total release size: 317.2 kB

Release files / lumen_hue-1.1.0.tar.gz

Download URL lumen_hue-1.1.0.tar.gz
Size 164.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1838c53b77e80a8ee463697420e24bfbcd69668f270b8691ee892af649fbddd3
BLAKE2b-256 checksum
How to use checksums
aa88e17aa2a1225c690009fd2b407abbe3a57848062d7ee4395414b35a486249
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Release files / lumen_hue-1.1.0-py3-none-any.whl

Download URL lumen_hue-1.1.0-py3-none-any.whl
Size 153.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
16185c6805947c7c6214834ee6272f8aac72fde7489f2e74e336a09461e97e7b
BLAKE2b-256 checksum
How to use checksums
065cd42641c088f803100dfb426fd482729ee7c71b31ae1ff4feaee0cd23502b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Security for lumen-hue 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for lumen_hue-1.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page