louis49 / homebridge-plugin-androidtv

MIT License
24 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 10 months ago

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

kiwi-cam commented 5 months 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"
        }
rafacampoamor commented 4 months ago

Not working for me. Nor the keycode, nor the webhook 😭

Create Remote {"remoteKeyInject":{"keyCode":245,"direction":3}}
Sending {"remoteKeyInject":{"keyCode":"KEYCODE_TV_INPUT_HDMI_3","direction":"SHORT"}}
[7/26/2024, 10:35:20 PM] [homebridge-androidtv] Smart TV Tap on KEYCODE_TV_INPUT_HDMI_3 245
[7/26/2024, 10:35:20 PM] [homebridge-androidtv] Smart TV set Active Identifier => setNewValue: 5
[7/26/2024, 10:35:20 PM] [homebridge-androidtv] Smart TV get Active true
[7/26/2024, 10:35:21 PM] [homebridge-androidtv] Smart TV get Active true
Create Remote {"remoteKeyInject":{"direction":3}}
Sending {"remoteKeyInject":{"direction":"SHORT"}}
[7/26/2024, 10:35:32 PM] [homebridge-androidtv] Smart TV Tap on content://android.media.tv/passthrough/com.mediatek.tvinput%2F.hdmi.HDMIInputService%2FHW7 undefined
[7/26/2024, 10:35:32 PM] [homebridge-androidtv] Smart TV set Active Identifier => setNewValue: 4

Any clue?