core icon indicating copy to clipboard operation
core copied to clipboard

Loxone Radio

Open mschlenstedt opened this issue 4 months ago • 13 comments

With App Version 17.3 Loxone added "Loxone Radio", which are some Radio Streams published by Loxone free of charge and without ads. I analysed the Loxone App with Claude how these streams are filled.

Maybe we can implement this and add the Radio Paradise streams there. Of cource it should also be possible to extract the real stream URLs from AudioServer Firmware V17, but this may violate rights?

Finding: "Loxone Radio" stations are fetched via WebSocket directly from the Audioserver

The request does not go to the Miniserver. The app opens its own WebSocket connection to the Audioserver, and the actual station list is retrieved with a single command over that socket:

audio/cfg/getservicefolder/loxoneradio/noUser/start/0/50

(Analysis based on the decompiled Loxone App V17 for Windows — Electron, code extracted from resources/app.asar.)

The request chain in detail

1. Connection setup (AppHub.js ~line 14510, _onConnInfoChange ~14690): The app opens a WebSocket with subprotocol remotecontrol to the Audioserver. The target is chosen depending on the situation:

  • Local with valid certificate: wss://<ip-with-dashes>.<MAC>.dyndns.loxonecloud.com:7091/ (Loxone's DNS trick to get TLS on the LAN)
  • Local without TLS: ws://<audioserver-host>:7091
  • Fallback/remote (every 3rd attempt, or when the Audioserver is unreachable from a different subnet): through the Miniserver acting as a proxy: ws(s)://<miniserver>/proxy/<uuidAction of the AudioServer control>/

2. Authentication (after the Audioserver's greeting message, _authenticate ~14969):

  1. audio/cfg/getkey → returns the Audioserver's RSA public key
  2. secure/authenticate/<user>/<RSA(aesKey:iv:sessionToken)>/<AES-encrypted Miniserver token> — i.e. the app reuses its existing Miniserver JWT to authenticate against the Audioserver.

3. Fetching the stations — LoxoneRadioRepository (comps.js ~18767, source path app/scripts/AudioServer/repositories/services/loxoneRadioRepository). It uses the generic service-folder API (CommonServiceBase._fetchPage, ~19722):

  • Command scheme: audio/cfg/getservicefolder with params [service, user, folderId, start, size], joined into a single path (_internalSend, AppHub.js ~14775)
  • For Loxone Radio: service = loxoneradio, user = noUser (hardcoded, no account required), root folder = start, paginated in chunks of 50. The app keeps paginating automatically (.../start/50/50, …) until totalitems is reached.
  • Navigating into a folder issues the same command with that folder's ID taken from the response.

4. Response (JSON on the same socket): an object containing getservicefolder_result → { name, totalitems, items[], coverurl }. The items are browsable or playable radio entries whose audiopath starts with loxoneradio (this prefix is also how the app recognizes them in "recently played" / favorites).

Constraints

  • Feature gate: Loxone Radio requires Audioserver firmware ≥ 17.0.0.0 (API 1.6). The app checks this against the version info from the socket greeting (hasFeature('LoxoneRadio'), feature table in comps.js ~8293) and hides the menu entry otherwise.
  • The classic (TuneIn) radios are handled separately via audio/cfg/getradios; custom streams via the custom_stream service.

Reproducing it

To replicate this (e.g. from a third-party integration), it is sufficient to:

  1. Open a WebSocket to ws://<audioserver>:7091 with subprotocol remotecontrol
  2. Perform the getkey + secure/authenticate handshake using a valid Miniserver token
  3. Send audio/cfg/getservicefolder/loxoneradio/noUser/start/0/50

mschlenstedt avatar Jul 06 '26 08:07 mschlenstedt

Since App V17 if you play a stream and let the audioserver block open in the App, it throws this error and stops playing:

Image

mschlenstedt avatar Jul 11 '26 12:07 mschlenstedt

https://github.com/orgs/lox-audioserver/discussions/304

mr-manuel avatar Jul 11 '26 14:07 mr-manuel

@mr-manuel As already said I would love to see the Radio Paradise streams there - without streams the App V17 gives errors.

mschlenstedt avatar Jul 11 '26 16:07 mschlenstedt

It was just to reference it, since both are about Loxone Radio :)

mr-manuel avatar Jul 11 '26 18:07 mr-manuel

Thanks for the input. I already looked into this myself. This fix ee47ee04f831d1cde27652320ad120977f91003b should give you an empty list for loxone radio. Does this not work for you?

Implementing (by hacking) the actual Loxone Radio might be pushing it a little too far. If they had not protected their streaming api I would have implemented it. If anyone disagrees with this I would love to hear your opinion.

I do like the idea of moving Radio Paradise to this menu item. I will implement this in the next beta.

rudyberends avatar Jul 11 '26 23:07 rudyberends

This fix ee47ee0 should give you an empty list for loxone radio. Does this not work for you?

Unfortunately I couldn't test this - I am still on beta-16.

I will wait for beta-17 and the radio paradise implementation 😀

Thanks!

mschlenstedt avatar Jul 13 '26 15:07 mschlenstedt

This fix https://github.com/lox-audioserver/core/commit/ee47ee04f831d1cde27652320ad120977f91003b should give you an empty list for loxone radio. Does this not work for you?

Works for me

mr-manuel avatar Jul 13 '26 18:07 mr-manuel

The feature should now be available in beta 17. Please let me know if it works for you.

The repo has moved to the sonn-audio organization. If you use a prebuilt container, the container url has also changed. Please check the readme.

rudyberends avatar Jul 24 '26 17:07 rudyberends

Radio Paradise is displayed under the Loxone Radio tap, which is a great idea. However, playback stops for me after a track has finished playing completely; the corresponding log is attached.

21:12:48.535 #70 LoxoneHttp|Notifier [artist="Stevie Ray Vaughan and Double Trouble" duration=173 mode=play sourceName=504F94FF1BB4 time=172 title="Pipeline (w/ Dick Dale)" zoneId=5 zoneName=Esszimmer] audio_event payload 21:12:48.535 #71 LoxoneHttp|Notifier [zoneId=5] audio_event broadcast 21:12:48.770 #75 Audio|Session [bufferedBytes=0 code=0 earlyExit=false profile=flac runMs=172877 signal=null stderr="[out#0/flac @ 0xc3883f0] video:0KiB audio:20468KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.040125%\nsize= 20476KiB time=00:02:53.00 bitrate= 969.6kbits/s speed= 1x" stderrAt=1785791568769 subscribers=1 totalBytes=20967912 zoneId=5] ffmpeg exited 21:12:48.771 #76 Audio|Manager [exitCode=0 exitSignal=null reason=undefined source=https://audio.radioparadise.stream/audio/blocks/2/x/1127/4/g/1127-2.flac?src=alexa stderr="[out#0/flac @ 0xc3883f0] video:0KiB audio:20468KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.040125%\nsize= 20476KiB time=00:02:53.00 bitrate= 969.6kbits/s speed= 1x" zoneId=5] playback session terminated by engine 21:12:48.771 #77 LoxoneHttp|Notifier [artist="" duration=0 mode=stop sourceName=504F94FF1BB4 time=0 title="Playback unavailable" zoneId=5 zoneName=Esszimmer] audio_event payload 21:12:48.771 #78 LoxoneHttp|Notifier [zoneId=5] audio_event broadcast 21:12:48.771 #82 Zones|Manager [activeOutput=squeezelite targetCount=1 zoneId=5] dispatch output metadata 21:12:48.772 #84 Zones|Manager [reason="https://audio.radioparadise.stream/audio/blocks/2/x/1127/4/g/1127-2.flac?src=alexa stream failed: [out#0/flac @ 0xc3883f0] video:0KiB audio:20468KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.040125% size= 20476KiB time=00:02:53.00 bitrate= 969.6kbits/s speed= 1x" source=output title="Playback unavailable" zoneId=5] playback error

Holzmusik avatar Aug 03 '26 21:08 Holzmusik

Hello, do you know the different URLs for Loxone Audio? Are they usable?

ultra-spark avatar Aug 11 '26 08:08 ultra-spark

Hello, do you know the different URLs for Loxone Audio? Are they usable?

@ultra-spark Yes, the URLs are known — they're not usable.

The catalog itself is reachable: each item comes back as loxoneradio:stream:<8hex> with its own streamurl on loxone.streampal.net plus a cover on radio.loxonecloud.com. The covers load fine (public, 200).

The streams don't. loxone.streampal.net/auth/play.cgi?stream=... requires a client certificate — it fails with tlsv13 alert certificate required even with -k, meaning the server is asking us for a cert, not the other way around. The unauthenticated /play.cgi path returns 404, and the client bundle references mTLS and a .pem. So playback needs a genuine Loxone device certificate, which only exists on real Audioserver hardware.

That means the only way to make this work would be to obtain a real device certificate and ship it in the code. That isn't something we can do legally — it's a per-device credential tied to Loxone's licensed content, not ours to distribute. And even setting that aside, a single certificate baked into a public repo would almost certainly be revoked the moment it leaks, breaking it for everyone.

For those reasons we're not going to implement it. Radio Paradise living in this tile stays the practical answer.

rudyberends avatar Aug 12 '26 13:08 rudyberends

OK, I had a feeling he'd locked the URL; on the one hand, that's normal...

ultra-spark avatar Aug 12 '26 14:08 ultra-spark

Radio Paradise is displayed under the Loxone Radio tap, which is a great idea. However, playback stops for me after a track has finished playing completely; the corresponding log is attached.

21:12:48.535 #70 LoxoneHttp|Notifier [artist="Stevie Ray Vaughan and Double Trouble" duration=173 mode=play sourceName=504F94FF1BB4 time=172 title="Pipeline (w/ Dick Dale)" zoneId=5 zoneName=Esszimmer] audio_event payload 21:12:48.535 #71 LoxoneHttp|Notifier [zoneId=5] audio_event broadcast 21:12:48.770 #75 Audio|Session [bufferedBytes=0 code=0 earlyExit=false profile=flac runMs=172877 signal=null stderr="[out#0/flac @ 0xc3883f0] video:0KiB audio:20468KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.040125%\nsize= 20476KiB time=00:02:53.00 bitrate= 969.6kbits/s speed= 1x" stderrAt=1785791568769 subscribers=1 totalBytes=20967912 zoneId=5] ffmpeg exited 21:12:48.771 #76 Audio|Manager [exitCode=0 exitSignal=null reason=undefined source=https://audio.radioparadise.stream/audio/blocks/2/x/1127/4/g/1127-2.flac?src=alexa stderr="[out#0/flac @ 0xc3883f0] video:0KiB audio:20468KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.040125%\nsize= 20476KiB time=00:02:53.00 bitrate= 969.6kbits/s speed= 1x" zoneId=5] playback session terminated by engine 21:12:48.771 #77 LoxoneHttp|Notifier [artist="" duration=0 mode=stop sourceName=504F94FF1BB4 time=0 title="Playback unavailable" zoneId=5 zoneName=Esszimmer] audio_event payload 21:12:48.771 #78 LoxoneHttp|Notifier [zoneId=5] audio_event broadcast 21:12:48.771 #82 Zones|Manager [activeOutput=squeezelite targetCount=1 zoneId=5] dispatch output metadata 21:12:48.772 #84 Zones|Manager [reason="https://audio.radioparadise.stream/audio/blocks/2/x/1127/4/g/1127-2.flac?src=alexa stream failed: [out#0/flac @ 0xc3883f0] video:0KiB audio:20468KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.040125% size= 20476KiB time=00:02:53.00 bitrate= 969.6kbits/s speed= 1x" source=output title="Playback unavailable" zoneId=5] playback error

fixed in next beta

rudyberends avatar Aug 12 '26 18:08 rudyberends