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

Love this thing, now trying my best to make it look pretty. Is there a way to change colors of individual default buttons (spotify green, youtube red, etc)? I figured out the css style for the custom buttons, but cant get it for the default ones…

1 Like

Create a custom action with the same name as the source button with autofill enabled. It’ll autofill with the default key/source information. Make sure the action and icon autofills correctly, as it may prematurely autofill with the name of a shorter default key/source like y instead of youtube. If it does change the icon and set the tap action to default. From there you can apply CSS styles to it under the appearances panel. See this example in the README.

1 Like

The new visual editor has me confused a bit. I pasted my old kodi remote config, pressed “Update Old Config” but some things wont work. For eg on the touchpad, tapping once used to send a “return” which was like the “Ok” or “Enter”. That does not work now and gives the error “Action : remote.send_command not found” Similarly I had a double tap mapped to back, that also doesnt work.

I used the visual editor to add few elements and the touchpad in that works fine unlike my old one. But I had my volume buttons in my old config mapped to my AVR and not to Kodi, dont know how to achieve that in the new one. Also unsure how to use double tap and long press in the new one.

Would be very appreciative of any help. Thank you.

My old raw config yaml as below

type: custom:android-tv-card
keyboard_id: media_player.kodi
rows:
  - - back
    - home
    - menu
  - - info
    - play_pause
    - stop
  - - - volume_buttons
    - touchpad
    - - textbox
      - null
      - search
      - null
      - fullscreen
long_click_keycode: menu
custom_actions:
  - type: button
    name: up
    tap_action:
      action: perform-action
      perform_action: kodi.call_method
      data:
        method: Input.ButtonEvent
        button: Up
        keymap: KB
      target:
        entity_id: media_player.kodi
    hold_action:
      action: repeat
    icon: mdi:chevron-up
    mode: single
  - type: button
    name: down
    tap_action:
      action: perform-action
      perform_action: kodi.call_method
      data:
        method: Input.ButtonEvent
        button: Down
        keymap: KB
      target:
        entity_id: media_player.kodi
    hold_action:
      action: repeat
    icon: mdi:chevron-down
    mode: single
  - type: button
    name: left
    tap_action:
      action: perform-action
      perform_action: kodi.call_method
      data:
        method: Input.ButtonEvent
        button: Left
        keymap: KB
      target:
        entity_id: media_player.kodi
    hold_action:
      action: repeat
    icon: mdi:chevron-left
    mode: single
  - type: button
    name: right
    tap_action:
      action: perform-action
      perform_action: kodi.call_method
      data:
        method: Input.ButtonEvent
        button: Right
        keymap: KB
      target:
        entity_id: media_player.kodi
    hold_action:
      action: repeat
    icon: mdi:chevron-right
    mode: single
  - type: button
    name: center
    tap_action:
      action: perform-action
      perform_action: kodi.call_method
      data:
        method: Input.ButtonEvent
        button: return
        keymap: KB
      target:
        entity_id: media_player.kodi
    icon: mdi:kodi
    mode: single
  - type: button
    name: back
    tap_action:
      action: perform-action
      perform_action: kodi.call_method
      data:
        method: Input.ButtonEvent
        button: backspace
        keymap: KB
      target:
        entity_id: media_player.kodi
    icon: mdi:arrow-left-bold
    mode: single
  - type: button
    name: volume_mute
    tap_action:
      data:
        method: Application.SetMute
        mute: toggle
      target:
        entity_id: media_player.kodi
      action: perform-action
      perform_action: kodi.call_method
    icon: mdi:volume-mute
  - type: button
    name: volume_up
    tap_action:
      data:
        method: Application.SetVolume
        volume: increment
      target:
        entity_id: media_player.kodi
      action: perform-action
      perform_action: kodi.call_method
    hold_action:
      action: repeat
    icon: mdi:volume-plus
  - type: button
    name: volume_down
    tap_action:
      data:
        method: Application.SetVolume
        volume: decrement
      target:
        entity_id: media_player.kodi
      action: perform-action
      perform_action: kodi.call_method
    hold_action:
      action: repeat
    icon: mdi:volume-minus
  - type: button
    name: menu
    tap_action:
      data:
        method: Input.ContextMenu
      target:
        entity_id: media_player.kodi
      action: perform-action
      perform_action: kodi.call_method
    icon: mdi:menu
  - type: button
    name: home
    tap_action:
      data:
        method: Input.Home
      target:
        entity_id: media_player.kodi
      action: perform-action
      perform_action: kodi.call_method
    icon: mdi:home
  - type: button
    name: info
    tap_action:
      data:
        method: Input.Info
      target:
        entity_id: media_player.kodi
      action: perform-action
      perform_action: kodi.call_method
    icon: mdi:information
  - type: button
    name: play_pause
    tap_action:
      data:
        method: Player.PlayPause
        playerid: 1
      target:
        entity_id: media_player.kodi
      action: perform-action
      perform_action: kodi.call_method
    icon: mdi:play-pause
  - type: button
    name: stop
    tap_action:
      data:
        method: Player.Stop
        playerid: 1
      target:
        entity_id: media_player.kodi
      action: perform-action
      perform_action: kodi.call_method
    icon: mdi:stop
  - icon: mdi:fullscreen
    mode: single
    name: fullscreen
    tap_action:
      action: perform-action
      perform_action: kodi.call_method
      data:
        method: Input.ButtonEvent
        button: Tab
        keymap: KB
      target:
        entity_id: media_player.kodi
    type: button
  - type: touchpad
    name: touchpad
    tap_action:
      action: key
      key: DPAD_CENTER
    up:
      tap_action:
        action: perform-action
        perform_action: kodi.call_method
        data:
          method: Input.ButtonEvent
          button: Up
          keymap: KB
        target:
          entity_id: media_player.kodi
      hold_action:
        action: repeat
      mode: single
      name: up
      type: button
    down:
      tap_action:
        action: perform-action
        perform_action: kodi.call_method
        data:
          method: Input.ButtonEvent
          button: Down
          keymap: KB
        target:
          entity_id: media_player.kodi
      hold_action:
        action: repeat
      mode: single
      name: down
      type: button
    left:
      tap_action:
        action: perform-action
        perform_action: kodi.call_method
        data:
          method: Input.ButtonEvent
          button: Left
          keymap: KB
        target:
          entity_id: media_player.kodi
      hold_action:
        action: repeat
      mode: single
      name: left
      type: button
    right:
      tap_action:
        action: perform-action
        perform_action: kodi.call_method
        data:
          method: Input.ButtonEvent
          button: Right
          keymap: KB
        target:
          entity_id: media_player.kodi
      hold_action:
        action: repeat
      mode: single
      name: right
      type: button
    styles: |-
      toucharea {
        height: 400px;
      }
    haptics: false
    double_tap_action:
      action: key
      key: back
    hold_action:
      action: key
      key: menu
platform: Kodi

That YAML is in the new format (custom_actions is a list instead of a dict/object). Do you still have a copy of the old config? Your new one is working fine for me on my Kodi dev instance.

Have you read the new README? It has instructions with screenshots on how to use the configuration UI.

1 Like

Ok, maybe the yaml got written over when I did an Update Old Config.

I can see the descriptive readme but pool old me is having a tough time adapting it to my needs :smiling_face_with_tear:

Appreciate your help, the old yaml is below. As I mentioned, the only things not working are the center button (single tap), long press and double tap.

type: custom:android-tv-card
        keyboard_id: media_player.kodi
        keyboard_mode: KODI
        rows:
          - - back
            - home
            - menu
          - - info
            - play_pause
            - stop
          - - - vol_buttons
            - touchpad
            - - textbox
              - null
              - search
              - null
              - fullscreen
        touchpad_style:
          height: 400px
        enable_touchpad_feedback: false
        enable_double_click: true
        double_click_keycode: back
        long_click_keycode: menu
        custom_keys:
          up:
            icon: mdi:chevron-up
            service: kodi.call_method
            service_data:
              method: Input.ButtonEvent
              button: Up
              keymap: KB
              entity_id: media_player.kodi
            mode: single
          down:
            icon: mdi:chevron-down
            service: kodi.call_method
            service_data:
              method: Input.ButtonEvent
              button: Down
              keymap: KB
              entity_id: media_player.kodi
            mode: single
          left:
            icon: mdi:chevron-left
            service: kodi.call_method
            service_data:
              method: Input.ButtonEvent
              button: Left
              keymap: KB
              entity_id: media_player.kodi
            mode: single
          right:
            icon: mdi:chevron-right
            service: kodi.call_method
            service_data:
              method: Input.ButtonEvent
              button: Right
              keymap: KB
              entity_id: media_player.kodi
            mode: single
          center:
            icon: mdi:kodi
            service: kodi.call_method
            service_data:
              method: Input.ButtonEvent
              button: return
              keymap: KB
              entity_id: media_player.kodi
            mode: single
          back:
            icon: mdi:arrow-left
            service: kodi.call_method
            service_data:
              method: Input.ButtonEvent
              button: backspace
              keymap: KB
              entity_id: media_player.kodi
            mode: single
          volume_mute:
            icon: mdi:volume-mute
            service: kodi.call_method
            target:
              entity_id: media_player.kodi
            data:
              method: Application.SetMute
              mute: toggle
          volume_up:
            icon: mdi:volume-minus
            service: kodi.call_method
            target:
              entity_id: media_player.kodi
            data:
              method: Application.SetVolume
              volume: decrement
          volume_down:
            icon: mdi:volume-plus
            service: kodi.call_method
            target:
              entity_id: media_player.kodi
            data:
              method: Application.SetVolume
              volume: increment
          menu:
            service: kodi.call_method
            target:
              entity_id: media_player.kodi
            data:
              method: Input.ContextMenu
          home:
            service: kodi.call_method
            target:
              entity_id: media_player.kodi
            data:
              method: Input.Home
          info:
            service: kodi.call_method
            target:
              entity_id: media_player.kodi
            data:
              method: Input.Info
          play_pause:
            service: kodi.call_method
            target:
              entity_id: media_player.kodi
            data:
              method: Player.PlayPause
              playerid: 1
          stop:
            service: kodi.call_method
            target:
              entity_id: media_player.kodi
            data:
              method: Player.Stop
              playerid: 1
          fullscreen:
            icon: mdi:fullscreen
            service: kodi.call_method
            service_data:
              method: Input.ButtonEvent
              button: Tab
              keymap: KB
              entity_id: media_player.kodi
            mode: single
      - type: media-control
        entity: media_player.kodi

Try this, it’s working for me.

type: custom:android-tv-card
keyboard_id: media_player.kodi
rows:
  - - back
    - home
    - menu
  - - info
    - play_pause
    - stop
  - - - volume_buttons
    - touchpad
    - - textbox
      - null
      - search
      - null
      - fullscreen
platform: Kodi
custom_actions:
  - type: button
    name: back
    tap_action:
      action: perform-action
      perform_action: kodi.call_method
      data:
        method: Input.ButtonEvent
        button: backspace
        keymap: KB
      target:
        entity_id: media_player.kodi
    icon: mdi:arrow-left
    mode: single
  - type: button
    name: volume_mute
    tap_action:
      data:
        method: Application.SetMute
        mute: toggle
      target:
        entity_id: media_player.kodi
      action: perform-action
      perform_action: kodi.call_method
    icon: mdi:volume-mute
  - type: button
    name: volume_up
    tap_action:
      data:
        method: Application.SetVolume
        volume: decrement
      target:
        entity_id: media_player.kodi
      action: perform-action
      perform_action: kodi.call_method
    hold_action:
      action: repeat
    icon: mdi:volume-minus
  - type: button
    name: volume_down
    tap_action:
      data:
        method: Application.SetVolume
        volume: increment
      target:
        entity_id: media_player.kodi
      action: perform-action
      perform_action: kodi.call_method
    hold_action:
      action: repeat
    icon: mdi:volume-plus
  - type: button
    name: menu
    tap_action:
      data:
        method: Input.ContextMenu
      target:
        entity_id: media_player.kodi
      action: perform-action
      perform_action: kodi.call_method
    icon: mdi:menu
  - type: button
    name: home
    tap_action:
      data:
        method: Input.Home
      target:
        entity_id: media_player.kodi
      action: perform-action
      perform_action: kodi.call_method
    icon: mdi:home
  - type: button
    name: play_pause
    tap_action:
      data:
        method: Player.PlayPause
        playerid: 1
      target:
        entity_id: media_player.kodi
      action: perform-action
      perform_action: kodi.call_method
    icon: mdi:play-pause
  - icon: mdi:fullscreen
    mode: single
    name: fullscreen
    tap_action:
      action: perform-action
      perform_action: kodi.call_method
      data:
        method: Input.ButtonEvent
        button: Tab
        keymap: KB
      target:
        entity_id: media_player.kodi
    type: button
  - type: touchpad
    name: touchpad
    tap_action:
      action: perform-action
      perform_action: kodi.call_method
      data:
        method: Input.Select
    up:
      tap_action:
        action: perform-action
        perform_action: kodi.call_method
        data:
          method: Input.ButtonEvent
          button: Up
          keymap: KB
        target:
          entity_id: media_player.kodi
      hold_action:
        action: repeat
      mode: single
      name: up
      type: button
    down:
      tap_action:
        action: perform-action
        perform_action: kodi.call_method
        data:
          method: Input.ButtonEvent
          button: Down
          keymap: KB
        target:
          entity_id: media_player.kodi
      hold_action:
        action: repeat
      mode: single
      name: down
      type: button
    left:
      tap_action:
        action: perform-action
        perform_action: kodi.call_method
        data:
          method: Input.ButtonEvent
          button: Left
          keymap: KB
        target:
          entity_id: media_player.kodi
      hold_action:
        action: repeat
      mode: single
      name: left
      type: button
    right:
      tap_action:
        action: perform-action
        perform_action: kodi.call_method
        data:
          method: Input.ButtonEvent
          button: Right
          keymap: KB
        target:
          entity_id: media_player.kodi
      hold_action:
        action: repeat
      mode: single
      name: right
      type: button
    styles: |-
      toucharea {
        height: 400px;
      }
    haptics: false
    double_tap_action:
      action: perform-action
      perform_action: kodi.call_method
      data:
        method: Input.Back
    hold_action:
      action: perform-action
      perform_action: kodi.call_method
      data:
        method: Input.ContextMenu
      target: {}
  - type: button
    name: stop
    tap_action:
      action: perform-action
      perform_action: kodi.call_method
      target:
        entity_id: media_player.kodi
      data:
        method: Player.Stop
        playerid: 1
    icon: mdi:stop
media_player_id: media_player.kodi

The upgrade process isn’t perfect, especially for really old configs, so there’s bound to be some issues.

I also don’t think you need the keymap fields in your custom actions, as I don’t include them in the new Kodi default key maps and they work fine without them.

1 Like

It works. Big thank you!

Keyboard doesnt work. It says androidtv.adb_command not found.

Another peculiar thing I observe is that I am not able to edit the yaml config properly. When I try to edit/ delete some sections, the cursor suddenly just goes to the top left corner of the window, to the beginning of the code. Its as though the visual editor wont let me edit it. Even when I delete the entire yaml I am still able to see the remote in the right preview pane.

Are you sure that your platform is set to Kodi, and that it isn’t overridden by any custom keyboard actions?

The cursor jumping is an issue with the code boxes and appears in some default cards. Which editor mode is this for? The entire card? The layout tab? An action?

The cursor is jumping when editing the entire card. I am left with no option but to create the yaml on notepad and replace the entire contents. When I try to delete a few lines, it does not allow me. This is quite problematic.

Unfortunately that’s a Home Assistant issue, I don’t have control over the entire card YAML editor, just the subsection ones. Can you try and see if it also happens with other custom cards? Why not use the UI editor?

1 Like

I had forgotten the line

platform: Kodi

Hence the keyboard not working. Got it going.

I can edit the yaml just fine from the raw config editor, but not from the individual card. I had copied the conifg directory of another build to this one in the hopes of copying over all settings etc but that hadnt worked. Then I manually installed a bunch of stuff from HACS anyway. Hope that isnt causing the issues.

since updating my Android TV to version 12, some commands do not work anymore (e.g. TV, CHANNEL_UP and CHANNEL_DOWN). Other still do (e.g. dpad commands or HOME).
Did someone experience the same issue?

Think, I’ve had the same problem.
Solution: my Bravia Integration has been broken.

Removed it completely and added it again.
Now it works