How to change icon on glance based on state

According to the documentation of Glance card, it is not possible to use a “state_icon” variable.

You have to use something like this: 📝 100% Templatable Lovelace Configurations