External integration - Android TV / Fire TV (ADB)

Hi everyone! :waving_hand:

My Android TV Remote integration already does the job of a remote control, but it has two gaps: it doesn’t work on Fire TV, and it doesn’t know which app is on screen or launch any app. At Home Assistant, it’s the other Android TV integration, via ADB, that does that. Here it is for Gladys: Android TV / Fire TV (ADB), the complement to the first one (both can run together).

What it does

  • For Android TV, Google TV, NVIDIA SHIELD, Android boxes, and Amazon Fire TV:
    • power on/off (standby and wake-up);
    • app on screen, and select it from the list to launch it;
    • playback status (play, pause, stop);
    • volume when the device provides it;
    • 18 remote control buttons.
  • Two scene triggers: « App X comes on screen » and « Playback starts / pauses ».
  • Three scene actions: launch an app, send a key, open an address (a YouTube video, a stream).
  • A « ADB Remote » widget: status, current app, playback, volume, and 4 buttons of your choice.
  • In French, English, German, and Spanish.

Deliberately, no free shell command (Home Assistant has one): just fixed and verified commands. Opening the door to any command on the TV from a scene is not for me.

The cool thing

Netflix comes on screen in the evening → the living room lights dim
Playback is paused → lights come back on a bit
8:30 PM → the box wakes up directly on the TV app

Installation

:warning: Gladys 5.1 minimum.

It will arrive in the store at the next indexer run. In the meantime: Integrations → Install from GitHub, with GitHub - guim31/gladys-androidtv-adb: Android TV and Fire TV over ADB for Gladys Assistant: current app, launch apps, keys, power, local · GitHub

  1. On the device, once: Settings → Device Preferences → About, click seven times on Build, then in Developer Options, enable USB Debugging (and Network Debugging on a SHIELD). On Fire TV: My Fire TV → Developer Options → ADB Debugging.
  2. In Gladys: the device’s IP address, then Connect devices.
  3. The TV asks « Allow debugging? »: check « Always allow » and accept.
  4. Discovery tab: add it.

Honest small reservations

  • Tested for playback on my NVIDIA SHIELD: model, screen on, app on screen, volume, and app list work well. The commands and Fire TV, however, have not yet been seen on a real device: your feedback is welcome.
  • The « wireless debugging » with pairing code of Android 11+ is not handled: you need the classic network debugging (port 5555).
  • On a box connected via HDMI, the volume is often that of the TV or amplifier: the box then displays 100 %.

Like the previous ones, developed with Claude Code. Independent project, not affiliated with Google, Amazon, or NVIDIA.

Repository: GitHub - guim31/gladys-androidtv-adb: Android TV and Fire TV over ADB for Gladys Assistant: current app, launch apps, keys, power, local · GitHub

Does the wake-up happen via WoL? :innocent:

No Wake-on-LAN in this one: the wake-up is done via ADB, Gladys sends the wake-up key to the box over the network. It works as long as the device remains reachable in standby, which is the case for most boxes and the SHIELD.

For a TV that cuts its network in deep standby, two options:

  • enable on the TV the option like « Wake-on-LAN » or « Fast Startup », so it remains reachable;
  • otherwise, WoL is in my Ping & Wake-on-LAN integration: in a scene, you wake up the TV with it, then you launch the app with the ADB integration once it responds.

Both can work together, let me know if it works for you :slight_smile: