External integration - DLNA

Hi everyone! :waving_hand:

The biggest missing feature from @pierre-gilles’ list, over 28% of Home Assistant installations: DLNA! One integration for both roles: players (TVs, amps, speakers) and media servers (Plex, Jellyfin, Emby, minidlna, Synology…). All local :television:

What it does

  • :magnifying_glass_tilted_left: Your DLNA players found automatically in the Discovery tab, even when the player is hidden inside a larger device (this is the case for Denon / HEOS amps).
  • :play_button: Play, pause, stop, previous, next, volume, mute, and “currently playing”, compatible with the Music widget on the dashboard.
  • :bell: The “Broadcast a notification” action works on these players: Gladys can speak through your amp or TV.
  • :musical_note: Scenes “Play a media from a server”: a title, an artist, an album, or a folder from your DLNA server, in order, randomly, or just the first result. And “Play a URL”, perfect for a web radio.
  • :clapper_board: Triggers “play started / paused / stopped”, filterable by player.
  • :bar_chart: A DLNA Player widget: title, state, volume in real-time, and controls.

The cool part

7 a.m. on weekdays → morning web radio on the living room amp :hot_beverage:
Someone rings → Gladys announces it on the TV :bell:
Play started on the TV → dimmed lights :popcorn:

Installation

:warning: Gladys 5.1 minimum.

:light_bulb: It will be available in the store later today. In a hurry? Integrations → Install from GitHub, with the address GitHub - guim31/gladys-dlna: DLNA / UPnP media renderers and servers, local control, for Gladys Assistant · GitHub

  1. In Gladys: Integrations → DLNA → Install.
  2. Discovery tab: your players and servers appear. Otherwise, enter the address of their description in the configuration.
  3. To play from a server, the DLNA server must be enabled (in Plex: Settings → DLNA).

Honest small reservations: the state is updated regularly (a few seconds of possible delay), no cover art for now, and the original playback does not resume after an announcement. If your player is a Sonos, a Samsung, or an LG, their dedicated integrations go further: DLNA is there for everything else.

And this one, I tested it in real life on my Denon AVR-S650H amp: web radio playback, pause, resume, volume, mute, stop, and browsing of its built-in server :white_check_mark: The test even revealed a trap: since yesterday, the amp takes nearly a minute to accept playback. The integration waits and retries the command on its own, until it wakes up.

Like the previous ones, it is developed with Claude Code :robot:. Independent project, not affiliated with DLNA or manufacturers.

Repository: GitHub - guim31/gladys-dlna: DLNA / UPnP media renderers and servers, local control, for Gladys Assistant · GitHub

Let me know on which devices it works for you :folded_hands:

Hi Guim31,

First of all, sorry that I didn’t recognize you right away in the Roborock discussion… but once I could assign you, I had to test your DLNA integration right away:

1.)

Without any effort, just by installing the integration… it automatically detects my Sennheiser Ambeo soundbar…

2.) Set up a widget on Gladys Assistant and … since the soundbar was already playing … I could only test louder and quieter, result: Flawless

Cool !

Thanks for your feedback !! :+1:

Well… I didn’t even know my Sennheiser soundbar came with a DLNA server… again: Congratulations, well done

Take a closer look :wink:

Guim31 board !! :stuck_out_tongue:

and while we’re at it, for your documentation. If the DLNA server can access/play a Spotify Free account, then Spotify Free can be controlled via your integration. The other Spotify integration requires a Spotify subscription.

Yours does not:

@ruegerth Thanks Tom, second real device validated thanks to you :raising_hands: Found it on my own and volume responding: this is exactly the expected behavior.

And well spotted for Spotify! I’ve added it to the documentation, with a small nuance:

  • :speaker_high_volume: Volume and mute are those of the soundbar itself, so they are adjusted from Gladys regardless of the source: Spotify (including free account), AirPlay, HDMI input…
  • :play_or_pause_button: Status, title, and play/pause/next, on the other hand, only follow what is playing via DLNA. That’s why your widget displays « Stopped » while Spotify is playing.

If you have two minutes, I’m curious: during a Spotify playback, do Pause or Next from the widget do anything on your AMBEO? On most devices, it shouldn’t do anything, but some are surprising :wink:

Here is the Ambeo:

Stop - no reaction
Loud - OK
Quiet - OK
While the Ambeo Soundbar is running - Play: The action failed. — Play failed: 701 Transition not available

Ambeo Soundbar set to Pause - Play: Play failed: 701 Transition not available

Background:
The Ambeo Soundbar offers various inputs, one of which is set to Spotify Free. As soon as I select this input… Spotify starts playing

@ruegerth thanks for the test, it’s super clear :+1:

This confirms the documentation: volume OK regardless of the source, but Play / Stop only apply to what’s playing via DLNA. The « 701 Transition not available » is the soundbar basically saying: « I have nothing to play via DLNA, I’m on another input ». It’s right, but the raw message isn’t very clear :sweat_smile:

The next version will replace this code with a real message (« the player is playing another source: Spotify, AirPlay, HDMI… ») and will avoid insisting when there’s nothing to play. I’ll let you know as soon as it’s out.

Should I test the following: Smartphone - Bluetooth - Soundbar - your integration?
This probably won’t change the result, as only the access/input changes. Between the soundbar and the integration, nothing changes (presumably) or perhaps it does, since it is a different input?
Or is it too specific? I only know the other DLNA servers you mentioned by name.

@ruegerth no need for Bluetooth, you guessed right: it’s an additional input, like Spotify. Volume control will work, but Play / Stop won’t. That wouldn’t teach us anything new :wink:

The test that would really help me is the opposite: playing something on the soundbar via DLNA, from Gladys. No need for a media server, a web radio is enough:

  1. Create a scene with the action « Play a URL on a DLNA player ».
  2. Choose your AMBEO soundbar and paste, for example, the address of FIP: http://icecast.radiofrance.fr/fip-midfi.mp3
  3. Run the scene.

Then, from the widget: do Pause, Play, and Stop respond? Does the status change to « Playing » and does the title display?

This would validate the entire playback on a second device, in addition to my Denon amplifier. Thanks in advance :folded_hands:

Got it, I’ll do it. It’ll just take a bit, probably this evening, starting now: Grandchild time :slight_smile:

@ruegerth it’s online: DLNA 1.0.4 :tada: (in the store in a few hours)

No more « 701 Transition not available ». When your soundbar is on another input, the widget now says, for Play:

Nothing to play over DLNA: the renderer may be playing another source (Spotify, AirPlay, HDMI input…). Start a media from Gladys, or use the app of that source.

(in English for you: the integration only speaks French and English for now :sweat_smile:)

Same principle for Pause, Next and Previous. And for Stop, instead of a fake « Stopped », the widget warns that no DLNA media is loaded and that you need to stop the source from its app. By the way, the integration no longer insists for 75 seconds when there’s nothing to play.

Thanks again for the tests, and if you try the FIP web radio, I’m interested in the result :folded_hands:

and here we go:

Scene created and started directly under Scenes.

Result:

Ambeo Soundbar switches to UPNP.

Gladys then displays:

All buttons shown there: Pause, Stop, Volume - and Volume + work.
When I click Stop, the soundbar turns off completely. A new Play then takes 2 - 3 seconds … but the station starts again.

Congratulations

Now only a selection field with, for example, five preset web radio stations is missing in the configuration area, and somewhere in the widget a selection option… wouldn’t there be the four-button limitation

… I’ll just let this run for now … improving my French on the side :joy:

I learned German in school... but I forgot everything!!

@ruegerth super, thanks for testing the web radio! So everything works in DLNA on your soundbar, including Stop (even if it chooses to turn off :grinning_face_with_smiling_eyes:).

And your suggestion is already there: DLNA 1.1.0 (in the store in a few hours).

  • :star: Favorites: up to 8 in the configuration. Each can be a web radio (URL) or content from your media server (album, playlist, folder, search).
  • :puzzle_piece: New « DLNA Favorites » widget: you choose the soundbar and up to 4 favorites, one button each, and it displays the one that is playing. To have more, you place two.
  • :clapper_board: Scene action « Play a DLNA Favorite », with an optional volume.
  • :radio: The station name is displayed instead of the URL when the radio provides it. Radio France only sends a filename (« fip-midfi.mp3 »), but most radios give their real name.
  • :germany: And the integration speaks German now :wink:

Like this?

Congratulations. ( France Webradio is my saved favorite in the config )

Super fast and very good work

I’ll test the scene tomorrow

Regards
Tom

P.S: In the Sennheiser manufacturer app, UPnP and « France Webradio Â» are now displayed