Simple change of gauge background color

I have a gauge that I need to change the background color, I have assigned a name in Styling Class properties and I have entered a template:

But when I enter the color this way, it doesn't work.

`<style>
    .temp2 {
        background-color: {{msg.payload}};
        }
</style>`

But if I enter it like this, it works

`<style>
    .temp2 {
        background-color: red;
        }
</style>`

What would be the correct way to do it?

I'm doing a little troubleshooting. Your logic is probably working, but the page needs to be refreshed to capture the updated CSS.

1 Like

I would like to pass the value from a function to animate, for example to blink (change color from red to white)

It makes total sense. Functions like an HMI. If there is a warning, flash the background color to create awareness. I imagine there is a solution.

1 Like