Philips Android TV component

@matiaszon check out some advice on adb in this issue: https://github.com/eslavnov/android-tv-remote/issues/1

The last comment mentions your TV model and apperantly you need to restart the TV after enabling debugging mode.

Thank you for your reply, but it didn’t help. I guess it needs connecting something via USB first.

Took a look at the API’s source code (for Android models) and indeed this endpoint does not take data and flag arguments - don’t waste your time trying to pass them…

Hi,
Could you manage it? I’m also looking for a solution for 32PFH5500.

Hi. Are there any solution for the TURN ON problem.
This component work really gut, I only one problem. After i turn it off, sometimes (unfortunatelly very often) it became “unknown” state, so can’t be wake.

I read the thread more times, but did’t find any help for this. Are there any solution?? Thanks

I just tested:

{
        "extras": { "query": "HDMI 4" },
        "action": "Intent {  act=android.intent.action.ASSIST cmp=com.google.android.katniss/com.google.android.apps.tvsearch.app.launch.trampoline.SearchActivityTrampoline flg=0x10200000 }", 
        "component": {
            "packageName": "com.google.android.katniss",
            "className": "com.google.android.apps.tvsearch.app.launch.trampoline.SearchActivityTrampoline"
        }
    }

On the activities/launch endpoint and it did switch to HDMI 4 as expected. It did however not trigger the CEC command to turn on the device oddly enough.

This is enough for search activity for port:

{
        "extras": { "query": "HDMI 4" },
        "action": "android.intent.action.ASSIST",
        "component": {
            "packageName": "com.google.android.katniss",
            "className": "com.google.android.apps.tvsearch.app.launch.trampoline.SearchActivityTrampoline"
        }
    }

In the other examples some strange encoded data have been added to the action field. This is not handled by the code and just seem to be ignored.

Also maybe somebody with more android knowhow than me might be able to get the ACTION_MEDIA_BUTTON intent working with the KEYCODE_F1 or KEYCODE_TV_INPUT_HDMI_1. I’ve yet to figure out how to generate such an intent in json form. It’s fully possible that it can’t be done. but…

And we have liftoff!! Turned out there was another action supported by the PlayTvActivity on at least 2020 philips android tv’s: “org.droidtv.playtv.SELECTURI”

This takes the uri as an extras parameter instead. And this happens to be supported by the jointspace XTV app!

        "extras": { "uri": "content://android.media.tv/passthrough/com.mediatek.tvinput%2F.hdmi.HDMIInputService%2FHW8" },
        "action": "org.droidtv.playtv.SELECTURI",
        "component": {
            "packageName": "org.droidtv.playtv",
            "className": "org.droidtv.playtv.PlayTvActivity"
        }

So i’ve gotten the internal philips component up to date on v6 tv. But god damn the philips API’s are buggy. Anyway…

Feel free to give it a try if you are able to. https://github.com/home-assistant/core/pull/46422.

3 Likes

Is there a community thread for the internal component? I want to know how to set it up, more specifically how you can get a channel list in the media player instead of selecting HDMI inputs.

You press the browse button on the card.

Joakim, just been looking through your commits for the Philips TV integration and it looks fantastic - really excellent work, looking forward to seeing my OLED804 being more tightly integrated with HA and hoping the new play/pause controls allow some third-party HomeKit interactivity that Philips refuse to implement!

I have been using @jomwells Ambilight integration (https://github.com/jomwells/ambilights) for controlling my Ambilights but the project has not seen any updates in a long time. Are you considering adding Ambilight control into your new integration? If not I was thinking of having a go at it myself but am extremely inexperienced when it comes to python :slight_smile:

@ajoyce

You can grab a zip here that you can test as a custom component:

https://minhaskamal.github.io/DownGit/#/home?url=https://github.com/elupus/home-assistant/tree/philips_js_light/homeassistant/components/philips_js

It allow control of the tv, it does not expose the tv measurements.

1 Like

Oh man, you’re awesome. Will definitely test this out!

When using the addon that had the channels in the source list, I could create shortcut buttons to change the channel (in mini media player):
- image: /local/channellogo.png
type: source
id: “Channel name”
Can I do something similar now?

Yes.

You need to create them with the play_media service instead. With media_type=channel och media_id=channel_ccid

Thanks, I’ll look into that.

Edit: got it working, but the background/accent colors are different for some reason.

What’s the difference to the current philips android tv component?

I don’t quite get what kind of a PIN I have to enter during the setup process?

In the integrated Philips TV component, the PIN is displayed on the TV screen and you enter it in HA.
I have one problem. If I select HDMI 1 source (when using developer tools), the TV (Philips 65oled804) will switch to VCR. HDMI 2 - 4 work well.
You may need a different name, but there is nothing in the documentation.
Just a sentence : depends on the device.

1 Like

please can u guide me on how i can install the pip3 via ssh. i cant run the commands which where put in the doc in order to get the api.

The new official component doesn’t really work for my 55POS9002. It loses connection all the time, and if it’s connected, all it can do is to read the state of the volume, channel, what apps and channels I have, but I can’t do any actions.
With the custom component that was never a problem and I could immidiately turn on and off.

Edit: restarted HA and now it works except for partially play/pause and key sending. Is that not possible through the API or just not implemented yet?