Saltar al contenido principal

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

Integración Roku para Gladys Assistant

Controle sus reproductores Roku y Roku TV en local: encendido, apps, reproducción, teclas, entradas.

info

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

Control your Roku streaming players (Express, Streaming Stick, Ultra…) and your Roku TVs (TCL, Hisense, onn., Sharp, Philips, Westinghouse, Roku-made TVs…) from Gladys: power, the app on screen, playback, remote keys, volume and inputs, on the dashboard and in your scenes.

Everything stays on your home network: Gladys talks to the Roku with the External Control Protocol (ECP) Roku documents for its devices. No Roku account, no cloud, no API key.

Developed without the hardware: feedback welcome. This integration was built from Roku's documentation and from real answers of Roku devices recorded by other open-source projects, not on a Roku in a living room. If something does not work as described here, please open an issue (see Reporting a problem): it will get fixed fast.

Before you start: allow control from your network​

Recent versions of Roku OS block control from other devices by default. On each Roku:

  1. Press Home on the Roku remote, open Settings > System > Advanced system settings > Control by mobile apps.
  2. Open Network access and choose Enabled.
    • Limited (the default on recent Roku OS versions) only allows launching apps and typing text: the remote keys are refused, and depending on the Roku OS version, so is what Gladys reads.
    • Disabled refuses everything.
    • Permissive works too, but opens the Roku to any device, even outside your network: Enabled is enough for Gladys.

On a Roku TV, also turn on Settings > System > Power > Fast TV start. Without it, a TV in standby goes deaf to the network: Gladys can neither turn it on nor tell that it is off rather than unplugged.

Give each Roku a fixed address in your router (a "DHCP reservation"): Gladys finds a Roku that changed address again, but it takes a scan.

Installation​

  1. Install the Roku integration from the integration store of Gladys.
  2. Open its Discovery tab and run a scan: every Roku on the same network as Gladys answers within a few seconds.
  3. Click Add to Gladys on each Roku you want. Done.

A Roku the scan does not find (another subnet or VLAN, a mesh network that filters discovery…)? In the Configuration tab, type its IP address in Roku addresses (several addresses separated by commas), save, and scan again. The Test the connection to a Roku action takes an address too: it tells you right away whether the Roku answers and accepts control, and adds it to the Discovery tab when it does.

The address of a Roku is shown on the Roku in Settings > Network > About.

What you get​

Each Roku becomes one Gladys device:

FeatureRoku playersRoku TVs
Powerstate (on / standby)on / off, and its state
Applicationthe app on screen, and a list to open another one (or Home)same
Input–HDMI 1-4, antenna (Live TV), AV, or Roku streaming, with the names you gave them on the TV
Playbackplaying or notplaying or not
Remote keysHome, Back, arrows, OK, Options (*), Play/Pause, Rewind, Fast forward, Instant replaysame, plus Volume up, Volume down, Mute, Channel up/down (with a tuner)

States are refreshed every 10 seconds. The list of apps is read again every 15 minutes, and as soon as an app the list did not have comes to the screen.

What a Roku cannot do (and so Gladys neither)​

  • No volume level. Roku's protocol only has the Volume up, Volume down and Mute keys: there is no "set the volume to 20", no way to read the current level, nor to know whether the sound is muted. Gladys offers the keys, and tells nothing it cannot know.
  • Roku players cannot be turned off. A Roku Express, Stick or Ultra has no real power state: Gladys shows whether it is active or in standby, but only a Roku TV can be turned on and off.
  • Turning on a TV in deep standby needs Fast TV start (see above). When the TV does not answer, Gladys sends it a Wake-on-LAN packet first: whether the TV wakes up depends on the model, and works more often over Ethernet than over Wi-Fi.
  • Volume and power keys of a player (Roku Voice Remote buttons that drive your TV through HDMI-CEC or infrared) are not reachable over the network.
  • Typing text goes through a scene only (see Typing a text): no dashboard field can send text to an integration yet.

Dashboard​

Four widgets come with the integration (Gladys 5.1 or later). Each one shows the Roku picked in its settings, or the first one.

  • Roku remote — power and app on screen, then Power (Roku TV) or Play/Pause (player), Home, Back and OK.
  • Roku navigation — the four arrows: Up, Down, Left, Right.
  • Roku playback — the icon and name of the app on screen, playing or paused, the position in the video while one is open, and Play/Pause, Rewind, Fast forward.

Gladys limits a widget to four buttons: place Roku remote and Roku navigation one under the other to get a full remote. Every other key (volume, mute, Instant replay…) is on the device page and in the "Press a Roku remote key" scene action.

In the menus of the apps (a profile, a film, a setting), OK selects. Play/Pause only acts while a video plays, and how depends on the app: in Arte, for instance, Play does not start the film you picked, OK does.

  • Roku apps — four app shortcuts at most per widget, with their icons (a limit of the Gladys dashboard). Left empty, the settings show the first four apps installed; type the names you want in the widget settings (e.g. Disney+, KiKA, YouTube: case and accents do not matter). For more, add a second Roku apps widget with four other names. The app on screen is marked.

Every installed app, without limit, is in the Application feature of the device: add the device to a regular Devices box to pick any app from a list, or use it in a scene with "Set device value" (the TV inputs are in the Input feature of a Roku TV).

The features of the device can also be added to any regular dashboard box.

Scenes​

The integration adds its own cards to the scene editor, under the Integrations category:

  • Roku app changed (trigger) — starts the scene when an app comes to the screen, within about 10 seconds. Optionally pick the Roku and type the app name exactly as the Roku shows it (e.g. Netflix, or Home for the home screen). The next actions can use the app name and its Roku id. Example: when Netflix starts on the living room TV, dim the lights.

  • Open an app on a Roku (action) — opens an installed app by its name. Example: movie night: turn the TV on, open Netflix.

  • Press a Roku remote key (action) — any key, as many times as needed, including Turn on and Turn off for a Roku TV. Example: when the doorbell rings, press Play/Pause.

  • Type a text on a Roku (action) — types a text in the field shown on the Roku, see below.

The power and playback states are regular device features: a scene can start when the TV turns off, or check that something is playing.

Typing a text (search, login)​

Gladys has no text field on the dashboard that an integration can receive yet. The workaround:

  1. On the Roku, open the field (a search, the email of a login…).
  2. In Gladys, create a scene with the Type a text on a Roku action and the text to type (100 characters at most).
  3. Add a Scene box to your dashboard with that scene: one tap types the text.

Do not put a sensitive password in a scene: every Gladys user can read the scenes. The integration never writes the typed text in its logs.

Troubleshooting​

"… refuses remote control" (in the Configuration tab, a widget or an action): the Roku is set to Limited or Disabled. Set **Control by mobile apps

Network access** to Enabled (see Before you start), then run Test the connection to a Roku.

The scan finds nothing. Gladys and the Roku must be on the same network (same subnet, no guest Wi-Fi, no client isolation). Type the address of the Roku in Roku addresses, save, and scan again.

The Roku shows as off while it is on. It does not answer anymore: check its address (it may have changed), then run Test the connection to a Roku.

A Roku TV does not turn on. Turn on Fast TV start on the TV. If it is connected by Wi-Fi, Wake-on-LAN may not reach it while asleep.

An app is missing from the list. The list is read every 15 minutes: wait, or open the app once on the Roku.

Reporting a problem​

  1. In the Configuration tab, turn on Debug logs and save.
  2. Reproduce the problem, then copy the logs of the integration (Integration page > Logs).
  3. Open an issue on github.com/guim31/gladys-roku with the logs, your Roku model and its Roku OS version (Settings > System > About). The logs hold no password; they show the Roku model, its address on your network and its serial number.

Turn the debug logs off afterwards: they are verbose.


Not affiliated with Roku, Inc. Roku is a trademark of Roku, Inc.

Parámetros de configuración​

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

ParámetroTipoObligatorioDescripción
Antes de empezarsectionNoEn cada Roku, abra Configuración > Sistema > Configuración avanzada del sistema > Control por aplicaciones móviles > Acceso a la red (Settings > System > Advanced system settings > Control by mobile apps > Network access) y elija "Habilitado" (Enabled): las versiones recientes de Roku OS lo ponen en "Limitado" (Limited), lo que bloquea a Gladys. Después, inicie una búsqueda de dispositivos (pestaña Descubrir): los Roku de la misma red se encuentran automáticamente. Escriba una dirección abajo solo para un Roku que la búsqueda no encuentre.
Direcciones de los Roku (opcional)stringNoDirecciones IP de los Roku que la búsqueda de dispositivos no encuentra, separadas por comas. Asígneles una dirección fija en su router (reserva DHCP).
Registros de depuraciónbooleanNoEscribe cada solicitud enviada a los Roku y un resumen de sus respuestas en los registros de la integración. Actívelo antes de informar de un problema.

Cómo instalar Roku en Gladys​

  1. En Gladys, abre Integraciones: Roku 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/guim31/gladys-roku: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).
  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/guim31/gladys-roku.

Roku 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​

Roku 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.

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 🙂