Picture-elements state-badge color and unit_of_measurement change

Need help. I have a Beok thermostats. I have made ‘template’ sensors. I am using Picture-elements card. Everything works perfect. Now I want my state-badge color to change depending on thermostat’s ‘hvac_action’ state, but I can’t do it. And a more difficult task is to change ‘unit_of_measurement’ depending on thermostat’s ‘hvac_action’ state.

Did you find a solution? In which case, can you please post some code?

No, I did not