Custom badge with photo (like device_tracker)

Have anyone figured out a way to create a custom badge similar to the one created by device_tracker (with a photo and status written on the orange background)? Or is it strictly reserved to the device_tracker entity?

You can probably use a template sensor, and customize it with a picture.

Unfortunately you cannot dynamically change the measurement unit field (text on an orange background) on a template sensor.

explore mqtt. This is the way.