The YAML for the gauge card is below. What I would like to create is a condition for each month of the year so I can set the max: in the current YAML to a new value based on what month of the year it is currently. (Example, if the current month of year is January, set max: to 700, if the current month of the year is February, set the max: to 750, etc.) I am a newbie and can’t wrap my head around how to do it. But once I see a valid example, I can pretty much learn how to us the sample code from that. Can anyone provide a sample YAML code on how to do this?
type: gauge
needle: true
severity:
green: 834
yellow: 0
red: 833
entity: sensor.solaredge_energy_this_month
unit: kWh
name: MTD Production
grid_options:
columns: 6
rows: auto
max: 666
Please paste your code as preformatted text (</> in the cogwheel toolbar).
But probably much easier to create a template sensor, then just use the sensor in the card.
To set a value of “max” dynamically, you need to use a template for this option:
max: .... your template
But the Gauge card does not support templates.
In general, for a card which does not support templates, your options are:
- Wrap the card into custom:config-template-card (CTC). Suggest to ask any CTC-related questions in the main thread.
- Wrap the card into custom:templater-card (TC). Suggest to ask any TC-related questions in the main thread.
- Wrap the card into custom:auto-entities (AE). Suggest to ask any AE-related questions in the main thread.
Particularly for Gauge card it is not recommended using CTC (can’t say anything about TC). Use AE, solution is here (this example for severity, but same should be done for the “max” option).
Similar:
one
two
three
four
type: gauge
needle: true
severity:
green: 834
yellow: 0
red: 833
entity: sensor.solaredge_energy_this_month
unit: kWh
name: MTD Production
grid_options:
columns: 6
rows: auto
max: 666
type or paste code here