Drive WLED LED strips from Mopidy album art
Project description
Mopidy-JukeboxLights
A Mopidy extension that drives WLED LED strips with colors pulled from the album art of whatever is playing.
What it does
- Color from the sleeve. Averaging album art gives brown every time. Instead this buckets pixels, discards anything too dark or too washed out to register as light, and scores the rest by pixel count weighted by saturation — so a small bright detail on a black sleeve still wins.
- Two-color cabinets. Picks an accent from the strongest hue at least ~29° away from the dominant, and paints nominated segments with it. A red-and-blue sleeve lights red and blue, not two shades of purple.
- Event driven. A Mopidy frontend actor listening for
track_playback_started, so the lights change the instant the track does. Network calls run on a worker thread and never block Mopidy's event loop. - Idle and dark states. Breathes amber when nothing is playing, and goes
fully dark when a kiosk panel blanks — see
follow_displaybelow.
Status page
Once running, http://<your-host>:6680/jukeboxlights/ shows what the lights
are doing and, more usefully, why — whether WLED is reachable, which
segments were discovered, and whether the strip is following music, breathing
amber, or dark because the kiosk panel blanked. It also has a button to cycle
red/green/blue/amber for checking wiring without needing to play anything.
Installation
python3 -m pip install Mopidy-JukeboxLights
Configuration
[jukeboxlights]
enabled = true
wled_host = 172.20.25.44 # IP or host:port of your WLED device
brightness = 160 # 1-255
idle_after = 45 # seconds of silence before the idle effect
idle_color = amber # name, hex, or r,g,b
accent_segments = 1,2,3 # segment ids that get the accent color
follow_display = true
display_flag = /run/jukebox/display-off
Segments are read from WLED at startup, so a strip run in one uncut piece with hidden stretches behind a door frame works without any config here — define the visible runs as WLED segments and this follows them.
Idle color
idle_color accepts a name, a hex string, or an r,g,b triplet — amber,
#f0a830, f0a830, #fa3 and 240,168,48 are all the same colour. Named
options: amber, warm-white, candle, gold, red, oxblood, pink,
purple, blue, cyan, teal, green, lime, white.
The status page has a swatch grid and a colour picker that apply immediately,
so you can try colours against the actual cabinet before committing one to
mopidy.conf. Changes made there are not persisted — the config file stays
the source of truth across restarts, and the page shows the line to paste.
Turning the lights off with the screen
If something else on the machine creates the file named by display_flag when
a kiosk display blanks, the strip goes fully dark rather than breathing — but
only while nothing is playing. Remove the file and it comes back. Set
follow_display = false to ignore this entirely.
Project resources
Credits
- Original author: King Butter
- Current maintainer: King Butter x
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mopidy_jukeboxlights-1.0.1.tar.gz.
File metadata
- Download URL: mopidy_jukeboxlights-1.0.1.tar.gz
- Upload date:
- Size: 245.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67f12993a28c9704229030cab456477e2116a62a6ea3c6c1687db700ccb98428
|
|
| MD5 |
d26cc89f930e93eab36076092f4eb82d
|
|
| BLAKE2b-256 |
366b226b894bcf7d71ff3529cfaf4bd275486e49e7afd95b2cd7db72e69cfa0d
|
Provenance
The following attestation bundles were made for mopidy_jukeboxlights-1.0.1.tar.gz:
Publisher:
ci.yml on kingbutter/mopidy-jukebox-lights
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mopidy_jukeboxlights-1.0.1.tar.gz -
Subject digest:
67f12993a28c9704229030cab456477e2116a62a6ea3c6c1687db700ccb98428 - Sigstore transparency entry: 2275081535
- Sigstore integration time:
-
Permalink:
kingbutter/mopidy-jukebox-lights@a7833422f2f620ed52b1474a8a57814af3364284 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/kingbutter
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@a7833422f2f620ed52b1474a8a57814af3364284 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mopidy_jukeboxlights-1.0.1-py3-none-any.whl.
File metadata
- Download URL: mopidy_jukeboxlights-1.0.1-py3-none-any.whl
- Upload date:
- Size: 15.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49ac678053dac3269f3a9eb89a4d1554e785cdcb41a1ea3a0831cb4d7ca3906c
|
|
| MD5 |
461759dd8d8e5e8c58ad86b8e842e80f
|
|
| BLAKE2b-256 |
d9d854a4c5ecd3ed5dc696b6ad998f20de15ba65c52af6285520510ef9b98ad0
|
Provenance
The following attestation bundles were made for mopidy_jukeboxlights-1.0.1-py3-none-any.whl:
Publisher:
ci.yml on kingbutter/mopidy-jukebox-lights
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mopidy_jukeboxlights-1.0.1-py3-none-any.whl -
Subject digest:
49ac678053dac3269f3a9eb89a4d1554e785cdcb41a1ea3a0831cb4d7ca3906c - Sigstore transparency entry: 2275081554
- Sigstore integration time:
-
Permalink:
kingbutter/mopidy-jukebox-lights@a7833422f2f620ed52b1474a8a57814af3364284 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/kingbutter
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@a7833422f2f620ed52b1474a8a57814af3364284 -
Trigger Event:
push
-
Statement type: