How to create a custom badge?

Hi I created a command type sensor to get some state. The sensor is white and round with the name underneath it and the state inside as text. Is it possible to customize it in such a way that there is a state banner on the badge, like you see with device trackers?

Thanks!

For sensor badges this is the unit of measurement if I understand your question the right way.

Hey thank you for the response!

I’d like to be able to decorate the sensor label very similar to this:

The sensor returns “Online” and “Offline”, which I like to see in the label on the badge.

Hi @happydutch did you find a way to do that ?

For hacks which go beyond the capabilities of customize: I suggest that you create a custom_component. This way you can do what ever you want. Keep in mind that using unit of measurement to show your state can have side effects for the history.