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
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.
Yeah it would be really nice because the current media images are just screen caps that flicker.
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!!
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
Oh nice, good work! Iāll definitely give this a go at some point.
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.
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
Cheers my dude
Wasnāt expecting such a quick reply
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