You might want to cast a vote on the Style/Icon State Mapping for Custom Attributes feature request which I think would most directly cover what you’re looking for.
–
I would also note that the Thermostat Tile has native support for changing the background color of the tile to reflect whether the device is actively heating or cooling the house:
It’s based on the thermostatOperatingState
and changes to red when the value is ‘heating’ and to blue when the value is ‘cooling’.
The icon is based on the thermostatMode
with heat=fire, cool=snowflake, off=power-off, otherwise it uses a default thermometer icon.