I like to create a Gauge severity based on other sensor data

Hi,

I hope I can explain this well enough.

I want to create a Gauge based on my solar energy daily yield.

I would like to show the needle in place where the daily yield stands to the estimated yield.

So red if the current yield is on 1/3 of the estimated
Yellow when it is on 2/3 of the estimated
and green when higher then the estimated

Something like this

type: horizontal-stack
cards:
  - type: gauge
    entity: sensor.solaredge_energy_today
    max: 5600
    min: 1
    needle: true
    severity:
      green: sensor.energy_production_today_2
      yellow: {{ ((sensor.energy_production_today_2|int) / 2 }}
      red: {{ ((sensor.energy_production_today_2|int) / 3 }}
    unit: Wh

Obviously the above code does not work.

Is this possible? To calculate within the card it self.

Thank you!!!

did you have a relevant solution for this question?
looking for something similar :confused:

I was having a similar use-case and got it working with config-template-card .

type: custom:config-template-card
entities:
  - sensor.wasserbudget_pro_tag
card:
  type: gauge
  name: Wasser Tag
  entity: sensor.wasserbudget_verbleibend_tag
  min: 0
  max: ${this.hass.states['sensor.wasserbudget_pro_tag'].state}
  severity:
    green: ${this.hass.states['sensor.wasserbudget_pro_tag'].state * 0.4}
    yellow: ${this.hass.states['sensor.wasserbudget_pro_tag'].state * 0.2}
    red: 0