Android TV Card - Universal Remote with Touchpad, Slider, and Keyboard Support

Sorry super intelligent folks, I am about to ask a really stupid question after going through all the above conversation.

Tried using custom action by pasting the codes directly under the remote control yaml code in the dashboard. Didn’t work. Tried pasting that code in configuration.yaml, says custom action doesn’t exists. Searched under customer components section in Vs Code’s custom components section, couldn’t find any yaml file related to android TV card.

Kindly asking for your generous help.

Thank you

Hi all,

I realise I’m quite late to the (really cool) party - this extension was exactly what I was looking for, and really pleased that it’s being actively updated.

I’ve created a SkyQ remote - it’s not the prettiest, but I hope it will help someone… Underlying it is
https://github.com/RogerSelwyn/Home_Assistant_SkyQ_MediaPlayer

Here is a screenshot:

Obviously the volume buttons would need to be customised to your setup, but I hope someone will find it useful:

type: custom:android-tv-card
title: Sky
remote_id: media_player.skyq_living_room
button_style:
  width: 200%
  height: 64px
  border-radius: 100%
  background: gray
  '--size': 32px
  position: relative
  left: '-16px'
touchpad_style:
  height: 260px
  border-radius: 100%
  width: 260px
  flex-grow: 0
  background-color: gray
rows:
  - - power
    - sky
    - sky_search
  - - rewind
    - play_pause
    - fast_forward
  - - navigation_touchpad
  - - back
    - home
    - sidebar
  - - volume_up
    - volume_mute
    - info
    - channel_up
  - - volume_down
    - record
    - channel_down
  - - red
    - green
    - yellow
    - blue
  - - n1
    - n2
    - n3
  - - n4
    - n5
    - n6
  - - n7
    - n8
    - n9
  - - source
    - n0
    - question
custom_keys:
  power:
    icon: mdi:power
    service: select.select_option
    service_data:
      entity_id: select.wohnzimmer_activities
      option: power_off
  sky:
    icon: mdi:cloud
    service: media_player.play_media
    data:
      media_content_type: skyq
      media_content_id: sky
    target:
      entity_id: media_player.skyq_living_room
  sky_search:
    icon: mdi:magnify
    service: media_player.play_media
    data:
      media_content_type: skyq
      media_content_id: search
    target:
      entity_id: media_player.skyq_living_room
  rewind:
    service: media_player.play_media
    data:
      media_content_type: skyq
      media_content_id: rewind
    target:
      entity_id: media_player.skyq_living_room
  play_pause:
    service: media_player.play_media
    data:
      media_content_type: skyq
      media_content_id: play
    target:
      entity_id: media_player.skyq_living_room
  fast_forward:
    service: media_player.play_media
    data:
      media_content_type: skyq
      media_content_id: fastforward
    target:
      entity_id: media_player.skyq_living_room
  back:
    service: media_player.play_media
    data:
      media_content_type: skyq
      media_content_id: dismiss
    target:
      entity_id: media_player.skyq_living_room
  home:
    service: media_player.play_media
    data:
      media_content_type: skyq
      media_content_id: home
    target:
      entity_id: media_player.skyq_living_room
  sidebar:
    icon: mdi:dots-horizontal
    service: media_player.play_media
    data:
      media_content_type: skyq
      media_content_id: sidebar
    target:
      entity_id: media_player.skyq_living_room
  volume_up:
    style: null
  volume_mute:
    style: null
  info:
    service: media_player.play_media
    data:
      media_content_type: skyq
      media_content_id: i
    target:
      entity_id: media_player.skyq_living_room
  channel_up:
    service: media_player.play_media
    data:
      media_content_type: skyq
      media_content_id: channelup
    target:
      entity_id: media_player.skyq_living_room
  volume_down:
    style: null
  record:
    icon: mdi:record-rec
    service: media_player.play_media
    data:
      media_content_type: skyq
      media_content_id: record
    target:
      entity_id: media_player.skyq_living_room
  channel_down:
    service: media_player.play_media
    data:
      media_content_type: skyq
      media_content_id: channeldown
    target:
      entity_id: media_player.skyq_living_room
  red:
    icon: mdi:circle
    service: media_player.play_media
    data:
      media_content_type: skyq
      media_content_id: red
    target:
      entity_id: media_player.skyq_living_room
    style:
      color: red
  green:
    icon: mdi:circle
    service: media_player.play_media
    data:
      media_content_type: skyq
      media_content_id: green
    target:
      entity_id: media_player.skyq_living_room
    style:
      color: green
  yellow:
    icon: mdi:circle
    service: media_player.play_media
    data:
      media_content_type: skyq
      media_content_id: yellow
    target:
      entity_id: media_player.skyq_living_room
    style:
      color: yellow
  blue:
    icon: mdi:circle
    service: media_player.play_media
    data:
      media_content_type: skyq
      media_content_id: blue
    target:
      entity_id: media_player.skyq_living_room
    style:
      color: blue
  n0:
    service: media_player.play_media
    data:
      media_content_type: skyq
      media_content_id: 0
    target:
      entity_id: media_player.skyq_living_room
  n1:
    service: media_player.play_media
    data:
      media_content_type: skyq
      media_content_id: 1
    target:
      entity_id: media_player.skyq_living_room
  n2:
    service: media_player.play_media
    data:
      media_content_type: skyq
      media_content_id: 2
    target:
      entity_id: media_player.skyq_living_room
  n3:
    service: media_player.play_media
    data:
      media_content_type: skyq
      media_content_id: 3
    target:
      entity_id: media_player.skyq_living_room
  n4:
    service: media_player.play_media
    data:
      media_content_type: skyq
      media_content_id: 4
    target:
      entity_id: media_player.skyq_living_room
  n5:
    service: media_player.play_media
    data:
      media_content_type: skyq
      media_content_id: 5
    target:
      entity_id: media_player.skyq_living_room
  n6:
    service: media_player.play_media
    data:
      media_content_type: skyq
      media_content_id: 6
    target:
      entity_id: media_player.skyq_living_room
  n7:
    service: media_player.play_media
    data:
      media_content_type: skyq
      media_content_id: 7
    target:
      entity_id: media_player.skyq_living_room
  n8:
    service: media_player.play_media
    data:
      media_content_type: skyq
      media_content_id: 8
    target:
      entity_id: media_player.skyq_living_room
  n9:
    service: media_player.play_media
    data:
      media_content_type: skyq
      media_content_id: 9
    target:
      entity_id: media_player.skyq_living_room
  up:
    icon: mdi:arrow-up-bold
    service: media_player.play_media
    data:
      media_content_type: skyq
      media_content_id: up
    target:
      entity_id: media_player.skyq_living_room
  right:
    icon: mdi:arrow-right-bold
    service: media_player.play_media
    data:
      media_content_type: skyq
      media_content_id: right
    target:
      entity_id: media_player.skyq_living_room
  left:
    icon: mdi:arrow-left-bold
    service: media_player.play_media
    data:
      media_content_type: skyq
      media_content_id: left
    target:
      entity_id: media_player.skyq_living_room
  down:
    icon: mdi:arrow-down-bold
    service: media_player.play_media
    data:
      media_content_type: skyq
      media_content_id: down
    target:
      entity_id: media_player.skyq_living_room
  center:
    icon: mdi:circle-outline
    service: media_player.play_media
    data:
      media_content_type: skyq
      media_content_id: select
    target:
      entity_id: media_player.skyq_living_room

You’ll need to replace ‘media_player.skyq_living_room’ with whatever your SkyQ box is called.

The touchpad works exactly as you would expect. And many thanks to everyone who has contributed to this lovely repo.

Thanks!

3 Likes

This has been a life saver for me. my wife is constantly loosing the remote to the TV (I have a helium balloon tied to it to stop this) and having it available on my phone is great.

Is there a way to choose the “TV” app like launching the other apps? Or even just selecting an HDMI source?

1 Like

Choosing the TV app or changing the TV input source is outside of Android TV and a function of your TV. It’s probably being done through an IR command. What TV do you have? I’m personally using a Broadlink RM4 Pro to send IR commands to my AV receiver, and then track what it’s states should be using Home Assistant input selects and booleans. I then use automations to detect when the input selects’ states change, and then call the appropriate IR commands.

Its a Sharp. I can access the TV operations via an app, there is a ‘live tv’ app that i can select to launch the HDMI source and on HA it says ‘com.mediatek.wwtv.tvcenter’

In that case it sounds like you need to find the deep link using this guide and create a custom source action for it.

I’ll have to look at this later, ADB over the network is disabled and i’m at work. hopefully there is an option in the settings to enabled ADB over the network as I dont think there is a way to connect a PC to it

I tried to use this Kodi card GitHub - Nerwyn/android-tv-card: Android TV Remote Card (with HA actions, touchpad, haptic, and keyboard) (with my mediaplayer id)

But all i get is an error: service remote.send_command not found.
What do i miss?

What version of Home Assistant are you on? If you’re getting the error service remote.send_command not found then something may be up with you Home Assistant server.

2024.1. Does Kodi use this services? There are alot of kodi.call_method services in tha yaml.

You’re right. Still I’m not seeing that error when I try it on my server using that remote config.

I have dropout.tv and nebula.tv working with custom icons, not sure where to share that, so I’ll dump it here.

note the custom icons are centered manually because I could not find how to center an object on the canvas in inkscape at 2AM I mention it because I’m sure that kind of thing bothers people and is probably real easy to fix if you actually know how to use a vector graphics editor.

custom_actions:
  dropout:
    icon: dropout
    service: remote.turn_on
    data:
      activity: vhxdropout://
    target:
      entity_id: remote.<your entity>
  nebula:
    icon: nebula
    service: androidtv.adb_command
    target:
      entity_id: media_player.<your entity>
    data:
      command: >-
        am start -a android.intent.action.VIEW -n
        tv.standard.nebula/.tv.features.splash.view.activities.SplashActivity
custom_icons:
  dropout: >-
    m 1.8731346,4.8818924 c 0,0 5.1325618,0 5.1325618,0 0,0 0,5.1325616
    0,5.1325616 0,0 -5.1325618,0 -5.1325618,0 z m 0,8.8708896 c 0,0 5.1325618,0
    5.1325618,0 0,0 0,5.132561 0,5.132561 0,0 -5.1325618,0 -5.1325618,0 z m
    8.1098917,7.75439 c 0,0 0,-18.786066 0,-18.786066 0,0 3.0495417,0
    3.0495417,0 5.16589,0 9.393033,4.2271425 9.393033,9.393033 0,5.16589
    -4.227143,9.393033 -9.393033,9.393033 z
  nebula: >-
    m 9.2053254,14.360664 2.5645706,7.510643 2.433883,-7.563553
    7.930223,-0.02646 L 15.800616,9.5182958 18.312806,1.9288163
    11.796352,6.6918178 5.2269861,1.8505087 7.6873234,9.5182958
    1.4581725,14.281827 Z
1 Like

Version 3.3.0 has just been released. This release introduces multi touch touchpad gestures and more customizable repeat on hold commands. You can now program separate actions for two-plus finger swipes, taps, and holds on the touchpad for up to twenty-two different actions. You can also make any key repeat on hold by setting it’s hold action to repeat, like the directional and volume keys are by default. See the release notes and README to learn more about how to use these new features.

2 Likes

hey nerwyn, first of all, wanted to add my voice to the many that express thanks to you (and the folks you derived this from). this is really great work in how powerful and flexible it is.

one minor feature request… would love to have custom_actions let me define button_press vs button_release

the reason for this is that for some video services, the press time is what triggers fast forward (prime video, for example). so i’d send the adb_command sendevent for press down and up appropriately. right now i’m faking it using your hold_action, and having that trigger a sendevent down, delay 3 secs, sendevent up. but as you can imaging that has some annoying side effects…it takes the extra hold_action time before that triggers. and during the 3 subsequent 3 seconds i can’t send another event to double the speed of the fast forward.

certainly not a showstopper or anything, doesn’t undermine how great this card is! thanks again to you and those you inherited from!

If you make a feature request on the repository on the issues page I can look into it and we can discuss it more there. Using button hold time to determine hold_secs sounds like a good idea, but I want to hear more about how you’re doing it in detail.

just stared to use HA and this is amazing remote, thank you

i just wanted to know if there is a way to search by voice and not text

Not yet no. I had planned to do this a while ago but it fell by the wayside. If you want you can create a feature request for it on the repository and I will get back to it eventually.

2 Likes

Ok, my ideal remote with multiple devices controlled created! How to make those button real 3d and whole remote as physical device ? Is there any hidden option for that ? :wink: I’ve heard that JS is using constructor for objects, how to ask this constructor to build my remote hardware ? :wink:

is it possible to override specific keys in the keyboard? backspace, for example, isn’t the same for chromecast and fire tv, so i’d like to override backspace with the appropriate sendevent codes.

Certain keys (backspace, delete, enter, left arrow, and right arrow) are sent using the Android TV Remote API, which isn’t available for Fire TV. What I can do is create an alternate keyboard_mode (like there is for Kodi) that sends these commands via ADB instead. Can you create a feature request on the repo?