kalkih / mini-graph-card

Minimalistic graph card for Home Assistant Lovelace UI
MIT License
3.06k stars 237 forks source link

Color threshold for secondary axis entities #1119

Closed MaJerle closed 1 month ago

MaJerle commented 3 months ago

How can we set secondary axis color threshold?

I would like to have different ones for temperature and humidity.

type: custom:mini-graph-card
entities:
  - entity: sensor.temp_hum_sensor_5_terrace_temperature
    name: Temperature
  - entity: sensor.temp_hum_sensor_5_terrace_humidity
    name: Humidity
    y_axis: secondary
name: Temperature
points_per_hour: 4
color_thresholds:
  - value: 0
    color: '#FF0000'
  - value: 18
    color: '#FFFF00'
  - value: 20
    color: '#00FF00'
  - value: 24
    color: '#FFFF00'
  - value: 28
    color: '#FF0000'
akloeckner commented 3 months ago

I don't think, it is possible. But maybe you could just extend the list of thresholds to the humidity values' range?

Something like:

color_thresholds:
  - value: 0
    color: '#FF0000'
  - value: 18
    color: '#FFFF00'
  - value: 20
    color: '#00FF00'
  - value: 24
    color: '#FFFF00'
  - value: 28
    color: '#FF0000'
  - value: 35
    color: '#FF0000'
  - value: 35.1
    color: '#00FF00'
  - value: 60
    color: '#FFFF00'
  - value: 70
    color: '#FF0000'
ildar170975 commented 3 months ago

@MaJerle Currently thresholds are defined globally for all entities. There is a related FR, you may start monitoring it or contribute. Meanwhile you may use a method proposed by @akloeckner. Please close the issue if resolved. All per-entity-thresholds-related discussions - please continue in that mentioned thread.

ildar170975 commented 1 month ago

No feedback from OP for more than a month. Closing.