Open elupus opened 3 years ago
@elupus How did you find these? I'm trying to dig and see if there's an endpoint (or via Android) to get the current HDMI input. Are you aware of any such functionality?
You can extract the xtv.apk package from an android tv and dissassemble it. You get most sourcecode back.
There is no endpoint for hdmi source sadly. Should be possible to get if one writes their own android app thou.
You can trigger a switch to hdmi source using an intent.
@idantene, I agree with @elupus: there are no HDMI source endpoints and writing your own Android app is probably the best way to get this info reliably.
Alternatively, you can write a simple script to query the system logs via adb:
adb shell dumpsys activity starter | grep -o "HW[0-9]" | head -n 1
- this will return something like "HW1" or "HW9" depending on which HDMI source is active. The only downside is that this gets written only when you change a source (so if you turn on the TV without changing the source it won't return anything).
Thanks @elupus and @eslavnov!
The adb
solution was what I had so far - it is unfortunately also unreliable if you change the HDMI source via other interactions (that is, the HW[0-9]
works fine if the input is changed via the remote, but does not if it is changed via HA's media_player
component).
But alas - if it is not available by default, I will make my own workarounds within HA 👍🏻 Thank you for your suggestions and time!
Thanks @elupus and @eslavnov!
The
adb
solution was what I had so far - it is unfortunately also unreliable if you change the HDMI source via other interactions (that is, theHW[0-9]
works fine if the input is changed via the remote, but does not if it is changed via HA'smedia_player
component).But alas - if it is not available by default, I will make my own workarounds within HA 👍🏻 Thank you for your suggestions and time!
Has anyone meanwhile found a way to know what source the TV would be on? Seems pretty ridiculous that this basic functionality is hidden so far away.
Is your feature request related to a problem? Please describe. I found some new endpoints that might be worth documenting. No idea what they are, but wanted to write them down:
/6/context
/6/channeldb/servermapping/X
/6/channeldb/tv/channelLists/{channel_list}/{ccid}/logo
/6/recordings/list
/6/recordings/refresh
/6/reminder/list
/6/input/textentry
/6/input/pointer
/6/input/onscreenkeyboard/visible
/6/companionlauncher/launch_request_details
/6/companionlauncher/launch_response
/companionlauncher/registration