I can’t get the above to work sadly, the service just restarts and doesn’t change input.
Now, I have installed Alexa on the TV and she can only change the HDMI input with voice aswell, can’t do it in a routine (sigh) but i was monitoring the log as saw she used an MQTT message to do it
10-15 10:39:25.993 6785 13554 I AWSIotMqttManager: message arrived on topic: prod/000068070a268a81
10-15 10:39:25.994 6785 13547 D IoTMessengerService: Message arrived:
10-15 10:39:25.994 6785 13547 D IoTMessengerService: Topic: prod/000068070a268a81
10-15 10:39:25.994 6785 13547 D IoTMessengerService: Message: {"input":"HDMI 2","command-id":"6ae46719-2b87-429b-800a-b7f0bc9af392"}
10-15 10:39:25.996 6785 13547 D InputController: doTune input =hdmi2
Is there a way to connect to Alexas MQTT broker and broadcast the same message?
Can you use the learn_sendevent service to capture button presses, then manually send them in order to scroll through the HDMI sources?
If so, then you could setup a script or ADB command that checks the HDMI source via dumpsys activity starter | grep -o "HW[0-9]" | head -n 1 (source) and scrolls through the sources until you get to the desired input.
@AlexanderK79 This is perfect! thank you! also thank you for replying on Stackoverflow aswell.
@JeffLIrion is it worthwhile adding this to the addon? perhaps as alternative for people who can’t get the HDMI commands to work? (specifically Philips 2020 model TVs)
And thank you to everyone else who helped along the way
I don’t think all Android TV / Fire TV devices support changing the HDMI input, so at this time I won’t add it to the androidtv package. Also, the Home Assistant integration already uses apps as sources, so another service would need to be added to allow changing the HDMI input. At least for now, I think that using the androidtv.adb_command service with this command is an acceptable solution.
Thank you AlexanderK79! I searched very long. Because also on the logitech harminy the direct choose of hdmi1 wasn’t working after the last update from philips. I don’t understand this, why do they forbid to change the source directly?
So now I can build something for my family that they can watch TV without problems.
I’m trying to do the same thing for my TCL Android TV and JBL Link Bar (also runs Android TV). Does anyone have any experience with either of these platforms?
Hello,
I’m have the same problem, but any answer not work…
When i use comannd:
adb shell am start -a android.intent.action.VIEW -d content://android.media.tv/passthrough/com.mediatek.tvinput%2F.hdmi.HDMIInputService%2FHW5 -n org.droidtv.playtv/.PlayTvActivity -f 0x10000000
I have this error:
Error: Activity class {org.droidtv.playtv/org.droidtv.playtv.PlayTvActivity} does not exist.
Can you help me?
I had the same problem. I ran ADB logcat and found the command to be a little different. “adb shell am start -a android.intent.action.VIEW -d content://android.media.tv/passthrough/com.droidlogic.tvinput%2F.services.Hdmi1InputService%2FHW5” Even then I still got the same error as you. I then deleted “-n org.droidtv.playtv/.PlayTvActivity -f 0x10000000” It then changed inputs no problem.
Did you have any luck with controlling your TCL TV in the end?
I’m trying to do the same myself and it’s popping up with the toast notification saying what the current input is but not changing inputs
Same. Using this command "adb shell am start -a android.intent.action.VIEW -d content://android.media.tv/passthrough/com.droidlogic.tvinput%2F.services.Hdmi1InputService%2FHW5”…it shows me the current input, but regardless of what I change HW5 to…it doesn’t change.
I know ADB is working, because I can power the TV on demand.
I have a TCL 6-series, by the way.