Lovelace - state image

Hi guys, hope someone can help.

I’m trying to use the state image card to change the image when the device state is “Unavailable”
Is this possible?

I also want the image to change when the state is at different percentages. For example,
Less than 25% show image A
Between 25-50% show image B
Greater than 50% show image C.

I’ve seen setting the image based by “on” “off” state but not by percentage.

How would I proceed with this?

Thanks very much for that. I think that is exactly what I’m looking for. I will give it a try when I get home.

Can I use the code for an unavailable state to show as zero?

You could try:

{% if states('sensor.watertank') == none %}