Project: control an Android TV from Home Assistant: pairing, deep links, remote keys and the ADB route

Discuss Android TV Development and Smart Home Integrations
Post Reply
User avatar
ZerOne
Site Admin
Posts: 292
Joined: Sun Dec 13, 2020 8:21 am

A practical project for adding an Android TV or Google TV to Home Assistant, launching apps with deep links and sending remote keys. It follows the Home Assistant Android TV Remote and Android Debug Bridge docs as at October 2026. I have not run this on a particular TV, so test each step and check the docs for your version.

Safety: put the TV on an IoT VLAN with a DHCP reservation, let only Home Assistant reach it, and do not expose it to the internet. Do not leave a remote entity on a dashboard that guests can use.

Step 1: add the TV

Android TV Remote can be auto-discovered. Go to Settings > Devices & services, look for the discovered TV, or choose Add Integration > Android TV Remote and follow the on-screen steps, including any confirmation the TV asks for. If it is not found, check that Home Assistant and the TV are on the same network or that discovery traffic is allowed between them.

Step 2: launch an app or a video with a deep link

The docs say the most reliable way to launch an app or open a specific screen is a deep link the app supports. Examples they list include https://www.youtube.com or vnd.youtube:// for YouTube, plex:// for Plex, and a Netflix title link ending in ?source=30 (without it the app just opens or resumes). Launching by application ID currently does not work reliably for many apps because of a Google Play Store change, so use a deep link where you can.

Code: Select all

action: media_player.play_media
target:
  entity_id: media_player.living_room_tv
data:
  media_content_type: url
  media_content_id: https://www.youtube.com/watch?v=VIDEO_ID
Replace VIDEO_ID and the entity ID with your own. You can also launch an app with the remote entity's activity option:

Code: Select all

action: remote.turn_on
target:
  entity_id: remote.living_room_tv
data:
  activity: "https://www.youtube.com"
Step 3: send remote keys

The remote entity sends key commands with remote.send_command. The docs list navigation keys such as DPAD_UP, DPAD_DOWN, DPAD_LEFT, DPAD_RIGHT and DPAD_CENTER. They warn that commands are sent to the device as they are, so some keys may do nothing or something unexpected.

Code: Select all

action: remote.send_command
target:
  entity_id: remote.living_room_tv
data:
  command: DPAD_CENTER
Use hold_secs for a long press. Start with harmless keys (volume, navigation) and test them one at a time. Avoid automations that press keys blindly, since TV menus change between app updates.

Step 4: add Cast for now-playing info (optional)

The docs say Cast gives rich information about content in supported apps but is not reliable for power state, and the Remote integration does the opposite. They describe combining them with a universal media player. Do that if you want one card with both.

Step 5: Fire TV or no remote service: use ADB

Turn on ADB debugging on the device (on a Fire TV: My Fire TV > Developer Options > ADB Debugging; if Developer Options is missing, the docs say to press the button on About seven times). Then add the Android Debug Bridge integration with the TV's IP address. The docs recommend using the built-in Python ADB implementation and not an ADB server, unless you have stability problems. Because ADB is powerful, turn debugging off again if you stop using it.

Troubleshooting ideas
  • TV shows unavailable when asleep: check the TV's network standby settings, prefer Ethernet, and see the TV's Wake-on-LAN options if it has them.
  • App does not launch by ID: use a deep link instead.
  • Key does nothing: the app may not handle that key, so try another.
Discussion: which deep links and key sequences have worked for you, and which apps ignore them?
Post Reply

Return to “Android Smart TV Discussion”