Android TV Remote

The Android TV Remote integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] allows you to control an Android TV and launching apps. For this to work, the Android TV device needs to have Android TV Remote Service which is pre-installed on most devices (Fire TV devices are a notable exception).

For a quick introduction on how to get started with Android TV Remote, check out this video:

Configuration

To add the Android TV Remote integration to your Home Assistant instance, use this My button:

Android TV Remote can be auto-discovered by Home Assistant. If an instance was found, it will be shown as Discovered. You can then set it up right away.

Options

Options for Android TV Remote can be set via the user interface, by taking the following steps:

  • Browse to your Home Assistant instance.
  • Go to Settings > Devices & Services.
  • If multiple instances of Android TV Remote are configured, choose the instance you want to configure.
  • Select the integration, then select Configure.
Configure Applications List

Here you can define applications where the keys are app IDs and the values are app names and icons that will be displayed in the UI.

Media player

This integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] adds a media_player with basic playback and volume controls. The media player provides volume information and display name of current active app on the Android TV. Due to API limitations, the integration will not display the playback status. It is recommended to use this integration together with Google Cast integration. Two media players can be combined into one using the Universal Media Player integration. See Using with Google Cast section for more details.

Using the media_player.play_media serviceA service carries out one specific task, for example: turn on the light in the living room. A service has targets and data and can be called by actions, a dashboard, or via voice command. [Learn more], you can launch applications, switch channels, and start activities via Deep Links. Only app, url and channel media types are supported.

Launching apps

If the Android TV device has the Google Play Store, you can directly launch any app by its application ID (package name). The app doesn’t need to exist in the Google Play Store. If it exists, you can find the application ID in the URL of the app’s Google Play Store listing. For example, if the URL of an app page is play.google.com/store/apps/details?id=com.example.app123, the application ID is com.example.app123. The application ID is also displayed in the media player card when you launch the application on the device.

Examples of application IDs for popular applications:

App App ID
YouTube com.google.android.youtube.tv
Netflix com.netflix.ninja
Prime Video com.amazon.amazonvideo.livingroom
Disney+ com.disney.disneyplus
Plex com.plexapp.android
Kodi org.xbmc.kodi
Twitch tv.twitch.android.app

Example:

# Launch the YouTube app
service: media_player.play_media
data:
  media_content_type: app
  media_content_id: com.google.android.youtube.tv
target:
  entity_id: media_player.living_room_tv

Launching activities

Alternatively, if the device doesn’t have the Google Play Store or if you want to open specific activity in the app, you can pass deep links supported by some applications.

Examples of deep links for popular applications:

App Deep link
YouTube https://www.youtube.com or vnd.youtube:// or vnd.youtube.launch://
Netflix https://www.netflix.com/title or netflix://
Prime Video https://app.primevideo.com
Disney+ https://www.disneyplus.com
Plex plex://
Twitch twitch://home [home, stream, game, video, clip, search, browse, channel, user]

Example:

# Open a specific YouTube video:
service: media_player.play_media
data:
  media_content_type: url
  media_content_id: https://www.youtube.com/watch?v=dQw4w9WgXcQ
target:
  entity_id: media_player.living_room_tv

Switch channels

You can pass the channel number to switch channels. The channel number must be an integer.

Example:

# Change channel to number 15:
service: media_player.play_media
data:
  media_content_type: channel
  media_content_id: 15
target:
  entity_id: media_player.living_room_tv

Using with Google Cast

Android TV Remote integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] provides information about the power status of the device and gives you the ability to control playback. However, it does not provide information about the currently playing content (media title, duration, play/pause state, etc.). In turn, Google Cast integration does not provide reliable information about the power status of the device (e.g. on Android TV Home Screen) and does not allow to control playback in Android apps without MediaSession support. However, it can display full information about the content being played in supported apps. For convenience, you can combine two media players into one using Universal Media Player integration. Universal Media Player will automatically select the appropriate active media player entity.

Remote

The remote allows you to send key commands to your Android TV device with the remote.send_command service. The entity has the current_activity attribute that shows the current foreground app on the Android TV. You can pass the application ID shown in this current_activity as activity in the remote.turn_on service to launch that app.

If activity is specified in remote.turn_on it will open the specified URL or the application with the given package name. See Launching apps section.

Examples of service calls:

# Open the currently selected item on the Android TV
service: remote.send_command
data:
  command: DPAD_CENTER
target:
  entity_id: remote.living_room_tv
# Long press on the currently selected item on the Android TV
service: remote.send_command
data:
  command: DPAD_CENTER
  hold_secs: 0.5
target:
  entity_id: remote.living_room_tv
# Launch YouTube
service: remote.turn_on
data:
  activity: https://www.youtube.com
target:
  entity_id: remote.living_room_tv
# Open a specific YouTube video:
service: remote.turn_on
data:
  activity: https://www.youtube.com/watch?v=dQw4w9WgXcQ
target:
  entity_id: remote.living_room_tv

Dashboard example

You have to manually create buttons in Lovelace to send commands to the Android TV device or launch apps on it.

Below is an example for you to start with. Many of the buttons support long press.

Screenshot Android TV Remote example

Limitations and known issues

  • The integration doesn’t work with Fire TV devices because they are missing the Android TV Remote Service. Attempts to sideload it haven’t been successful.
  • If you cannot use the Google TV mobile app or the Google Home mobile app to send commands to the device, you cannot send commands with this integration either.
  • Commands don’t work on Netflix. They don’t work from the Google TV mobile app or the Google Home mobile app either.
  • Some devices, like Xiaomi, become unavailable after they are turned off and can’t be turned on with this integration.
  • Some devices, like TCL, become unavailable after they are turned off, unless you activate the Screenless service. To activate it, go to Settings > System > Power and energy > Screenless service, and activate it.
  • Some devices experience disconnects every 15 seconds. This is typically resolved by rebooting the Android TV device after the initial setup of the integration.
  • If you are not able to connect to the Android TV device, or are asked to pair it again and again, try force-stopping the Android TV Remote Service and clearing its storage. On the Android TV device, go to Settings > Apps > Show system apps. Then, select Android TV Remote Service > Storage > Clear storage. You will have to pair again.
  • Some onscreen keyboards enabled by TV manufacturers do not support concurrent virtual and onscreen keyboard use. This presents whenever a text field is selected, such as “search” where a constant use the keyboard on your mobile device will show, preventing you from opening the onscreen keyboard to type. This can be overcome by either disabling your 3rd party keyboard and using the default Gboard keyboard or by deselecting Enable IME in the Configure page of the integration.