Skip to main content

Drive WLED LED strips from Mopidy album art

Project description

Mopidy-JukeboxLights

Mopidy-JukeboxLights

PyPI CI

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_display below.

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mopidy_jukeboxlights-1.0.1.tar.gz (245.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mopidy_jukeboxlights-1.0.1-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

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

Hashes for mopidy_jukeboxlights-1.0.1.tar.gz
Algorithm Hash digest
SHA256 67f12993a28c9704229030cab456477e2116a62a6ea3c6c1687db700ccb98428
MD5 d26cc89f930e93eab36076092f4eb82d
BLAKE2b-256 366b226b894bcf7d71ff3529cfaf4bd275486e49e7afd95b2cd7db72e69cfa0d

See more details on using hashes here.

Provenance

The following attestation bundles were made for mopidy_jukeboxlights-1.0.1.tar.gz:

Publisher: ci.yml on kingbutter/mopidy-jukebox-lights

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mopidy_jukeboxlights-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for mopidy_jukeboxlights-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 49ac678053dac3269f3a9eb89a4d1554e785cdcb41a1ea3a0831cb4d7ca3906c
MD5 461759dd8d8e5e8c58ad86b8e842e80f
BLAKE2b-256 d9d854a4c5ecd3ed5dc696b6ad998f20de15ba65c52af6285520510ef9b98ad0

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page