Universal Remote Card - Buttons, Touchpads, Sliders, and Keyboards for Multiple Platforms

thanks to this amazing addon was able to make two custom universal remotes for Xbox based media plyers and tv

type: vertical-stack
cards:
  - type: horizontal-stack
    cards:
      - type: button
        name: Projector Power
        icon: mdi:projector
        tap_action:
          action: call-service
          service: script.toggle_projector
        entity: binary_sensor.living_room_projector_status
        show_state: true
        show_name: true
        show_icon: true
      - type: button
        name: Soundbar Power
        icon: mdi:speaker
        tap_action:
          action: call-service
          service: script.turn_on_soundbar
      - show_name: true
        show_icon: true
        type: button
        name: Xbox Power
        icon: mdi:microsoft-xbox
        tap_action:
          action: call-service
          service: script.xbox_power
        entity: media_player.xbox_series_x
        show_state: true
  - type: media-control
    entity: media_player.xbox_series_x
  - type: horizontal-stack
    cards:
      - type: custom:android-tv-card
        remote_id: media_player.xbox_series_x
        title: Living Room Xbox Remote
        rows:
          - - power
            - home
            - menu
            - info
          - - dpad
          - - back
          - - rewind
            - play
            - fast_forward
        custom_actions:
          power:
            action: call-service
            service: script.xbox_power
          up:
            action: call-service
            service: script.xbox_up
          down:
            action: call-service
            service: script.xbox_down
          left:
            action: call-service
            service: script.xbox_left
          right:
            action: call-service
            service: script.xbox_right
          center:
            action: call-service
            service: script.xbox_ok
          home:
            action: call-service
            service: script.xbox_home
          menu:
            action: call-service
            service: script.xbox_menu
          info:
            action: call-service
            service: script.xbox_info
          back:
            action: call-service
            service: script.xbox_back
          rewind:
            action: call-service
            service: script.xbox_rewind
          play:
            action: call-service
            service: script.xbox_play
          fast_forward:
            action: call-service
            service: script.xbox_fast_forward
        row_styles:
          row-1:
            justify-content: center
          row-2:
            justify-content: center
          row-3:
            justify-content: center
          row-4:
            justify-content: center
          row-5:
            justify-content: center
  - type: horizontal-stack
    cards:
      - type: custom:button-card
        entity: script.volume_up_sound_bar
        icon: mdi:volume-plus
        name: Volume Up
        show_name: true
        show_icon: true
        tap_action:
          action: call-service
          service: script.turn_on
          service_data:
            entity_id: script.volume_up_sound_bar
        hold_action:
          action: call-service
          service: script.turn_on
          service_data:
            entity_id: script.volume_up_sound_bar
          repeat: 500
      - type: custom:button-card
        entity: script.volume_down_sound_bar
        icon: mdi:volume-minus
        name: Volume Down
        show_name: true
        show_icon: true
        tap_action:
          action: call-service
          service: script.turn_on
          service_data:
            entity_id: script.volume_down_sound_bar
        hold_action:
          action: call-service
          service: script.turn_on
          service_data:
            entity_id: script.volume_down_sound_bar
          repeat: 500
      - type: custom:button-card
        entity: script.mute_sound_bar
        icon: mdi:volume-mute
        name: Mute
        show_name: true
        show_icon: true
        tap_action:
          action: call-service
          service: script.turn_on
          service_data:
            entity_id: script.mute_sound_bar

2 Likes

This is actually a very annoying bug with material ripples. The newest version of it md-ripple (AFAIK) has mostly fixed it, but the ripples still get stuck on when an element is held down using a touch action. Between upgrading to the newer ripple element and adding some touch ripple fixes of my own it should be fixed in the latest beta.

3.9.0 has been released!

Keyboards have been greatly improved with a modal dialog for text entry.

ezgif-2-dc4ddeb1a2

No more ugly browser prompts! You can now see what you’ve typed on your Home Assistant device screen when using seamless keyboard mode. Note, that you cannot and should not change where the cursor is in the keyboard modal dialog or delete more than one character at a time and only from the end of your input text, as there is no way to retrieve and set textboxes in most media platforms. Doing so will not properly changed the text on your media platform device, it’ll just make the keyboard dialog out of sync with it. You still have to backspace from the end of what you typed.

Keyboard performance has also been improved for Android and Fire TV by adding support for the the new ADB remote entity, which sends commands faster than the old media player one. Kodi also now supports seamless mode! And because of the way Kodi’s send input text method works it doesn’t have the same restrictions on moving your cursor or deleting chunks from your input text.

Button and touchpad ripples have been upgraded and improved, and shouldn’t get stuck in an on state anymore.

1 Like

there is an option to type in other language than english with the keyboard ? when i try to type in other language there is no text on the screen

there is a problem with the vertical slider in RTL language, slider is upside down, you need to slide it down to make the volume louder and slide it up to reduce the volume

thank you for your hard work

Unfortunately no. This is an ADB limitation. There is an existing issue on the repo for international characters, but it’s not fixable unless sending characters gets reverse engineered for the Android TV Remote API, which also has an open issue for it.

Try applying transform: rotate(180deg) and --tooltip-transform: translate(-50px, calc(var(--thumb-offset))) to the slider styles. I did notice that the page is still scrolling when using the vertical slider so I’ll have to see if I can fix that.

i tried to use transform but it fix only the color of the slider, the numbers and the icon still come down when i move the slider up

Amazing, this is next level! I have yet to see such good keyboards implemented even in native apps. Kudos!

2 Likes

Hello!

Really like this card! One question/request, would it be possible for kodi, as in the official kodi app, that the keyboard shows up as soon as text input is required? I.e without pressing a keyboard button?

Hey everyone, I could use testers and feedback for the massive v4 refactor I just pushed to beta. Especially if you use a platform other than Android TV.

1 Like

Hi! Thanks for this amazing card, I use it on a daily basis for my Android TVs
I’m now trying to set it up for my CoreELEC box and I’ve ran into a few issues that perhaps can be solved

First, Input.Select doesn’t seem to open the playback OSD even though select on my physical remote does. I had to use another button specifically for Input.ShowOSD. Is there a way to have the Input.Select also show the OSD?

Second, is there a way to simulate long presses on buttons? Specifically the back button. I’d like to be able to long press it to stop playback or exit menus (as opposed to going just one menu back) just like the physical remote but I can’t figure out if that’s possible

Thanks!

The README describes how to add double tap and hold actions to custom actions, along with the alternate momentary button mode. While hold_secs = 0.5 is added to tap action remote.send_command actions if a hold action is performed but one is not defined (like Android TV’s center action, which performs a menu action if held down), it doesn’t do so for other action types.

You can add this behavior back by setting the hold action to the same command and adding hold_secs to that, but I’m not sure if the Kodi RPC API supports it. You may have to remap the center/select and back hold actions to alternate actions instead. You cannot make a tap action perform two different actions unless you use templates to change the action or it’s data based on the states or attributes of other entities.

Also consider using the v4 beta. It has many Kodi default actions included in it. You’ll still have to add hold actions to some keys but it’ll let you do it through a UI instead of YAML.

Is there a way to change the slider to set a number for a number entity? I want to use it as a timer instead. I have number.air_conditioner_smart_plug_timer that I want to control (I made an AC remote using custom keys) and when I try to put slider_id to the number entity, it gives me an error relating to not being related to a media player.

You can create a custom action for the slider and change it’s tap action. It’s described in the README but more clear in the v4 beta configuration UI.

Version 4.0.0 is here!

This release contains breaking changes due to a change in the format of the configuration YAML. But don’t worry! The new configuration UI has a button that should upgrade your old remote configs!

This release adds a few major things:

  • Configuration UI! No more dealing with YAML.
  • Multiple sliders and touchpads.
    • Touchpad no longer uses the up/down/left/right actions and has it’s own internal directions that can be customized separately.
  • More in depth style options using pure CSS.
  • Built in support for more platforms with default keys and sources.
    • Android TV (with keyboard)
    • Fire TV (with keyboard)
    • Roku (with keyboard)
    • Kodi (with keyboard)
    • Apple TV
    • Samsung TV
    • LG webOS
    • I’m very open to help for adding to this list and adding to these default key and source lists.
4 Likes

Hi, great job, I didn’t know about this card.
What I can’t do is be able to use the keyboard, I see the “Keyboard ID” option, but I don’t know how to get it, I saw that it’s done via adb, but I don’t know how to get it, do I have to type a command in adb?

The Android TV platform uses the Android TV Remote integration for regular commands and the Android Debug Bridge for the keyboard. You need to setup the latter via Home Assistant and provide the remote entity ID created by that integration as the keyboard ID.

1 Like

Perfect, thank you, I didn’t know about Android Debug Bridge. I have it running now, but I notice that it’s quite slow and when I type quickly, some letters are skipped. Is that normal behavior?

Yup. ADB is slow. It’s mentioned in the README. Letter skipping shouldn’t happen too often.

1 Like

Hi @Nerwyn , i upgraded to 4.0.3 and now i get an error where it says the card doesnt exist. i have tried restarting HA. Also tried rolling back to 3.9.4 and still the same

EDIT: added a symbolic link as below and it started working ln -s /config/www/community /hacsfiles

Would anyone know how to install this card without HACS?