Closed nschloe closed 7 months ago
Hi, this should indeed be cleared up a little!
Essentially, the color_treshold value works like a minimum: if the graph value is higher than a threshold, its color will apply (highest gets precedence and the first color is used as the lowest color, regardless of its value)
Between 0 and 1.3333 we have #ff0000?
Correct!
What happens below 0?
Currently, the first threshold color is used; although we might want to expose the default color if no threshold was reached in the future (to improve multi-graph & allow for "red alert only" thresholds)
What happens above 4?
#0000ff
is applied.
i.e.:
color_thresholds:
- value: 0 # currently ignored
color: "#ff0000"
- value: 1.333333 # anything above 1.33333
color: "#ffff00"
- value: 2.666667
color: "#00ff00"
- value: 4
color: "#0000ff"
If the the first "threshold" is ignored, then perhaps it shouldn't be there at all. That'd make it clearer that the thresholds are thresholds from below.
/Hi, it looks like it’s broken or something for past few months? Or user is broken? :D
Env: HA on HAOS on RPi4
Watched on iOS HA app iOS 16-17
My config (skipping value 0 does nothing)
Code:
- type: custom:mini-graph-card
name: VOC last hour
entities:
- entity: sensor.airquality_drukarka_voc_index
color_thresholds:
- value: 0
color: blue
- value: 100
color: blue #'#44739e'
- value: 200
color: orange
- value: 300
color: red
hours_to_show: 1
hour24: True
points_per_hour: 60
show:
legend: True
icon: False
Results:
color_thresholds
This is a global property, not per entity.
type: vertical-stack
cards:
- type: entities
entities:
- input_number.number
- type: custom:mini-graph-card
entities:
- entity: input_number.number
color_thresholds_transition: hard
color_thresholds:
- value: 0
color: blue
- value: 30
color: green
- value: 50
color: magenta
- value: 80
color: red
hours_to_show: 0.08333
points_per_hour: 600
height: 200
lower_bound: ~0
show:
points: false
labels: true
I don't know how I managed to write it per entity not global as you said and not found it for several months :D
Thank you so much, naturally works like a charm!
Explanations were provided. Docs need to be updated: some clarifications to be added. PR: https://github.com/kalkih/mini-graph-card/pull/1058
v.0.12
The main documentation gives
as an example for color thresholding. What exactly does this mean?
0
and1.3333
we have#ff0000
?0
?4
?