Customizing icons only shows the icon once

Hello automators, I’ve got a question that’s been itching me for a while, since I can’t get it to work…
I’ve started customizing my switches with “icon: mdi:xxxx” which works great, but for some reason it only applies once to an entity and the rest keeps their default icons. For instance:

switch.livingroom_speakers_mute:
  friendly_name: Speakers Mute
  icon: mdi:speaker
switch.livingroom_speakers:
  friendly_name: Speakers
  icon: mdi:speaker

Only shows the first one with the speaker icon and the other with the default lightning bolt icon
Of course, the question being: anyone know that issue and how to fix it?

Hi,

I think you shuffle your physical stuff (livingroom_speakers) and their state (Mute or Not Mute).

To personalize your icons with their state you could try this :

sensor:
  - platform: template
    sensors:
      livingroom_speakers:
        friendly_name: 'Livingroom Speakers'
        icon_template: '{% if is_state("switch.livingroom_speakers", "mute") %}mdi:volume-mute{% else %}mdi:volume{% endif %}'

I don’t know if it’s really that you looked for !