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).