louis49 / homebridge-plugin-androidtv

MIT License
18 stars 12 forks source link

HDMI Switching fix #49

Open Enderstorm25 opened 1 year ago

Enderstorm25 commented 1 year ago

using the Keycodes : KEYCODE_TV_INPUT_HDMI_1 sends correctly via home bridge but does not change the source on the TV.

Homebridge Logs :

Create Remote {"remoteKeyInject":{"keyCode":243,"direction":3}}
Sending {"remoteKeyInject":{"keyCode":"KEYCODE_TV_INPUT_HDMI_1","direction":"SHORT"}}
[2/26/2023, 5:57:51 PM] [HomebridgeAndroidTV] Living Room TV Tap on KEYCODE_TV_INPUT_HDMI_1 243
[2/26/2023, 5:57:51 PM] [HomebridgeAndroidTV] Living Room TV set Active Identifier => setNewValue: 2

I find when I use these command via ADB shell the input changes successfully on the Android TV :

HDMI1:

adb shell am start -a android.intent.action.VIEW -d content://android.media.tv/passthrough/com.droidlogic.tvinput%2F.services.Hdmi1InputService%2FHW5

HDMI2:

adb shell am start -a android.intent.action.VIEW -d content://android.media.tv/passthrough/com.droidlogic.tvinput%2F.services.Hdmi2InputService%2FHW6

HDMI3:

adb shell am start -a android.intent.action.VIEW -d content://android.media.tv/passthrough/com.droidlogic.tvinput%2F.services.Hdmi3InputService%2FHW7

Could you add this into the plugin ?

Treviko commented 1 year ago

Same problem here :(

louis49 commented 1 year ago

Some other bugs reports tells about this problem. It seems that Android TV change the way of calling features. I need to find time to investigate this

Bernix01 commented 5 months ago

hello, any updates on this? I couldn't find a workaround

kiwi-cam commented 2 weeks ago

I've had success getting HDMI input selection working using this:

    "applications": [
        {
            "name": "Bluray",
            "link": "content://android.media.tv/passthrough/com.mediatek.tvinput%2F.hdmi.HDMIInputService%2FHW5"
        },
        {
            "name": "AppleTV",
            "link": "content://android.media.tv/passthrough/com.mediatek.tvinput%2F.hdmi.HDMIInputService%2FHW6"
        },
        {
            "name": "PS3",
            "link": "content://android.media.tv/passthrough/com.mediatek.tvinput%2F.hdmi.HDMIInputService%2FHW7"
        }