How do I actually make a TV Remote Control work well in the GUI

Yeah gotcha… Was more thinking of the original question in first post… Totally understand other use cases like yours.

Hello @tom_l

thank you so much for sharing this code with us. You are the guy.

1 Like

@tom_l, Here the remote control after some modifications that were necessary for my environment. Thank you again.

1 Like

Thank you all for your help with this I would like to share what I have done

Heres my Code, I’ve used a combination of Vertical Stack, Hosrisontal stack, Buton Cards and Custom:button-cards, Hope this helps all

A couple of quick pointers too

RM pro 4
initially created a bunch of switches (using remote.learn_command) and copying learned commands from .storage/broadlink_remote_xxxxxxxxxxxx_codes

here’s an extract from my configuration.yaml

switch: !include switch.yaml

# remote control
remote:
  - platform: broadlink
    host: 10.0.0.XX
    mac: A0:43:B0:XX:XX:XX
    name: RM Pro

example of switch.yaml

  - platform: broadlink
    host: 10.0.0.XX
    mac: A0:43:B0:XX:XX:XX
    switches:
#Sony Tv
     sony_power:
       friendly_name: "Sony Power"
       command_on: "JgCMAE0UJhUSFiYVEhUmFRIWEhUmFRMVEhUSFhMAA1BNFSYWERYmFRMUJhUTFRIVKBMTFRMVERYSAANRThQmFRIWJRYSFSYVEhYSFSYVEhYTFBMVEgADUk4VJhUSFScVEhUmFRIWEhUmFRIVExUSFRMAA1JOFSUWExQmFRMVJRYTFBIWJRYSFRIWEhUSAA0FAAAAAAAAAAAAAA=="
       command_off: "JgCMAE0UJhUSFiYVEhUmFRIWEhUmFRMVEhUSFhMAA1BNFSYWERYmFRMUJhUTFRIVKBMTFRMVERYSAANRThQmFRIWJRYSFSYVEhYSFSYVEhYTFBMVEgADUk4VJhUSFScVEhUmFRIWEhUmFRIVExUSFRMAA1JOFSUWExQmFRMVJRYTFBIWJRYSFRIWEhUSAA0FAAAAAAAAAAAAAA=="

Raw Config from lovelace editor

type: vertical-stack
cards:
  - type: button
    tap_action:
      action: navigate
      navigation_path: overview
    entity: null
    show_icon: false
    name: Back to Home
  - type: horizontal-stack
    cards:
      - type: 'custom:button-card'
        styles:
          icon:
            - color: green
          entity: switch.sony_source
        icon: 'mdi:import'
        show_name: false
        tap_action:
          action: toggle
      - type: button
        tap_action:
          action: none
        show_icon: true
        show_name: false
        icon: 'mdi:sony'
      - type: 'custom:button-card'
        styles:
          icon:
            - color: orange
        tap_action:
          action: toggle
        entity: switch.sony_power
        icon: 'mdi:power'
        show_name: false
        icon_height: 50px
  - type: horizontal-stack
    cards:
      - type: button
        tap_action:
          action: toggle
        entity: switch.sony_tv
        icon: 'mdi:television'
        show_name: false
        icon_height: 50px
      - type: 'custom:button-card'
        styles:
          icon:
            - color: white
        tap_action:
          action: toggle
        entity: switch.sony_up
        icon: 'mdi:arrow-up'
        icon_height: 50px
        show_name: false
      - type: button
        tap_action:
          action: toggle
        entity: switch.sony_home
        show_name: false
        icon: 'mdi:home'
        icon_height: 50px
  - type: horizontal-stack
    cards:
      - type: 'custom:button-card'
        styles:
          icon:
            - color: white
        tap_action:
          action: toggle
        entity: switch.sony_left
        icon: 'mdi:arrow-left'
        icon_height: 50px
        show_name: false
      - type: 'custom:button-card'
        styles:
          icon:
            - color: white
        tap_action:
          action: toggle
        entity: switch.sony_select
        icon: 'mdi:arrow-all'
        icon_height: 50px
        show_name: false
        hold_action:
          action: toggle
      - type: 'custom:button-card'
        styles:
          icon:
            - color: white
        tap_action:
          action: toggle
        entity: switch.sony_right
        icon: 'mdi:arrow-right'
        icon_height: 50px
        show_name: false
  - type: horizontal-stack
    cards:
      - type: button
        tap_action:
          action: toggle
        entity: switch.sony_back
        icon: 'mdi:undo-variant'
        icon_height: 50px
        show_name: false
      - type: 'custom:button-card'
        styles:
          icon:
            - color: white
        tap_action:
          action: toggle
        entity: switch.sony_down
        show_name: false
        icon: 'mdi:arrow-down'
        icon_height: 50px
      - type: 'custom:button-card'
        styles:
          icon:
            - color: red
        tap_action:
          action: toggle
        entity: switch.sony_netflix
        icon: 'mdi:netflix'
        show_name: false
        icon_height: 50px
  - type: horizontal-stack
    cards:
      - type: button
        tap_action:
          action: toggle
        entity: switch.sony_volume_up
        show_name: false
        icon: 'mdi:volume-plus'
      - type: button
        tap_action:
          action: toggle
        entity: switch.sony_channel_up
        show_name: false
        icon: 'mdi:plus'
  - type: horizontal-stack
    cards:
      - type: button
        tap_action:
          action: toggle
        entity: switch.sony_volume_down
        icon: 'mdi:volume-minus'
        show_name: false
      - type: button
        tap_action:
          action: toggle
        entity: switch.sony_channel_down
        icon: 'mdi:minus'
        show_name: false
  - type: horizontal-stack
    cards:
      - type: button
        tap_action:
          action: toggle
        entity: switch.sony_1
        show_icon: false
        name: '1'
      - type: button
        tap_action:
          action: toggle
        entity: switch.sony_2
        show_icon: false
        name: '2'
        show_name: true
      - type: button
        tap_action:
          action: toggle
        entity: switch.sony_3
        show_name: true
        show_icon: false
        name: '3'
        show_state: false
  - type: horizontal-stack
    cards:
      - type: button
        tap_action:
          action: toggle
        entity: switch.sony_4
        name: '4'
        show_icon: false
      - type: button
        tap_action:
          action: toggle
        entity: switch.sony_5
        name: '5'
        show_icon: false
      - type: button
        tap_action:
          action: toggle
        entity: switch.sony_6
        name: '6'
        show_icon: false
  - type: horizontal-stack
    cards:
      - type: button
        tap_action:
          action: toggle
        entity: switch.sony_7
        name: '7'
        show_icon: false
      - type: button
        tap_action:
          action: toggle
        entity: switch.sony_8
        name: '8'
        show_icon: false
      - type: button
        tap_action:
          action: toggle
        entity: switch.sony_9
        name: '9'
        show_icon: false
  - type: horizontal-stack
    cards:
      - type: button
        tap_action:
          action: toggle
        entity: switch.sony_exit
        name: exit
        show_icon: false
      - type: button
        tap_action:
          action: toggle
        entity: switch.sony_0
        name: '0'
        show_icon: false
      - type: button
        tap_action:
          action: toggle
        entity: switch.sony_text
        name: teletext
        show_icon: false
  - type: horizontal-stack
    cards:
      - type: 'custom:button-card'
        styles:
          icon:
            - color: red
        tap_action:
          action: toggle
        entity: switch.sony_red
        icon: 'mdi:card'
        show_name: false
      - type: 'custom:button-card'
        styles:
          icon:
            - color: green
        tap_action:
          action: toggle
        show_name: false
        entity: switch.sony_green_2
        icon: 'mdi:card'
      - type: 'custom:button-card'
        styles:
          icon:
            - color: yellow
        tap_action:
          action: toggle
        entity: switch.sony_yellow
        icon: 'mdi:card'
        show_name: false
      - type: 'custom:button-card'
        styles:
          icon:
            - color: blue
        tap_action:
          action: toggle
        entity: script.sony_blue
        icon: 'mdi:card'
        show_name: false

Hope this helps those trying to create a remote for you TV

6 Likes

My implementation of a “universal remote” in Home Assistant, was simply to use a picture of a Harmony Classic Remote device, and assign actions to each button:

The YAML code associated with this card is too long to paste here, but you’ll find on Pastebin; Harmony Remote YAML - Pastebin.com
In addition, it require a script.yaml that takes care of adapting the key presses dependingon the chosen activity at any time (TV, Radio, Media Libray, Apple TV, etc.). This script is also on Pastebin: Media selector Script - Pastebin.com

Note: I have expanded the code somewhat since this early version, but the principle is the same throughout once you understand how it works.
I have had this for several years now, and never ever had any issues with it. It also works fairly well on a Mobile phone screen - even though the buttons are a bit too small.
Nobody in my household ever bother to look for the remote control anymore. They’ve all got their own copy :blush:

10 Likes

I shared my config here
https://community.home-assistant.io/t/share-your-lovelace-home-theater-remote-setup/119857/68

and here
https://community.home-assistant.io/t/share-your-broadlink-ir-rf-codes/295055

The last one is a topic for sharing Broadlink IR and RF codes, so feel free to add your own Broadlink codes.

1 Like

So i made remake of someone’s from there remote, ad made it kind of easier.
My tv is samsung (without android) with amazon and netflix and unused rakutten:

image

You need simply script (scripts.yaml) and learned tv keys

#script.yaml
tv_command:
  alias: tv_command
  sequence:
  - service: remote.send_command
    target:
      device_id: a18d544471ea9edf3eb9136b31d353f5
  mode: single
  icon: mdi:code-tags-check

Codes (maybe someone will use that)

{
    "version": 1,
    "minor_version": 1,
    "key": "broadlink_remote_a043b0725975_codes",
    "data": {
        "television": {
            "turn on": "JgDSAJKVEjcSOBE4EhMSExEUERQRExI4ETgSOBEUERQRFBETEhMRFBE4EjgRFBEUETgSOBE4EjgRFBQQEjgRORETEhMSExEABgOTlRI4ETgSOBEUERQRExITERQROBI4ETkRExITEhMRFBEUERMSOBE4EhMSExE5ETgSOBE4EhMRFBE4EjgRFBEUERMSAAYDk5USNxI4ETgSExITERQRFBETEjgRORE4ERQRFBEUERMSExEUETkRExITERQRFBETEhMSOBEUETgSOBQ1FDYROBI4EQANBQ==",
            "turn off": "JgDSAJKVEjcSOBE4EhMRFBEUERQRExI4ETkROBEUERQRFBETEhMSExE5ETgRFBEUETgSOBE4EjgRFBEUETgSOBEUERMSExIABgKUlBM3ETkROBITERQRFBEUERMSOBE4EjgRFBEUERMSExITERQROBI4ExIRFBM2EjgROBM3ERQTEhE4EzcTEhETExITAAYBlJUSNxI4ETgSExITERQRFBETEjgRORE4ERQRFBEUERMSExEUETgSExITERQRFBETEhMSOBEUETgSOBE4EjgRORE4EgANBQ==",
            "source": "JgBQAJGVEjgROBI4ERQRFBETEhMRFBE4FDYTNxMRFBETEhMSExITNhMSExITEhMRFBETEhMSExEUNhM3EzYTNxM2FDYTNhQABjwLHgoNChYKAA0F",
            "1": "JgBQAJKVEjcSOBE4EhMSExEUERQRExI4ETkROBEUERQRFBETEhMRFBEUETgSExEUERQRExITETkROBITETkROBI4ETgSOBEABj4KIAgPCBgIAA0F",
            "2": "JgBQAJGVFDYROBI4ERQRFBETEhMSExE5ETgSOBEUERMSExITERQROBITEjgRFBETEhMRFBEUERQROBEUETgSOBE5ETgSOBEABj4KHwwLCRgIAA0F",
            "3": "JgBQAJKUEzcRORQ1EhMRFBEUERMSExI4ETgSOBEUERQRExITFBERFBE4EjgRFBETEhMSExEUETgSExITETkTNhE5FDUSOBEABj4KIAgPCBgIAA0F",
            "4": "JgBQAJKVEjcSOBE5ERMSExITERQRFBE4ETkROBITERQRFBEUERMSExEUERQROBITERQRFBEUETgRORE4EhMRORE4EjgROBIABj4JIAsMCxUJAA0F",
            "5": "JgBQAJKUFDYTNxM2ExITEhMSExEUERM3EzYTNxMSExEUERMSExITNhQRExITNhQRFBETEhMSExIaLxQ2ExEUNhM3EzYTNxMABjwJIAsMCRcJAA0F",
            "6": "JgBQAJGVEjgROBI4ERQRExITERQRFBE4EjgROBITEhMRFBEUERMSExI4ERQROBITERQRFBETEjgRFBE4EhMRORE4EjgROREABj4LHgkOCRcJAA0F",
            "7": "JgBQAJSVEjcSOBE5ERMSExITERQRFBE4EjgROBITERQRFBEUERMSExEUETgSOBEUERQRExITEjgROBITERQRORE4ETkROBIABj4JIAkOCBgJAA0F",
            "8": "JgBQAJKUEzcRORE4ERQRFBEUERMSExE5ETgSOBEUERMSExITERQROBITEjgROBITERQRFBETEhMSOBEUERMSOBE5ETgSOBEABj4KHwkOCRcJAA0F",
            "9": "JgBQAJGVEjgROBI4ERQRExITEhMRFBE4EjgROBITEhMRFBEUERMSExI4ETgSOBEUERQRExITEjgRFBETEhMRORE4EjgROBIABj4JIAsMCBgIAA0F",
            "ttx": "JgBQAJGVFDYROBI4ERQRFBETERQRFBE4EzcRORETEhMRFBEUERMSExITETkROBITETkRExQREjgROBITEhMRORETEjgROREABj4JIAkOCRcJAA0F",
            "0": "JgBQAJGVEjgROBE5ERMSExITERQRFBE4EjgROBITFBERFBQRERMSOBEUERMSExI4ERQRExITEhMRORE4ETkRFBE4ETkROBIABj4JIAsMCBgIAA0F",
            "prech": "JgBQAJGVEjgROBI4ERQRFBETEhMRFBE4EjgRORETEhMSExEUERQROBE5ERQRFBE4ERQRExITEhMRFBE4EjgRFBE4EjgROBIABj4LHgkOCBgIAA0F",
            "vol_up": "JgBQAJKVEjcSOBE4EhMRFBEUERQRExI4ETgSOBEUERQRExITEhMRORE4EjgRFBETEhMRFBEUERQRExITETkROBI4ETgSOBEABj8KHwsMChYKAA0F",
            "vol_down": "JgBQAJKVEjgROBI4ERQRFBETEhMRFBE4EjgRORETEhMRFBEUERQROBE5ERMSOBEUERQRExITERQRFBE4EhMRORE4EjgROBIABj4LHggPCBgIAA0F",
            "mute": "JgBGAJOTEzcROBI4ERQTEhETExISExM3EjcTNxMSEhITEhMSExITNhM3EzYTNxMSExITERMSExITEhMSExETNxM2EzcTNxMADQU=",
            "chlist": "JgBQAJKVEjcSOBE5ERMSExITFBERFBE4ETkROBITERQRFBETEhMSOBE4EhMSOBEUETgSOBEUERMSExE5ERMSOBEUERQROBIABj4JIAgPCBgIAA0F",
            "ch_up": "JgBQAJOTEzcTNhM3ExITERQRFBETEhM2FDYTNhQRExITEhMSExEUERM3ExITERQ2ExITEhMRFDYTEhM2FDYTEhM2EzcTNhQABjwLHggPCBgIAA0F",
            "ch_down": "JgBQAJKVETgRORE4EhMRFBEUERMTEhE5ETgSOBEUERQRExITERQRFBETEhMSFQ85ERMSExITETkROBI4ETgSExE5ETgSOBEABj8JHwkOCRcJAA0F",
            "netflix": "JgBQAJKVEjcSOBE4EhMSExEUERQRExI4ETkROBEUERQRFBETEhMRORE4EhMRFBE4EjgRORE4EhMRFBE4EjgRFBEUERMSExEABj8IIQgPCBgIAA0F",
            "home": "JgBQAJGVEjgROBI4ERQRFBETEhMRFBE5ETgRORETEhMSExEUERQROBIXDRQROBI4ETkROBEUERQROBI4ERQRFBETEhMROREABj4LHgkOCRcJAA0F",
            "prime": "JgBQAJOTFDUUNhM3ExEUERMSExITEhM2EzcTNhYPExITEhMRFBETEhMSEzYUERM3EzYUNhM2FDYTNxMRFDYTEhMSExETEhMABjwKIAoMCRgIAA0F",
            "rakuten": "JgBQAJKTEzgRORE4ERQRFBEUERMSExI4ETgSOBEUERMSExITERQRFBETEjgROBI4ETkRExI4ETkROBEUERQRExITEjgRFBEABj4JIAsMCBgJAA0F",
            "up": "JgBQAJGVEjgROBM3ExITERMSERQTEhE4EzcTNhITEhMRFBEUERMSExEUExITEhMRFDYTNhQRFDYTNhQ2EzcTNhMSExITNhQABjwLHgkOCBgJAA0F",
            "guide": "JgBQAJKUEjgRORE4EhMRFBEUERMSExE5ETgSOBEUExISEhMSExITNhM3EzYUNhMSExITNhMSExITEhMRFBETNxM2FBETNxMABjwJIAkOCRcJAA0F",
            "left": "JgBQAJKVFDUSOBE4EhMSExEUERQRExI4FDUSOBQRERQRExITEhMRORETEjgRFBEUEzYRORETEhMSOBEUETgUNhETEhMSOBEABj8JHwkOCRcJAA0F",
            "ok": "JgBQAJGVEjgROBI4ERQRExITEhMRFBE4EjgRORETEhMSExEUERQRExITEhMRORETEjgRORETEjgROBI4ERQROBITEhMROREABj4JIAkOCRcJAA0F",
            "right": "JgBQAJKUFDYRORQ1EhMSExEUERMSExI4ETgSOBEUERQRExITERQRFBE4EhMRFBITETgSOBEUETgSExE5ETgSOBEUERMSOBEABj8JIAgPCBgIAA0F",
            "return": "JgBQAJGVEjgROBI4ERQRFBETEhMRFBE4EjgRORETEhMSExEUERQRExITEhMRORE4ERQROBITEjgROBI4ERQRFBE4ERQROREABj4JIAkOCBgIAA0F",
            "down": "JgBQAJGVEjgROBI4ERQRFBETEhMRFBE4EjgRORETFRASExEUERQROBEUERQRExITEjgROBITERQRORE4ETkROBITERQROBIABj4JIAgPCBgIAA0F",
            "exist": "JgBQAJOTFDYTNhQ2ExITEhMRFBETEhM2FDYTNxMRFBETEhMSExITNhMSEzYUNhMSEzYUERMSExITNhQRExITNxMREzcTNhQABjwKHw0KChYKAA0F",
            "settings": "JgBQAJGVEjgROBI4ERQRExITEhMRFBE4EjgRORETEhMRFBEUERQRExI4ERQROBI4ERQRExITEjgRFBE4EhMRFBE4EjgROREABj4KHwkOCRcJAA0F",
            "info": "JgBQAJGVEjgROBI4ERQRFBETEhMRFBE5ETgRORETEhMSExEUERQROBI4ETgSOBE5ERMSExEUERQRFBETEhMRFBE4EjgROREABj4LHgkOCRcJAA0F",
            "sub": "JgBQAJKVEjcSOBE5ERMSExEUERQRFBE4ETkROBITERQRFBETEhMROREUETgRFBEUETgTEhMSExITNhMSEzcTNhMSEzcTNhMABjwKIAgOCRgIAA0F",
            "stop": "JgBQAJKUEzcRORE4ERQRFBEUERMSExE5ETgSOBEUERMSExITERQRFBE4EjgRFBETEhMUNhEUETgSExEUETgSOBE4EhMSOBEABj8JIAgOCRgIAA0F",
            "rewind": "JgBQAJKVEjcSOBE4EhMSExEUERQRExI4ETkROBEUERQRFBETEhMRORETEjgRFBEUERMSOBEUERQROBITETkROBI4ERQROBIABj4JIAkOCRcJAA0F",
            "play": "JgBQAJGVEjgROBE5ERMSExITERQRFBE4EjgROBITEhMRFBEUERMSOBE5ETgRFBEUERQROBEUERQRExITEjgROBI4ERQROBIABj8JHwkPCBcJAA0F",
            "pause": "JgBQAJGVEjgROBI4ExIRFBMRExITEhM2FDYTNxMRFBETEhMSExITERQ2ExITNhMSExITNhQREzcTEhM2ExITNhQ2ExIROBIABj4JIAkOCRcJAA0F",
            "wind": "JgBQAJKUEzcRORE4EhMRFBEUERMSExI4ETgSOBEUERQRExITERQRFBETEhMSOBEUERMSOBEUETgSOBE5ERMSOBE4EhMSOBEABj8JIAgOCRgIAA0F"
        }
    }
}

and finally lovelace card:

      - entities:
          - entity: script.tv_command
            icon: mdi:power
            name: ' '
            tap_action:
              action: call-service
              service: remote.send_command
              target:
                device_id: a18d544471ea9edf3eb9136b31d353f5
              service_data:
                command: turn on
                device: television
          - entity: script.tv_command
            icon: mdi:aws
            name: ' '
            tap_action:
              action: call-service
              service: remote.send_command
              target:
                device_id: a18d544471ea9edf3eb9136b31d353f5
              service_data:
                command: prime
                device: television
          - entity: script.tv_command
            icon: mdi:netflix
            name: ' '
            tap_action:
              action: call-service
              service: remote.send_command
              target:
                device_id: a18d544471ea9edf3eb9136b31d353f5
              service_data:
                command: netflix
                device: television
          - entity: script.tv_command
            icon: mdi:open-source-initiative
            name: ' '
            tap_action:
              action: call-service
              service: remote.send_command
              target:
                device_id: a18d544471ea9edf3eb9136b31d353f5
              service_data:
                command: source
                device: television
          - entity: script.tv_command
            icon: mdi:nintendo-switch
            name: ' '
            tap_action:
              action: call-service
              service: remote.send_command
              target:
                device_id: a18d544471ea9edf3eb9136b31d353f5
              service_data:
                command: netflix
                device: television
          - entity: script.tv_command
            icon: mdi:volume-off
            name: ' '
            tap_action:
              action: call-service
              service: remote.send_command
              target:
                device_id: a18d544471ea9edf3eb9136b31d353f5
              service_data:
                command: mute
                device: television
          - entity: script.tv_command
            icon: mdi:home
            name: ' '
            tap_action:
              action: call-service
              service: remote.send_command
              target:
                device_id: a18d544471ea9edf3eb9136b31d353f5
              service_data:
                command: home
                device: television
          - entity: script.tv_command
            icon: mdi:chevron-up-box-outline
            name: ' '
            tap_action:
              action: call-service
              service: remote.send_command
              target:
                device_id: a18d544471ea9edf3eb9136b31d353f5
              service_data:
                command: up
                device: television
          - entity: script.tv_command
            icon: mdi:play-pause
            name: ' '
            tap_action:
              action: call-service
              service: remote.send_command
              target:
                device_id: a18d544471ea9edf3eb9136b31d353f5
              service_data:
                command: play
                device: television
          - entity: script.tv_command
            icon: mdi:stop
            name: ' '
            tap_action:
              action: call-service
              service: remote.send_command
              target:
                device_id: a18d544471ea9edf3eb9136b31d353f5
              service_data:
                command: stop
                device: television
          - entity: script.tv_command
            icon: mdi:volume-plus
            name: ' '
            tap_action:
              action: call-service
              service: remote.send_command
              target:
                device_id: a18d544471ea9edf3eb9136b31d353f5
              service_data:
                command: vol_up
                device: television
          - entity: script.tv_command
            icon: mdi:chevron-left-box-outline
            name: ' '
            tap_action:
              action: call-service
              service: remote.send_command
              target:
                device_id: a18d544471ea9edf3eb9136b31d353f5
              service_data:
                command: left
                device: television
          - entity: script.tv_command
            icon: mdi:checkbox-blank-circle-outline
            name: ' '
            tap_action:
              action: call-service
              service: remote.send_command
              target:
                device_id: a18d544471ea9edf3eb9136b31d353f5
              service_data:
                command: ok
                device: television
          - entity: script.tv_command
            icon: mdi:chevron-right-box-outline
            name: ' '
            tap_action:
              action: call-service
              service: remote.send_command
              target:
                device_id: a18d544471ea9edf3eb9136b31d353f5
              service_data:
                command: right
                device: television
          - entity: script.tv_command
            icon: mdi:rewind
            name: ' '
            tap_action:
              action: call-service
              service: remote.send_command
              target:
                device_id: a18d544471ea9edf3eb9136b31d353f5
              service_data:
                command: rewind
                device: television
          - entity: script.tv_command
            icon: mdi:volume-minus
            name: ' '
            tap_action:
              action: call-service
              service: remote.send_command
              target:
                device_id: a18d544471ea9edf3eb9136b31d353f5
              service_data:
                command: vol_down
                device: television
          - entity: script.tv_command
            icon: mdi:undo
            name: ' '
            tap_action:
              action: call-service
              service: remote.send_command
              target:
                device_id: a18d544471ea9edf3eb9136b31d353f5
              service_data:
                command: return
                device: television
          - entity: script.tv_command
            icon: mdi:chevron-down-box-outline
            name: ' '
            tap_action:
              action: call-service
              service: remote.send_command
              target:
                device_id: a18d544471ea9edf3eb9136b31d353f5
              service_data:
                command: down
                device: television
          - entity: script.tv_command
            icon: mdi:closed-caption
            name: ' '
            tap_action:
              action: call-service
              service: remote.send_command
              target:
                device_id: a18d544471ea9edf3eb9136b31d353f5
              service_data:
                command: sub
                device: television
          - entity: script.tv_command
            icon: mdi:fast-forward
            name: ' '
            tap_action:
              action: call-service
              service: remote.send_command
              target:
                device_id: a18d544471ea9edf3eb9136b31d353f5
              service_data:
                command: wind
                device: television
        show_state: false
        title: Samsung TV
        type: glance
        state_color: false

Also its my remote:

4 Likes

This is very nice, congratulation. By any chance, did you share the code somewhere. I’d like to see how you were able to adapt @tom_l code

1 Like

Sorry to dig up this year old post, but I like this and have spent a bit this morning trying to replicate much of it in my setup. Question I have for you, as I’m not very good with templating.

What is the purpose in the scripts where you are changing “Get-TV” to “Get GB”? Or similarly, “Apple-TV” to “Apple TV”? My state_attr for current activity in Dev Tool appear to match the direct names. IE. “Apple TV” in state_attr. current_activity is named the same as in the harmony.conf file.

I guess what I’m really asking (or hoping for) is there a way I can just set device: in the scripts to = the current activity?

Once I get this up and going, I hope to also add in long button press for the Activities, and then will need to expand the scripts to include this as well.

Oh, this is just because when I first set up the Harmony HUB, I chose one set of names, and years later, when I set up Home Assistant integrations, I named the same devices slightly different.
Eventually, when I later decided to integrate the two (HA & Harmony HUB), I didn’t bother to change the names again.

Hi! Had some questions about your remote card. I’ve been using your old version with the tiles card and it still works well but was looking to start trasnsitioning to the button card. How did you get the coloring different between the title at the top and the rest of the card? Is it just a background image? I set up a few buttons to test out. I noticed that it works differrently than the tiles card, The tiles card is very responsive. If I press the button quickly 3 times the command is sent all 3 times to my harmony hub. With the custom button card it needs time between presses. Is there a way to adjust this? Can you use custom icons or only the mdi icons?

Hey Tom,

When you say enter them at the top of raw edit mode, where are you referring to?

When you are editing the card, there is an option in the bottom left called “show code editor” where you can edit the raw yaml that makes the card work:

I see show code editor, but what card are you starting with? Entities card?

Actually the raw editor is accessed by clicking the three dots icon in the top right of your dashboard twice.

First press to get into edit mode:

1

Then when in edit mode press the three dots again to select raw edit mode:

2

You will then see the raw edit mode where you can paste the templates at the top of the existing config:

Press Save when done.

I use custom:button-card

Here’s some code to start you off…

1 Like

If you used custom:button-card and button card templates you could reduce that code by 80% as it mostly repeats the same thing over and over.

See post here Vizio TV Integration - #35 by 0rchid2434

Most of the code is posted here: https://github.com/kbrown01/Vizio_DirecTV

1 Like

I finally finished the GUI part of my remote.
Here as an inspiration for some others.

5 Likes

Is there a way to get this as simple as possible in the UI? Like a card that could be configured.
That would be great.