eslavnov / pylips

Control Philips TVs (2015+) and Ambilight (+ Hue) through their reverse-engineered API (+ MQTT support!)
MIT License
334 stars 58 forks source link

[FEAT] Some new found endpoints to document #103

Open elupus opened 3 years ago

elupus commented 3 years ago

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

{'data': 'NA',
 'level1': 'WatchExtension',
 'level2': 'Playstate',
 'level3': 'NA'}

/6/channeldb/servermapping/X

'channelList': {'id': '1', 'version': 8}, 'channels': [], 'version': '-2'}

/6/channeldb/tv/channelLists/{channel_list}/{ccid}/logo

PNG image for channel. Strangely there exists logos's for applications on some ccid's 

/6/recordings/list

{'recordings': []} # don't have anything recorded so can't say how it looks

/6/recordings/refresh

Unsure. probably a post request

/6/reminder/list

{'recordings': []} # don't have anything recorded so can't say how it looks

/6/input/textentry

Unsure. I would expect a post of text entry data

/6/input/pointer

{'status': 'disabled'}

/6/input/onscreenkeyboard/visible

{'visible': 'hide'} # probably also postable

/6/companionlauncher/launch_request_details

Unsure. might need device_id and msg_id data

/6/companionlauncher/launch_response

Unsure. Empty here, likley linked to above

/companionlauncher/registration

idantene commented 2 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?

elupus commented 2 years ago

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.

eslavnov commented 2 years ago

@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).

idantene commented 2 years ago

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!

Misterke commented 1 year ago

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!

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.