Custom Badge

Hi All!

Doing well with the automation, but I’ve the following issue.

I had device tracking working van NMap and that worked pretty good. But because there where some times Nmap got it wrong I combined it with Ping. So now I have two device trackers and that works great!

However… I made a template sensor so I could combine the two trackers, so far so good. But now I have a badge with the statement “Home” or “Away” in it. Is it possible to fill the badge with a photo or with an icon?

Yes, I’ve searched the forum and internet, but I can’t find an answer. Hope you guys will point me in the right direction!

Kind regards,


take a look at a mdi icon or an entity picture

Thanks for the quick response, but that doesn’t work with a “template sensor”?

Do I have to change it to a template binary sensor?

Customize works with any entity. I use mdi icons on a number of my template sensors.

If you want to change the icon based on the status look at a template icon. (scroll down to “change the icon” in the link below)


I tried it, but that won’t give the right response. I still have a badge with the word “Home” in it and not an icon.

This is what I have written under sensors (template):

friendly_name: 'Eltjo'
value_template: '{{ states("group.eltjo") }}'
icon_template: >-
{% if is_state("group.eltjo", "home") %}
{% else %}
{% endif %}

Any thoughts?

Well, I got it so far that I have a badge with custom text (dutch) for home (thuis) of away (weg).

To make it nicer I made the name of the person as a unit of measurement so that name comes neatly in red under the badge:

   friendly_name: ' '
   unit_of_measurement: 'Eltjo'
   value_template: >-
      {% if is_state('group.eltjo', 'home') %}
      {% else %}
      {% endif %}

I was trying to solve the same problem. I think I found a good way using MQTT and MQTT device tracker component.