Send custom command to Android TV

Hi all

Maybe a stupid question, but I cannot find on how to send custom commands to my Sony Bravia Android TV.

I was able to add the Android TV as a device using the Unfolded Circle Android TV integration.

Now I would like to directly start a specific app on my TV, but cannot find a way to add custom commands.

I have to note, that I’m on the beta version 2.2.2 of the new web configurator and there I don’t find any possibility to add custom commands.

Does anyone have an idea?

Thank you.

A couple of ways to do it. The command you’re looking for is Input Source:

There’s a dropdown list of prepopulated apps (eg. Netflix, Prime, etc). If you’re app isn’t listed, you can just put the package (apk) name in the field and click add. For that, I use it in a macro because I need to add the “enter” key after the command.

Thank you very much for your answer. Your recommendation with the “source” part seems to be the correct deal.

But if I use the apk name as a “source” it only shows the app on the app store of the TV, it does not start the app.

I guess there must be an additional command after the apk name.

For example, I try to start the YouTube app using the apk name “com.netflix.mediaclient”, it only shows the app information on the app store.

Just figured out myself :slight_smile:
I was using the wrong apk name. For Netflix the actual apk name is “com.netflix.ninja”. Using this Input, everything is working fine.

Thank you very much for your input :+1:

No worries … Netflix should have a direct open in the dropdown and you shouldn’t need to the package name. I’ve only needed for Jellyfin and a couple of Canadian media apps that the devs wouldn’t know of.

Hi,
if you want to know the real package name the App Package Browser can give you this infomation.

Ralf

Thanks for all the information guys. Netflix was just an example, I use the custom app package names for other apps, specific to my country.

Everything works great now :+1: :slight_smile:

Just came across this discussion. I would like to add the Kayo Sports apk name but am having trouble finding where to source it from.

Try: au.com.kayosports.tv

1 Like

Thanks. I literally just found it too by using the Google play store share button and it appeared in the email url.

Thanks for coming back to me though, I’ve been struggling to work this out.

Much appreciated!

Great tip.

However, the IDs for BBC iPlayer, ITVX and Freevee aren’t working for me.

Anybody got any IDs I can try?

Thanks.

Just a guess for you to try bbc.iplayer.tv

Actually, I downloaded an APK Finder app on my Shield which gave me the addresses.

The iPlayer ID for the Shield is: com.nvidia.bbciplayer

However, the IDs for Freevee and ITVX still don’t work.

I know this has been answered but if something does’t automatically show up in t the drop down you can just specify the App ID. This can be found in dev tools in HA or in Android TV in settings>apps then click on the app and it shows the app id as well. That or ADB commands which are quicker but since they deprecated the Android ADB server add on, the python implementation just doesn’t work nearly as well. HA’s focus seems to on the Android Remote HA integration. Below is when I had YouTube open using my Sony TV device name in the Android Remote integration in HA. .

You can test in HA by going to Actions, then choose media_player.select_source as the action, Android media player and source. Save it as a script or part of an automation.

Dev tools>templates

{{ state_attr(‘media_player.television’, ‘app_id’) }}