I added a mini graph card to show a PH sensor value. All data is showing fine, but what I want is the line change color depending on value as:
0 to 7.5 PH = RED
more than 7.5 to 7.9 PH = YELLOW
more than 7.9 to 8.3 PH = GREEN
more than 8.3 to 8.5 = YELLOW again
more than 8.5 = RED again
That is because the right PH value for the application is between 7.9 to 8.3. Lower or higher PH values will turn dangerous is are sustained over time, and values up to 8.5 or below 7.5 are dangerous in short time. This is the code I wrote:
type: custom:mini-graph-card
entities:
- input_number.ph_marino
name: PH
line_color: white
line_width: 8
font_size: 75
show: null
labels: true
color_thresholds:
- value: 0
color: "#ff0000"
- value: 7.5
color: "#ffff00"
- value: 7.9
color: "#00ff00"
- value: 8.3
color: "#ffff00"
- value: 8.5
color: "#ff0000"
But as you can see in the capture, a value of 7.67 PH is showed in green color, when according to the code, it should be yellow below 7.9 up to 7.5. What am I doing wrong here?