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