Small HTTP server that can be added as a network stream and assigned to Wiim presets, which actually triggers random mixes on an LMS instance instead.
  • Go 95.2%
  • Dockerfile 4.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-16 22:21:25 -05:00
docker-compose.yaml initial commit 2026-08-16 20:15:05 -05:00
Dockerfile initial commit 2026-08-16 20:15:05 -05:00
main.go initial commit 2026-08-16 20:15:05 -05:00
README.md updated readme 2026-08-16 22:21:25 -05:00

What This Lets You Do

If you own a Wiim media streamer and remote, and use Lyrion Music Server as your primary method of sending music to it, one shortcoming is there is no way to directly tie LMS content to the preset buttons on your remote. This project is a proof of concept for a way to support that.

How It Works

This code runs a small HTTP server configured with the address of your LMS instance. It exposes a mix endpoint that takes a genre and a type (either albums or tracks). When that endpoint is called, it makes requests to the LMS API to start a random mix of that genre and type, and returns a valid MP3 file containing brief silence (around 26ms).

In your Wiim Home app, you can enable the "Open Network Stream" music service, then add new streams that point to this server containing whatever genres and types you want, then assign those to preset buttons on your remote. When the preset is triggered, the stream plays its 26ms of silence and finishes, but at the same time LMS gets called to start the random mix, which will be the thing that actually starts playing on the Wiim.

  1. Wiim preset button is pressed.
  2. This helper app is called as a stream, returns tiny silent MP3.
  3. This helper app triggers a random mix on LMS.
  4. LMS starts streaming that mix to the Wiim.

Installation and Configuration

The application looks for two environment variables:

Variable Default Value Description
LMS_HOST http://localhost:9000 The url of your LMS instance
LISTEN_PORT 8088 The port that the helper should listen on

You can compile main.go directly and run the resulting binary:

$ go build -o lmshelper main.go
$ LMS_HOST=http://my.lms.host:9000 ./lmshelper

I have also included a Dockerfile and example docker-compose.yaml files if you wish to build and run it using docker. You can edit the environment configuration in docker-compose.yaml before running to suit your needs.

$ docker compose build
$ docker compose up -d

Keep in mind that if LMS is also running in docker, and is on the same host machine that you are trying to run this helper on, you will likely need to do additional network configuration to allow this helper to talk to LMS. How to do that is beyond the scope of this project and documentation.

Usage

Once you have the helper proxy running, you can add urls to it as network streams and assign those to Wiim presets. For example you could test it with curl from the machine it's running on with the below example. Assuming you have some songs with the genre Rock, this should cause your LMS to start playing a random mix of those tracks:

curl "http://127.0.0.1:8088/mix?genre=Rock&type=tracks"

To wire LMS mixes up as presets, in the Wiim Home app:

  1. Go to the "Browse" tab.
  2. Ensure that "Open Network Stream" is one of your enabled music services (click Customize and enable it if not).
  3. Click "Open Network Stream."
  4. Add a new stream, the name doesn't matter but you could use the genre that you want to play.
  5. The stream's url should point to the IP address of the machine and port that this application is running on, and call the mix endpoint with the genre and mix type you want (replacing any spaces in the genre with a + sign). Note that the genre must match the one your songs are tagged with exactly. Here are some examples, assuming that the helper is running on a machine in your local network with the IP address 192.168.1.100:
    • http://192.168.1.100:8088/mix?genre=Pop&type=tracks play a random stream of all your music with the "Pop" genre.
    • http://192.168.1.100:8088/mix?genre=Heavy+Metal&type=albums play a random stream of full Heavy Metal albums.
  6. If you did it right, when you click "Test Stream" LMS should actually start playing that random mix since the app will call it.
  7. Save the stream, then click the three vertical dots next to it for the option to assign it to one of your presets.