Gauge Card: how to get a gradually changing color?

That is why I proposed this FR.
Yes - secrets are convenient to keep shared code. But - this is wrong.

I ended up to move almost all shared code from “secrets” to “include” (btw, nobody advised me to use “secrets” for reused code - and never read about this practice here before myself).
What is only left in “secrets” are one-string definitions like:

xyz: "some string 1"
abc: "some string 2"
def: 123

for which I decided not to create separate files, too many of them…

6 Likes

Sorry for the long waiting time. I didn’t even know that my website came here.

I added your proposal but I will tempt more information on how exactly it should be formatted. And possibly what headlines should be default.

2 Likes

Good job! Really appreciated.

(I understand that this topic is a year+ old, but this just perfectly suits my needs :slight_smile:).

I’ve been working on a template-gauge-card which is just the HA gauge card with templatable parameters. On Facebook someone requested a ‘gradient’-feature which made me really interested to see if I could pull that off. Currently I’ve got a proof-of-concept working which dynamically works with your input (left):

The question for me now to answer is how gradients should actually work. For this I created a discussion in my GitHub repo and would love to either get input here or in my GH discussion.

Basically my question is as follow:
Given the following segments:

segments:
  - from: 0
    color: red
  - from: 20
    color: yellow
  - from: 30
    color: green

→ Where should the ‘peak’ of the color be. At the given values, so the peak of yellow should be at 20 etc, or should the peak in the middle of the segment, so 25 for yellow. For ‘option 2’ the gradient will ‘never’ start at 0, because red will start at 10, and 0 to 10 will just be red.

(Sorry if this was discussed here before, couldn’t really find anything related)

2 Likes

Imho a peak should be at the max value. Most logical.

2 Likes

I’ve published a release-candidate with gradient functionality. Would love to see feedback on this!

Checkout Releases · benjamin-dcs/template-gauge-card · GitHub or download the pre-release from hacs

edit: updated release info

2 Likes

Thank you! easy to use and great result using the link someone else shared to setup the segments :slight_smile:

2 Likes