Integración domótica DLNA, gratuita y de código abierto

Controle sus reproductores DLNA/UPnP (TV, amplificador, altavoz) y sus servidores, 100 % local.
La documentación de esta integración la escribe su autor y, por ahora, solo está disponible en inglés.
Control the DLNA / UPnP renderers of your home (TV, amplifier, speaker, streamer) and play the content of your media servers (Plex, Jellyfin, Emby, MiniDLNA, a NAS…) from Gladys. Everything stays on your local network: no account, no cloud.
Requirements
- Gladys 5.1.0 or later.
- The renderers and servers on the same network as Gladys. A device on another network (VLAN, other subnet) can be added by hand, see below.
- On a renderer, DLNA must be enabled: it is sometimes called "DLNA", "UPnP", "Media renderer", "Play to" or "AllShare" in its settings, and some TVs only answer when they are on (not in standby).
Adding your devices
- Install the integration, then open its Discovery tab: Gladys searches the network and lists the renderers and the media servers it found. Run the search again with the button if a device is missing (a TV must be on).
- Add the devices you want. A renderer gets the playback commands; a media server gets no feature, but it then appears in the scene actions.
- Some devices are both: a Denon amplifier, for instance, is a renderer and a small media server. The server is then listed with "(media server)" after its name.
Language of names and messages (English, French, German or Spanish): Gladys keeps the names of a device once it is added, so pick the language in Configuration before adding the devices. It is also the language of the error messages of device commands and scene actions (Gladys does not tell an integration the language of its user).
A device that is not found: SSDP discovery only works on the network of Gladys. Find the URL
of the UPnP description of the device (in the documentation of the device or the server: MiniDLNA serves
http://<address>:8200/rootDesc.xml, a Denon/HEOS amplifier
http://<address>:60006/upnp/desc/aios_device/aios_device.xml). Check it with the Test a
description URL action, then add it to Description URLs in the configuration and run the
search again.
The renderer device
| Feature | What it does |
|---|---|
| Play, Pause | Starts or resumes, pauses (stops when the renderer cannot pause) |
| Stop | Stops the playback |
| Previous, Next | Previous or next track (of the queue, see below) |
| Volume | 0 to 100 %, mapped to the range the renderer declares |
| Mute | Toggles mute |
| Playback state | 1 while playing, 0 otherwise (paused, stopped, off) |
| Now playing | "Artist — Title" as the renderer describes it, "—" when nothing |
| Notification | Used by the core "Play a notification" scene action |
Volume and Mute only appear when the renderer has them. The device works with the core Music widget of the dashboard (previous, play/pause, next, volume).
What the device plays some other way (Spotify Connect, AirPlay, Chromecast, an HDMI input…): volume and mute are the device's own, so Gladys sets them whatever the source. For example, a soundbar playing Spotify, even on a free account, has its volume controlled from Gladys (seen on a Sennheiser AMBEO Soundbar). The playback state, the now-playing title and the transport commands, on the other hand, only follow what is played over DLNA: during a Spotify session, the device shows "stopped".
The state is refreshed every few seconds while playing, every 15 seconds otherwise. A renderer that is off shows the unreachable badge and is checked once a minute; when it comes back on another address, the integration finds it again by itself (a network search, at most every 5 minutes).
Scenes
Triggers
- DLNA playback started, DLNA playback paused, DLNA playback stopped: pick a renderer,
or leave it empty for any. The following actions can use
{{triggerEvent.data.renderer}},{{triggerEvent.data.title}},{{triggerEvent.data.artist}}and{{triggerEvent.data.album}}. Typical use: dim the lights when the TV starts playing a film, turn them back on when it stops. A renderer that is switched off fires nothing (it is not a "stop"), and neither does the short gap between two tracks of a queue.
Actions
-
Play a media server on a DLNA renderer: pick the renderer and the server, then what to search:
- Anything: titles, artists and albums containing the text, then a folder of that name;
- Title, Artist, Album (an album plays in track order);
- Folder: a folder name (
Jazz), or a path from the root of the server (Music/Jazz). The tracks of its sub-folders are included. Use the Browse a media server action of the configuration to find the paths.
Then choose to play everything in order, everything shuffled, or the first result only, and optionally a volume. A search that takes more than 75 seconds (a huge library on a server that cannot search) stops with an error: give a narrower one, such as a folder path. The action returns whether something was found, the number of tracks queued and the first title, for the following actions.
-
Play a URL on a DLNA renderer: a web radio, a sound or an announcement file, by its http(s) URL, with an optional title and volume. The URL must be reachable by the renderer itself. Left empty, the title is the name the web radio gives itself (its
icy-nameheader, or else the title on air when the stream starts), and the URL as a last resort: the integration asks the stream once, for at most 2.5 seconds, without downloading it. -
Play a DLNA favorite: plays one of the favorites of the configuration (see below) on a renderer, with an optional volume. It returns whether it started and the name of the favorite.
Queue: a DLNA renderer plays one media at a time. For an album or a folder, the integration keeps the list and hands the tracks over one after the other (without a gap when the renderer supports it). Next and Previous walk the list. The queue stops when something else is played on the renderer, and it only advances while Gladys and the integration run.
Announcements: the core Play a notification action works on the renderers (it needs Gladys Plus for the text-to-speech). It plays at the current volume (the core does not pass its volume to the integrations), and the previous media is not resumed afterwards. To set the volume of an announcement, place a device control action on its Volume feature before it.
Favorites
In Configuration, the Favorites part holds up to 8 favorites, each one a numbered group of fields:
- Name: shown on the button (24 characters fit). Left empty, the favorite is named after the host of its URL or after its search.
- URL: a web radio or a file, by its http(s) URL; or a search on a media server: the
name of the server as it appears in Gladys (part of it is enough; empty when only one server is
added), what to search by (anything, title, artist, album, folder or playlist), the search
(
Abbey Road,Music/Jazz), and how to play what is found (in order, shuffled, the first result). When both are filled, the URL wins. A favorite with neither is ignored.
The server is named rather than picked in a list on purpose: Gladys refuses to save a configuration whose list holds a device that no longer exists, and a deleted server would block every later change of the configuration.
Dashboard
Add the DLNA player widget and pick a renderer in its settings: it shows the title, the album, the state, the queue position, mute, a live volume gauge, and four buttons (play/pause, stop, volume − and +, by steps of 5 %).
Add the DLNA favorites widget, pick a renderer and the favorites to show: one button per favorite, four at most per widget (Gladys allows four buttons in a widget). Add several widgets to reach more favorites. Left empty, the widget shows the first four favorites of the configuration. It also shows the favorite the renderer holds now, with its state, and marks its button with a check: it stays until something else is played on the renderer.
Configuration actions
- Test a description URL: reads a description URL and tells what it holds.
- Browse a media server: lists the folders and tracks of a server, from the root or from a
path (
Music/Albums).
Sonos, Samsung, LG
Sonos speakers, Samsung TVs and LG webOS TVs have their own Gladys integrations, which do more than DLNA (groups, sources, applications). This integration still sees them when they offer DLNA: it is useful to play media from a server or announcements, next to their own integration.
What has been checked on real hardware
- Checked for real on a Denon AVR-S650H (playback, pause, volume, mute, stop, browsing of the built-in server): an http stream plays, the position advances, pause and resume work, the volume set in Gladys is the volume of the amplifier (15 in Gladys is MV15), mute is set and read back, stop stops, and the built-in media server is browsed. The amplifier wakes from standby by itself on a command. Its description, service descriptions and state answers are replayed by the tests.
- A renderer in standby can take up to a minute to start: measured on the Denon, it accepts the media and the Play command, gives no usable answer for about 12 seconds while it wakes up, then stays stopped and ignores Play for about 40 more seconds before it starts. The integration therefore follows every start for up to 75 seconds, in the background: it waits while the renderer does not answer, presses Play again every 5 seconds while it is stopped (and loads the media again if needed), restarts once a playback cut right after it started, and stops following as soon as another command or media comes in. Scene actions answer as soon as the renderer accepted the command; a start that never comes is written in the logs of the integration. https streams play like http ones.
- Checked by a user on a Sennheiser AMBEO Soundbar: found by itself at install time, volume set from the widget, including during a Spotify Connect session.
- Not checked on real hardware yet: the play queue and its gapless transitions, the network search run by Gladys, searching a real media server (MiniDLNA, Plex, Jellyfin), the favorites and their widget, and the station name read from a real web radio. They are covered by tests on simulated devices built from public formats. Please report any device that misbehaves, with the logs of the integration.
Troubleshooting
- Nothing in the Discovery tab: check that the devices are on and on the same network as
Gladys; read the logs of the integration (
Discovery: N SSDP answer(s)…). Add a description URL by hand otherwise. - "Nothing to play over DLNA" (or nothing to pause, stop, no next track): the renderer has no
DLNA media loaded, and may be playing another source (Spotify, AirPlay, an HDMI input…). Start a
media from Gladys, or use the app of that source. Stop is still sent, since some devices stop the
other source too. The logs of the integration keep the UPnP code the renderer answered (for
instance
Play failed: 701 Transition not available). - Another refusal reads as its meaning (format not accepted, media not reachable, renderer in standby or busy…); its UPnP code is in the logs of the integration. The message follows the language of the configuration, except on the widget buttons for "nothing over DLNA", shown in the language of the user.
- A web radio shows its URL instead of its name: the stream does not give a name (no
icy-nameheader), or did not answer within 2.5 seconds. Fill the title of the scene action, or make it a favorite with a name. - A file or a radio does not play: the renderer must support its format, and reach its URL itself. A renderer in standby may take about ten seconds to start: the integration waits for it.
Parámetros de configuración
Estos son los parámetros que DLNA te pide en su pantalla de configuración en Gladys.
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| Encontrar sus dispositivos | section | No | Los reproductores y servidores multimedia de su red se encuentran automáticamente: abra la pestaña Descubrir y añada los que quiera. Un dispositivo de otra red (VLAN, otra subred) se añade abajo mediante la URL de su descripción UPnP. |
| URL de descripción (opcional) | string | No | Una o varias URL de descripción UPnP, separadas por comas. Pruebe primero una con la acción de abajo. |
| Idioma de los nombres y mensajes | select | No | Nombres de las funciones de los dispositivos añadidos a partir de ahora (Gladys los conserva una vez añadido el dispositivo) y mensajes de error de comandos y escenas. |
| Favoritos | section | No | Hasta 8 medios para iniciar con un toque desde el widget «Favoritos DLNA» o la acción de escena «Reproducir un favorito DLNA». Cada favorito es una URL (radio web, archivo) o una búsqueda en un servidor multimedia: rellene una u otra. Un favorito sin ninguna de las dos se ignora. |
| Favorito 1 | section | No | |
| Nombre (en el botón) | string | No | |
| URL (radio web, archivo) | string | No | |
| O un servidor multimedia (su nombre en Gladys) | string | No | Vacío: el único servidor multimedia añadido a Gladys. |
| Buscar por | select | No | |
| Búsqueda en el servidor | string | No | |
| Reproducción | select | No | |
| Favorito 2 | section | No | |
| Nombre (en el botón) | string | No | |
| URL (radio web, archivo) | string | No | |
| O un servidor multimedia (su nombre en Gladys) | string | No | Vacío: el único servidor multimedia añadido a Gladys. |
| Buscar por | select | No | |
| Búsqueda en el servidor | string | No | |
| Reproducción | select | No | |
| Favorito 3 | section | No | |
| Nombre (en el botón) | string | No | |
| URL (radio web, archivo) | string | No | |
| O un servidor multimedia (su nombre en Gladys) | string | No | Vacío: el único servidor multimedia añadido a Gladys. |
| Buscar por | select | No | |
| Búsqueda en el servidor | string | No | |
| Reproducción | select | No | |
| Favorito 4 | section | No | |
| Nombre (en el botón) | string | No | |
| URL (radio web, archivo) | string | No | |
| O un servidor multimedia (su nombre en Gladys) | string | No | Vacío: el único servidor multimedia añadido a Gladys. |
| Buscar por | select | No | |
| Búsqueda en el servidor | string | No | |
| Reproducción | select | No | |
| Favorito 5 | section | No | |
| Nombre (en el botón) | string | No | |
| URL (radio web, archivo) | string | No | |
| O un servidor multimedia (su nombre en Gladys) | string | No | Vacío: el único servidor multimedia añadido a Gladys. |
| Buscar por | select | No | |
| Búsqueda en el servidor | string | No | |
| Reproducción | select | No | |
| Favorito 6 | section | No | |
| Nombre (en el botón) | string | No | |
| URL (radio web, archivo) | string | No | |
| O un servidor multimedia (su nombre en Gladys) | string | No | Vacío: el único servidor multimedia añadido a Gladys. |
| Buscar por | select | No | |
| Búsqueda en el servidor | string | No | |
| Reproducción | select | No | |
| Favorito 7 | section | No | |
| Nombre (en el botón) | string | No | |
| URL (radio web, archivo) | string | No | |
| O un servidor multimedia (su nombre en Gladys) | string | No | Vacío: el único servidor multimedia añadido a Gladys. |
| Buscar por | select | No | |
| Búsqueda en el servidor | string | No | |
| Reproducción | select | No | |
| Favorito 8 | section | No | |
| Nombre (en el botón) | string | No | |
| URL (radio web, archivo) | string | No | |
| O un servidor multimedia (su nombre en Gladys) | string | No | Vacío: el único servidor multimedia añadido a Gladys. |
| Buscar por | select | No | |
| Búsqueda en el servidor | string | No | |
| Reproducción | select | No |
Cómo instalar DLNA en Gladys
- En Gladys, abre Integraciones: DLNA aparece en el catálogo junto a las integraciones nativas, con una insignia de comunidad.
- Haz clic en Instalar. Gladys descarga la imagen Docker (
ghcr.io/guim31/gladys-dlna:1.1.0), la ejecuta en un entorno aislado del núcleo y genera la interfaz de la integración (dispositivos, descubrimiento y configuración). - Abre la pantalla de Configuración de la integración, rellena los parámetros y guarda.
- También puedes instalarla directamente desde la URL de su repositorio: https://github.com/guim31/gladys-dlna.
DLNA requiere Gladys >=5.1.0. El catálogo de Gladys se actualiza cada hora, así que una nueva versión está disponible como máximo una hora después de publicarse.
¿Todavía no usas Gladys? Es gratuito y de código abierto: sigue la guía de instalación para empezar.
Sobre las integraciones externas
DLNA es una integración externa: una integración comunitaria empaquetada como contenedor Docker y publicada en GitHub. Gladys la instala con un clic y la ejecuta en un entorno aislado del núcleo. La publica y mantiene guim31, no el equipo principal de Gladys.
- Explorar todas las integraciones externas
- Descubrir las integraciones nativas incluidas en Gladys
- Crear y publicar tu propia integración externa
- Código fuente en GitHub — fuente de esta documentación