Card Remote - dckiller51/astrion-custom-dashboard GitHub Wiki

Two on-screen remotes: one for an Android / Google TV through Home Assistant, one for an Apple TV, paired directly or through Harmony.


๐Ÿ“บ TV Remote Card (tv_remote)

A D-pad remote for a TV exposed in Home Assistant as a remote.* entity, typically the Android TV Remote integration. Every key calls remote.send_command on that entity.

This card works through Home Assistant only. For an IR or Harmony TV, use a Button grid and the remote's physical keys (Hotkeys).

๐Ÿ“ธ Preview

โœจ Features & Possibilities

  • Header with the TV's name and a power button.
  • D-pad with OK, then Back, Home and Menu.
  • Volume row (since 1.2.9): โˆ’ / mute / +, sent to the TV, or to another remote entity such as your soundbar's (mute_entity). Can be hidden.
  • App buttons, two per row: each launches an app on the TV (media_player.play_media with media_content_type: app) or calls any service you give it.
  • Every command can be renamed with commands, for TVs whose remote entity uses other names.
  • Builder (since 1.2.9): the app buttons are picked from a list of common Android TV apps (or any package name), the commands from the Android TV command list.

โš™๏ธ Options Reference

Parameter Type Default Description
type string โ€” tv_remote
remote_entity string โ€” The remote.* entity. Required.
name string TV Title of the card.
media_entity string media_player.<same name as remote_entity> The TV's media_player, used by the { name, app } buttons. The default is what the Android TV Remote integration creates (1.2.9+).
show_volume bool true The volume row (1.2.9+).
mute_entity string remote_entity The remote.* entity the volume row is sent to, e.g. a soundbar's.
apps list Netflix, YouTube, Prime Video, Plex { "name", "app" } (Android package name), or { "name", "service", "entity_id", "data" }. [] for none.
commands object Android TV names Override a key's command: power, up, down, left, right, center, back, home, menu, volume_up, volume_down, mute. Defaults: POWER, DPAD_UP, DPAD_DOWN, DPAD_LEFT, DPAD_RIGHT, DPAD_CENTER, BACK, HOME, MENU, VOLUME_UP, VOLUME_DOWN, MUTE.

๐Ÿ“„ JSON Configuration Example

{
  "type": "tv_remote",
  "options": {
    "name": "Living room TV",
    "remote_entity": "remote.living_room_tv",
    "mute_entity": "remote.soundbar",
    "apps": [
      { "name": "Netflix", "app": "com.netflix.ninja" },
      { "name": "YouTube", "app": "com.google.android.youtube.tv" },
      { "name": "Plex", "app": "com.plexapp.android" },
      { "name": "Sonos night", "service": "script.sonos_night_mode" }
    ]
  }
}

๐Ÿ’ก Before 1.2.9 the default apps were Netflix, Plex, ABC iView and VLC, and a card without media_entity targeted a fixed entity: set media_entity if your TV's media_player has another name than its remote.


๐ŸŽ Apple TV Remote Card (apple_tv_remote)

An Apple TV remote with a touch-style clickpad, what's playing, and app shortcuts. It drives the Apple TV in one of two ways:

Direct (appleTv) Through Harmony (hub + deviceId)
Setup Pair the Apple TV on the remote (Apple TV) The Apple TV is a device of your Harmony hub
Now playing, artwork, progress โœ… Only if you give a Home Assistant entity
ยฑ10 s on the clickpad, context menu โœ… โ€”
App shortcuts โœ… Only with an entity

๐Ÿ“ธ Preview

โœจ Features & Possibilities

  • Three layouts:
    • Classic (default): a large clickpad, your buttons as pills, a play/pause button, then the apps. No now playing.
    • Compact: what's playing on a one-line strip, the clickpad, one row of round buttons, then the apps. Sized to fit the page.
    • Full: a whole-page remote with artwork, title and progress on top. Under the clickpad, โˆ’10 s / play-pause / +10 s with your first two buttons around them; the next ones (up to 6) go in side columns.
  • Clickpad (direct): tap = select, hold the centre = context menu, hold left / right = โˆ’10 s / +10 s.
  • Now playing (compact and full): artwork and title. In the full layout, drag the progress bar to seek, when the app allows it.
  • Buttons of your choice, see the list below.
  • App shortcuts (needs a media_player, see entity): up to 5 (6 in compact). Each opens an app by its source name; shows its icon, or its initials on a colour. The full layout shows their labels.
  • The builder preview shows the layout you chose (since 1.2.8).

โš™๏ธ Options Reference

Parameter Type Default Description
type string โ€” apple_tv_remote
appleTv string โ€” Direct mode: the paired Apple TV, media_player.appletv_โ€ฆ.
hub string default hub Harmony mode: the hub.
deviceId string โ€” Harmony mode: the Apple TV's Harmony device id.
entity string appleTv media_player used for now playing and apps. In Harmony mode, set it to the Apple TV's Home Assistant entity to get them.
layout string classic classic, compact or full.
showArtwork bool true Show the artwork.
showProgress bool true Show the progress bar.
showSkip bool true ยฑ10 s buttons and clickpad holds. Direct mode only.
buttons list see below Ids of the buttons to show, in order.
apps list โ€” { "source", "label", "icon", "color" }. source is the app name exactly as the Apple TV lists it (its source list).

Button ids: Menu, Home, SeekBackward, SeekForward, Rewind, FastForward, Previous, Next, Siri, Screensaver, Guide, VolumeUp, VolumeDown, ControlCenter.

Default buttons: Menu, Home (classic and full) ยท Menu, SeekBackward, SeekForward, Home (compact).

๐Ÿ“„ JSON Configuration Example

Direct, full page:

{
  "name": "Apple TV",
  "cards": [
    {
      "type": "apple_tv_remote",
      "options": {
        "appleTv": "media_player.appletv_living_room",
        "layout": "full",
        "buttons": ["Menu", "Home", "Siri", "ControlCenter", "Previous", "Next"],
        "apps": [
          { "source": "Netflix", "icon": "/sdcard/astrion/icons/netflix.png" },
          { "source": "YouTube", "color": "#FFCC0000" },
          { "source": "Disney+", "label": "Disney" },
          { "source": "Infuse 7", "label": "Infuse" }
        ]
      }
    }
  ]
}

Through Harmony, compact, with now playing from Home Assistant:

{
  "type": "apple_tv_remote",
  "options": {
    "hub": "salon_hub",
    "deviceId": "62845790",
    "entity": "media_player.living_room_apple_tv",
    "layout": "compact"
  }
}

๐Ÿ’ก Bind the remote's physical D-pad, OK and Back keys to the Apple TV in Hotkeys, so you don't have to look at the screen.

See also: Apple TV ยท Harmony ยท Card Media player