Android TV HDMI

I was in here looking for how to do this exact same thing on the exact same hardware! Just wondering, did you have any luck since posting on how to get the XGIMI Horizon Ultra to switch Hdmi inputs using ADB commands?

(I’m a relative noob to scripting stuff, just hoping to overcome the limitation of the remote which doesn’t have a dedicated input change button on it)

Hi Jakub,

I never did work out how to get the XGIMI Horizon Ultra to switch Hdmi inputs using ADB commands. I feel like it should be possible in theory, but in practise nothing I tried worked. I’d be happy to know if someone had more success.

Matthew

How do i use this? What command do i need to use? And where to execute it?

Just for anyone who happens to need it (including me in a month when I forget and need to do it again), this is the command for a TCL C855 HDMI1:

adb shell am start -a android.intent.action.VIEW -d content://android.media.tv/passthrough/com.tcl.tvinput%2F.TvPassThroughService%2FHW15

I have a weird problem. On my TCL tv, if I use the correct HDMI command above it does change input no problem. However, if I manually change the input (using remote) it does NOT update ADB at all meaning that they are not in sync. Any solution? Thanks

I was unable to find a reliable way to change the input to HDMI 1 on my TCL 65QM850G Google TV using an adb shell command with the Android Debug Bridge integration in Home Assistant.

I was able to control many other TV features using it, but just not change the TV’s input to HDMI 1.

So I regressed to just simulating remote key-presses using HA’s Android TV Remote integration.

Fortunately, the TCL/Google TV input selector doesn’t allow “wrapping around”, so my script sends left one time more than the total number of input options displayed, which leaves it at the far left end.
Then I send right once to land on Input HDMI 1. Your counts will likely vary.
Here’s my UI-generated yaml as copied from scripts.yaml:

living_room_tv_hdmi_1:
  alias: Living room TV HDMI 1
  sequence:
  - action: remote.send_command
    target:
      entity_id: remote.living_room_tv
    data:
      command: HOME
  - action: remote.send_command
    metadata: {}
    data:
      command: F3
    target:
      entity_id: remote.living_room_tv
  - action: remote.send_command
    metadata: {}
    data:
      num_repeats: 5
      command: DPAD_LEFT
    target:
      entity_id: remote.living_room_tv
  - action: remote.send_command
    metadata: {}
    data:
      command: DPAD_RIGHT
    target:
      entity_id: remote.living_room_tv
  - action: remote.send_command
    metadata: {}
    data:
      command: ENTER
    target:
      entity_id: remote.living_room_tv
  mode: single
  icon: mdi:television

Sadly neither did I, it’s a real pitty because all the software tech is there without needing to go any other router (like using HDMI-CEC or) but we’re missing a way to know what message to type.

Incidentally, I did look into a different way to switch ports better via installing a different launcher software that removes the bloat of all those adds. But sadly that too had issues pinging the hardware to change hdmi ports.

работает на TCL 85P737. Спасибо!

action: androidtv.adb_command
data:
command: “am start -a android.intent.action.VIEW -d content://android.media.tv/passthrough/com.tcl.tvinput%2F.passthroughinput.TvPassThroughService%2FHW1413744128”
target:
entity_id: media_player.android_tv_192_168_199_11

HDMI1

adb shell am start -a android.intent.action.VIEW -d content://android.media.tv/passthrough/com.tcl.tvinput%2F.passthroughinput.TvPassThroughService%2FHW1413744128

HDMI2

adb shell am start -a android.intent.action.VIEW -d content://android.media.tv/passthrough/com.tcl.tvinput%2F.passthroughinput.TvPassThroughService%2FHW1413744384

HDMI3

adb shell am start -a android.intent.action.VIEW -d content://android.media.tv/passthrough/com.tcl.tvinput%2F.passthroughinput.TvPassThroughService%2FHW1413744640

HDMI4 - у меня нет

I am in the same situation with a TCL 65C845 (Android 12). Sending HDMI key codes does not work and I began the ADB journey but noted that some streaming applications had problems with logging in when in debug mode. I will try to pinpoint if that really is the case or if it was a temporary glitch, but can it indeed be the case that applications know when debug mode is on?

Anyhow, I found another potential solution that seems to work for my TV set. The Android TV application Go to HDMI1 input by mpiero actually works! He (assuming here…) has corresponding applications for switching to other inputs as well, but many of them cost money, smart move :grinning:! I use the following card snippet then:

        tap_action:
          action: perform-action
          perform_action: remote.turn_on
          data:
            activity: com.mpiero.android.tvhdmi1
          target:
            entity_id: remote.smart_tv_pro

I’m not sure how this app is implemented. Could there be a general API in Android TV for controlling video sources? This then begs the question whether a backend app for Android TV and home assistant extended control could then be developed!