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)
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.
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.
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:
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.
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
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 ! I use the following card snippet then:
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!