Built a bathroom lock indicator yesterday. It’s an MQTT binary sensor.
This is how it looks in UI:
No skinning/CSS done except the default color scheme from HA profile. mdi:lock is used.
I would like the lock to be yellow when locked and default (red here) when unlocked. So it is in sync with the light above it. Template icon can change an icon but not the color state, as far as I know.