Android TV Icons for Apps

In my current setup my media player card just displays screen caps of my Google TV. Is there anyway to use the add state detection to change the picture to the icon of the app? Like when Netflix is open, display the Netflix logo.

Thanks

Up voted, this would be nice to have. The roku integration has this functionality for example.

1 Like

Yeah it would be really nice because the current media images are just screen caps that flicker. :confused:

1 Like

Yup indeed. I tried to set this up last night and on the browser I saw the current background images but they don’t seem to work on the mobile app which is what I use 99% of the time.

Yeah, it gets very glitchy sometimes. If this topic falls through I’m going to try mini media player which doesn’t flicker I’m pretty sure.

I got a proof of concept going!!! It does involve automations and a python script but I think it will work!!

1 Like

So scratch that lol. I went a completely different route (sensor template, picture entity and mini-media-player). It works great and for my use case and actually looks really good. I’ll send a screenshot when I’m at my laptop! It’s super easy to add a new app when you install one

Continuing the discussion from Android TV Icons for Apps:

Here’s what they look like:

Here’s the configuration.yaml for the sensor:

sensor:
  - platform: template
    sensors:
      active_app:
        friendly_name: "Active App"
        value_template: "{{ state_attr('media_player.google_tv', 'app_name') }}"

And here’s the configuration for the picture entity:

type: picture-entity
entity: sensor.active_app
image: local/googletvicons/googletv.png
state_image:
  Disney+: local/googletvicons/disneypluslogo.jpg
  Home: local/googletvicons/googletv.png
  Plex: local/googletvicons/plexlogo.png
show_state: false
show_name: false

And finally the Configuration for mini-media-player:

type: 'custom:mini-media-player'
entity: media_player.google_tv
hide:
  volume: true

You can modify it as you need. It’s not perfect but, it works! Let me know what you think

3 Likes

Oh nice, good work! I’ll definitely give this a go at some point.

1 Like

I used it like that, renamed the apps, and put the same on the icons.

entity_picture: >
[[[
var app = states[‘media_player.android_tv’].attributes.source;
var picture = “/local/icones_ico/” +app +".ico?v=1";
var status = (states[‘media_player.android_tv’].state);
if (status != “off” && status != “standby” && status != “unavailable”)
return picture
else return null
]]]

Hey everyone who was here originally! I took the android tv media_player.py file and have hacked some code together that works and sets the image of the actual media player entity based on the app id! I’ll make a GitHub repository if you want to check it out and before you add it you’ll have to add a url (I used an external one, don’t know if internal would work) for the images.

1 Like

Don’t know if I’m being stupid.

Did you ever post the github?

It didn’t end up working the way I wanted it to and it was pretty janky.
Here is what I added to the android tv integration (I cloned the code from the GitHub and added it as a custom integration) You’ll have to add icons for the app. I’ll upload those to the repo

@property
    def media_image_url(self):
        self._url = "/local/googletvicons/{0}.png".format(self._current_app)
        """Return the Icon of the active app."""
        return self._url

Here’s the link for the repo: jonathanrobichaud4/HA-Android-TV-integration-with-Icons · GitHub
I’ll upload the code but this is an older version of the integration so ill have to update it

1 Like

Cheers my dude :slight_smile:

Wasn’t expecting such a quick reply

1 Like

Is it safe to use this as a custom component given that the repository says it needs to be updated? Tempted to give this a go again as i’m trying to use my Shield over my Apple TV…

You can use it as is for right now, I’m using it and it works great for me however you can’t configure it through the gui right now. You’ll also have to install it manually since the pictures need to go into the specific folder which is listed on the github.

OK I’m probably dumb, and not doing this right…I copied the androidtv folder into the custom_components folder and the googletvicons into the www folder and restarted HA. I also made sure that network debugging is enabled in developer options on my shield.
Do I need to install the `normal’ integration first? I was expecting to see a prompt on my shield for access but that didn’t happen.
Thanks!

I just saw this I am so sorry lmao. You need to use the old yaml config for right now and there is no UI config. I’m going to update it so it works like the newer integration. The icons also may not work on your shield since the app bundle name may be different from the GoogleTV. It could be broken but i’m not sure. I’ll look at my config to see if I made a dumb mistake but i’m currently restoring my HA backup because the new release is broken.

Any updates on this?
I’m interested in it.
I’d be fine with a yaml config integration instead of a custom component.
Cause I’d rather be using the “official” integration.

Not really. I’m at school right now so I can’t check if it will work properly and I don’t have a lot of spare time as it is. I think I tried to modify the newer integration but it didn’t work properly. The version I have marked as the solution will also work but it just won’t be as integrated and your dashboard will need some reconfiguring