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

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 %}
4 Likes