That’s because it’s mdi not mid: … icon: mdi:your_icon
Sure thing! Damn.
But what about the template > icon_template part?
(In a package)
sensor:
- platform: template
sensors:
media_state_tv:
value_template: '{{ states("media_player.samsung_tv_remote") }}'
icon_template: >-
{% if is_state('media_player.samsung_tv_remote', 'on') %}
mdi:cast
{% elif is_state('media_player.samsung_tv_remote', 'unknown') %}
mdi:tv
{% else %}
mdi:tv
{% endif %}
The TV-state sensor is showing up, and the text is OK too, but no icon shows up:
As far I can see the tv icon doesn’t exist so wouldn’t be displayed
It’s an alternative-name, but i will give mdi:television
a try.
That should work or television-classic.
I created an index of home automation related icons you can use.
You can access it immediately here:
https://cdn.rawgit.com/james-fry/home-assistant-mdi/efd95d7a/home-assistant-mdi.html
Or can also install it as a panel iframe - instructions here:
M8. It’s like you are looking into my change-log (o: I actually added it a few hours ago.
@keithh666 - Thanks for your input. I actually think that i have used alternative names in the past? But… Well, now it’s working. What a waste of time (Debugging for more than a few hours).
Any luck making this happen?
EDIT: Looks like the solution is the universal media player platform.
Why can’t this just be reverted? It seems nobody likes the current ui for media players.
@eddi89 made a Custom UI Mini media player. Still in beta, though, but give it a try if you wish and help him work out the bugs
Some heroes don’t wear capes.
You can totally do this with the new Lovelace UI. When you list media_player entities, it does this by default. You need to create a specific “media-control” card to see it the way you do in the current UI.
https://developers.home-assistant.io/docs/en/lovelace_card_types.html
Resurrecting an old post, but where do I put the the “custom_ui/state-card-custom_source.html” part of @Airpal’s code? Being from 2017 I’m sure it will need some updates and customization to fit my own Denon integration, but knowing where it goes is step 1 for now.
Thanks!