Different color gauge with +/- values

Hi together

This is my first post and I hope that the community can help me :smiley:

Unfortunately I can’t add a picture yet, so I hope my description is understandable.

When my battery storage is charging, it is displayed with a negative sign - as -500W means that the storage is charging. The gauge should then be green.

If the storage is being discharged, this is displayed with a positive sign - i.e. 500W. The gauge should then be red.

I get it right for positive values, but not for negative ones :neutral_face:

Please share your gauge card configuration yaml correctly formatted for the forum.

Show you code; probably you need to set min and max values.

This is what it looks like for positive values - for example

  - type: gauge
    entity: sensor.pv1_power
    name: Südwest
    severity:
      green: 1000
      yellow: 500
      red: 400

So PV production to 399 the color ist red, from 400 to 999 yellow and from 1000 green.

I am still new to HA, so I can only provide the data from the code editor

That’s what we wanted.

This will have red for negative and green for positive.

type: gauge
entity: sensor.pv1_power
min: -1000
max: 1000
needle: true
severity:
  green: 0
  red: -1000

Thank you very much, but unfortunately that is not what I am looking for. Now that I can upload pictures, maybe it will be clearer:

grafik

So from 0 to **–**XXXX the color should be green (works). From 1 to XXXX red (don’t works)

Also I don’t need the needle, but if I deactivate is, the backround color will be lost.

Sorry if I’m being a bit stupid, but I’m still learning :blush:

type: gauge
entity: sensor.pv1_power
min: -xxxxx
max: xxxxx
severity:
  green: -xxxxx
  red: 0