Can you add numbers in the Mushroom Custom template Card Badge beyond 10

New to HA so apologies if this is a dumb question.

On the Mushroom Custom Template card there is a badge option.
Unfortunately, I wasn’t able to find an “information” property for it, it only has an icon and a color.

So then I noticed mdi has icons that go up to 10. e.g. mdi:numeric-10

My question is, is it possible to have multiple icons to somehow concatenate them to make any number? That sounds dubious as the icons would at best appear next to each other.

Is it just not possible to add numbers in those badges? I’m surprised as that would seem like a very common need.

I need it in order to display the number of lights on inside the badge for a lights card. I’m sure that’s fairly typical. Is there another way to accomplish that? Thanks!

The badge has an icon property and a color property. That’s it. The icon is a picture - not a character so you’ll have to either link to or provide the pictures you want. As you’ve noted you can go to 10 with the svg icons in MDI icons. There may be other icon packs out there that have more options like SimpleIcons or FontAwesome but honestly I doubt it.

1 Like

Thanks very much for the reply! Is it possible to do what I’m asking in other ways, outside of mushrooms? I’m quite puzzled by this not being available by default since I would imagine wanting to have numbers in badges is super common (I’m not that smart or special haha) - especially for lights.
I’ve played with creating a chip giving me the number of lights on in my home but why take up the space of an extra chip card when I could just have this in a badge. :pray:t2:that it is possible hehe

Not exactly what you are looking for, but the following code sample at least can dynamically show

  • no badge if value = zero
  • badge 1 to 9 if value between 1 to 9
  • badge 9+ if value > 9

In my case, number of open doors as part of a Mushroom Template Card.

0 1 9plus

badge_icon: |
  {% set number_open_doors=states("sensor.open_doors") |int %}
  {% if number_open_doors > 9 %}
  mdi:numeric-9-plus
  {% elif number_open_doors > 0 and number_open_doors < 10 %}
  mdi:numeric-{{number_open_doors}}
  {% endif %}
3 Likes