Homekit Multiple TVs Remote Widget

Hi there

Is there any way to make the Remote Widget work for multiple TVs, as its now possible with multiple homekit instances?

I did try it with homekit_tv_remote_key_pressed and automations, where I did set conditions depending on which TV is turned on, to trigger the correct command for the correct TV, but it does not work.

I was able to track it down, that only the first configured device is firing up homekit_tv_remote_key_pressed.

Is there any solution or is there a update planned?

To have multiple remotes with HomeKit, you will need to span the media_player entities between different bridges. Then, set up some automations to bind the homekit_tv_remote_key_pressed event to each integration’s approach. Here’s one I made for the LG webOS integration, for example.

1 Like

thanks for your code. did adjust it to my devices, but still, only the LG remote does work.

I did try the developer tools and firing the event manually shows that my automation does work. Listening on the other hand for homekit_tv_remote_key_pressed shows, that only the LG remote does fire events and the other remotes do not.

The other 2 devices are harmony media players based on the remote add-on, which does work (Incl. volume control). Could there be another limitation?

Automation

  - alias: Call guestroom.button on HomeKit Remote key presses
    trigger:
        event_data:
            entity_id: media_player.guest_room_tv
        event_type: homekit_tv_remote_key_pressed
        platform: event
    action:
        data_template:
          command: "{% set key_map = {'arrow_right': 'DirectionRight', 'arrow_down' : 'DirectionDown', 'arrow_left':
            'DirectionLeft', 'arrow_up': 'DirectionUp',  'select': 'Select', 'back': 'BACK', 'information':
            'Info'} %} {{ key_map[trigger.event.data['key_name']] }}"
          entity_id: remote.harmony_gaestezimmer
          device: 65667640
        service: remote.send_command

Homekit Device

- platform: universal
  name: Guest Room TV
  commands:
    turn_on:
      service: remote.turn_on
      entity_id: remote.harmony_gaestezimmer
      data:
        activity: Fernsehen
    turn_off:
      service: remote.turn_off
      entity_id: remote.harmony_gaestezimmer
    volume_up:
      service: remote.send_command
      entity_id: remote.harmony_gaestezimmer
      data:
          device: 65667640
          command: VolumeUp
    volume_down:
      service: remote.send_command
      entity_id: remote.harmony_gaestezimmer
      data:
          device: 65667640
          command: VolumeDown
    select_source:
      service: remote.turn_on
      data_template:
        entity_id: remote.harmony_gaestezimmer
        activity: >-
          {% if source == 'Fernsehen' %}
            Fernsehen
          {% elif source == 'Apple TV' %}
            Apple TV sehen
          {% else %}
            Fernsehen
          {% endif %}
  attributes:
    state: remote.harmony_gaestezimmer
    source: input_select.guest_room_tv