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_IDCode: Select all
action: remote.turn_on
target:
entity_id: remote.living_room_tv
data:
activity: "https://www.youtube.com"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_CENTERStep 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.