Saltar al contenido principal

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

Integración Channels DVR para Gladys Assistant

Channels DVR Server recordings and disk, and control of the Channels apps (play, pause, channel).

info

La documentación de esta integración la escribe su autor y, por ahora, solo está disponible en inglés.

Follow your Channels DVR Server (recordings in progress and upcoming, space of the recordings disk) and drive the Channels apps of your TVs (pause, resume, stop, mute, channel) from Gladys, on the local network.

Unofficial integration, not affiliated with Fancy Bits (Channels). It has never been tested with a real Channels setup: it is written from the official documentation of the Server API and of the Client API, and tested against simulated servers. Reports are welcome.

What you need​

  • Channels DVR Server on your network (port 8089), and/or the Channels app on an Apple TV, Fire TV or Android TV device (its API listens on port 57000).
  • No account, no password: Channels asks for none on the local network. Both APIs are plain http; this integration talks to them on your local network only.
  • Channels and its DVR service are officially available in the United States, Canada and the United Kingdom.

Configuration​

  • Channels DVR Server address: 192.168.1.3 or http://192.168.1.3:8089 (8089 when no port is typed). https, a path or credentials are refused. Leave it empty to follow only players.
  • Channels apps (players): the addresses of the devices running the app, separated by commas, 57000 by default, a name before an equals sign if you want one: Living room=192.168.1.20, Bedroom=192.168.1.21. Ten at most.
  • Refresh interval: 15 s to 5 min (30 s by default).

A player is known by its address: the Channels app gives no serial number nor any other identifier. Reserve its IP in your router; a new address creates a new device in Gladys (the old one stays, without values).

Devices​

Channels DVR (read only):

FeatureValue
Recordings in progressjobs whose time window holds the time of the server, neither skipped nor failed
Upcoming recordingsjobs starting later, not skipped
Recording nownames of the recordings in progress, — when none
Next recordingname of the next recording, — when none
Disk free / Disk usedGB (10^9 bytes), read every 5 minutes

The time of the server decides what is recording (its Date header), not the clock of Gladys. An answer without that header leaves the counts unknown. The disk comes from /dvr, a route outside the documented Server API: if it does not answer, the disk stays unknown and the recordings are read anyway.

Each player:

FeatureValue
Playbackplaying, paused, idle; write 0 pause, 1 resume, 2 stop
Now playingtitle and episode, empty when nothing plays
Mute1 muted; writable
Channelthe channel watched (12.1 for a subchannel); writing it tunes that channel
Channel name— when no channel is watched
Channel up / Channel downpush buttons
App answering1 the app answers on its port, 0 not

On Apple TV the app answers only while it is open and in front; on Android and Fire TV, also in the background once launched. When the port refuses the connection (the app closed), the player shows idle and an empty title. When it does not answer at all within a periodic reading (device asleep, network), only App answering goes to 0: the other values stay as they were, unknown.

Commands​

  • Each command reads the state of the app first, then decides: pausing a paused app or tuning the channel already shown sends nothing; resuming when nothing plays is refused (tune a channel first).
  • A command is answered within about 3.5 s. It succeeds only when the app shows the requested state (in its answer, or in one more reading within that time). Otherwise Gladys gets the error "sent, without confirmation": follow-up readings 1.5 s and 5 s later publish what the app does, and a warning is logged if it never shows it. A command the app refuses (HTTP 4xx) says so; "nothing sent" is said only when no connection was made.
  • Commands to one player go one after the other; two players are driven at the same time. A command waiting past its time is dropped, not sent late.
  • Mute is a toggle in Channels: it is sent only on a state read just before, and a second mute change is refused (for up to 6 s) until the first one is seen applied.
  • Nothing else is ever sent: no recording started or deleted, no settings.

Readings​

  • The periodic readings: each target once per interval, a round at a time. The time of each attempt is written in /data before the reading: a restart, a reconnection to Gladys or the configuration saved again does not read a target sooner than the interval (a new player is read at once). Out of these rounds, a command reads its player just before it (and once more when its answer does not show it applied), then 1.5 s and 5 s later if still not seen.
  • The test button reports the last readings; it reads only the targets that are due.
  • If /data cannot be read, the first readings wait one whole interval and the file is read again every 10 s; it is not written over meanwhile.

Status​

The integration is shown connected while the server or at least one player answers (an app that is closed counts as a normal state: when players refuse the connection, the status says so and suggests an app closed, or a wrong address or port). It says what does not answer and why, and which entries of the configuration were ignored.

Limits​

  • Not tested on real hardware (see above).
  • A pause or a channel change shorter than the interval may be missed by the readings (not by the commands).
  • A channel number a Gladys number cannot write exactly (12.10) is not published as Channel (its name is); tuning 12.1 on it is sent, never taken for done.

Parámetros de configuración​

Estos son los parámetros que Channels DVR te pide en su pantalla de configuración en Gladys.

ParámetroTipoObligatorioDescripción
Channels on your networksectionNoUnofficial integration, not affiliated with Fancy Bits (Channels). It reads your Channels DVR Server (recordings in progress and upcoming, disk space) and drives the Channels apps of your TVs (play, pause, stop, mute, channel), on the local network only: Channels asks for no account nor password there. Fill the server, the players, or both.
Channels DVR Server addressstringNoIP address or host name of the computer running Channels DVR Server, port 8089 by default (http only, local network). Leave empty to follow only players.
Channels apps (players)stringNoAddresses of the devices running the Channels app (Apple TV, Fire TV, Android TV...), port 57000 by default, separated by commas; a name can go before an equals sign. Ten at most. Reserve their IP in your router: the device is keyed by its address. On Apple TV the app answers only while it is open.
Refresh intervalselectNoHow often the server and the players are read (periodic readings), a restart included. A command also reads its player just before.

Cómo instalar Channels DVR en Gladys​

  1. En Gladys, abre Integraciones: Channels DVR aparece en el catálogo junto a las integraciones nativas, con una insignia de comunidad.
  2. Haz clic en Instalar. Gladys descarga la imagen Docker (ghcr.io/lm1lc3n7/gladys-channels-dvr:0.1.1), la ejecuta en un entorno aislado del núcleo y genera la interfaz de la integración (dispositivos, descubrimiento y configuración).
  3. Abre la pantalla de Configuración de la integración, rellena los parámetros y guarda.
  4. También puedes instalarla directamente desde la URL de su repositorio: https://github.com/LM1LC3N7/gladys-channels-dvr.

Channels DVR requiere Gladys >=5.3.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​

Channels DVR 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 LM1LC3N7, no el equipo principal de Gladys.

Suscríbete a la newsletter de Gladys Assistant

Unos pocos correos al mes sobre nuevas versiones y novedades del proyecto. Enviados por Pierre-Gilles Leymarie, fundador del proyecto. Puedes darte de baja cuando quieras 🙂