Custom flow rate sensor - dashboard tile

I tried some ready solutions and none of them were addressing my issues. Finally I decided to create my own sensor and now I have a working sensor built on a esp32c6.

I am using wifi and wrtote my own driver for it.

I think capability LiquidFlowRate is good for this purpose.

But I could not find a template on dashboard to display rate or total consumed water. So I chose custom attribute template and displaying rate now.

works fine. But, I would like to change the color of the tile on dashboard according to the rate (some color when zero, another color when greater than zero)

How can I do that ?

is there a tile template that does this and shows rate (or any custom attribute) ?

or I can send event to any other attribute which could do the color change ?

If you look around at how people have tried to do something similar with humidity readings, that could be something you could apply here, but you may need to setup something to capture a more contained set of possible values.

The battery template will change colors based on battery attribute value, but it uses integer from 0 to 100, but you could round to integer if your flow is decimal, and you could convert your flow range to be a rate between 0 to 100.

thanks for all your answers. Fİnally I decided to send an html output as attribute. The background changes color according to the rate value. So I can the level of flow without reading the number.