Hi,
I’m using a template to change an icon depending upon what the source of my TV is. My problem is that all but one of these icons comes from mdi - the other I need to be default as they don’t have an iPlayer icon and are seemingly refusing to add one. My template is:
- platform: template
sensors:
tv_source:
friendly_name: Watching
value_template: '{{ states.media_player.living_room_tv.attributes.source }}'
icon_template: "{% if is_state_attr('media_player.living_room_tv','source', 'Walter') %} mdi:desktop-tower {%- elif is_state_attr('media_player.living_room_tv','source', 'Netflix') %} mdi:netflix {%- elif is_state_attr('media_player.living_room_tv','source', 'BBC iPlayer') %} ?????????? {%- elif is_state_attr('media_player.living_room_tv','source', 'LiveTV') %} mdi:television {%- elif is_state_attr('media_player.living_room_tv','source', 'Chromecast') %} mdi:google-chrome {%- elif is_state_attr('media_player.living_room_tv','source', 'Amazon Prime Video') %} mdi:amazon {%- elif is_state_attr('media_player.living_room_tv','source', 'YouTube') %} mdi:youttube-play {% endif %}"
Is it possible to even do this? I understand that to use my own image it should be entity_picture not entity_icon - so is there no way to mix the two together and use mdi where available, and my own where not?