Invert gauge severity colors

Hi,

For my solarpanel inverter I want to create gauge indicating how much electricity is generated by the panels. In this case, higher is better, so the severity colors also need to be inverted.
Assume the following configuration

        - type: gauge
          entity: sensor.solarpanels_currentpower
          name: Solarpanels
          severity:
            red: 0
            yellow: 1500
            green: 3000

In this case 0-1499 should be red, 1500-2999 should be yellow and >= 3000 should be green.
What actually happens is dat 0-1499 is blue, yellow and green are handled correctly.

Am I missing something or is there a bug in the component?

1 Like

Try adding blue: 10000

The blue comes from your theme.
Create an own theme for your gauge.

I already did a inverted colors and it was working nice. Maybe you can try red: 1

Yes, the severity definitions should be able to be reversed. This is how I got mine working:

type: gauge
entity: sensor.solar_power_ac
needle: true
name: Solar Production
max: 10.5
min: 0
segments:
 - from: 0
   color: var(--error-color)
 - from: 1
   color: var(--warning-color)
 - from: 3
   color: var(--success-color)

1 Like