Is there a way to hide media players when they are not available in Lovelace? I am getting this error on my plex media players. When I restart Home Assistant, the media players for plex do not show up until I start streaming something to them. I understand why the card is not showing up (there is no entity called “media_player.plex_media_room” yet), but is there a way to hide it until the media player becomes available?
Thank you! I think it might work, but I am having some trouble. How should the “card” portion of the filter be set up? When I use the code below, it filters correctly, but it shows a condensed version of the media player.
After playing around with it for a bit. I am still having an issue with the state filter specifically for “media-control” cards. When I remove type: media-control it works as expected.
View when idle:
View when playing:
When I change to type: glance It still works as expected
View when idle:
View when playing:
Now when I change type: media-control I get the following view when idle even though I would expect it to be blank like the prior two idle views from above.
A solution for this is a new card coming in 0.75 (conditional). You could try in the current setup to add ‘show_empty: false’ as that might solve your problem.
Thanks for publishing a solution. I had the same problem with my Chromecast being powered by a TV and when the TV is off - the Chromecast is also unavailable.
However I think this is rather a workaround. In my opinion Lovelace should work as the good, old pre-0.86 UI and show a media player card with status ‘unavailable’. I’ll file a bug about this in Github