kalkih / mini-graph-card

Minimalistic graph card for Home Assistant Lovelace UI
MIT License
3k stars 233 forks source link

Odd color issue with thresholds #978

Closed aram535 closed 8 months ago

aram535 commented 1 year ago

Some odd results ... I wanted to have hard color change if the temperature or humidity of these sensors goes above 55F. The humidity graphs look strange and somehow "red" is being interpreted as "blue?"

graph

square: true
columns: 3
type: grid
cards:
  - type: custom:mini-graph-card
    entities:
      - entity: sensor.wca_temperature
        name: WCA Temp
    align_state: center
    font_size: 50
    line_width: 10
    color_thresholds_transition: hard
    color_thresholds:
      - value: 0
        color: '#f39c12'
      - value: 55
        color: '#c0392b'
    aggregate_fun: avg
    update_interval: 1800
    hours_to_show: 12
    points_per_hour: 6
    show_points: false
    show_line: false
  - type: custom:mini-graph-card
    entities:
      - entity: sensor.wcc_temperature
        name: WCC Temp
    align_state: center
    font_size: 50
    line_width: 10
    color_thresholds_transition: hard
    color_thresholds:
      - value: 0
        color: '#f39c12'
      - value: 55
        color: '#c0392b'
    aggregate_fun: avg
    update_interval: 1800
    hours_to_show: 12
    points_per_hour: 6
    show_points: false
    show_line: false
  - type: custom:mini-graph-card
    entities:
      - entity: sensor.wcd_temperature
        name: WCD Temp
    align_state: center
    font_size: 50
    line_width: 10
    color_thresholds_transition: hard
    color_thresholds:
      - value: 0
        color: '#f39c12'
      - value: 55
        color: '#c0392b'
    aggregate_fun: avg
    update_interval: 1800
    hours_to_show: 12
    points_per_hour: 6
    show_points: false
    show_line: false
  - type: custom:mini-graph-card
    entities:
      - entity: sensor.wca_humidity
        name: WCA Humidity
    align_state: center
    font_size: 50
    line_width: 10
    color_thresholds_transition: hard
    color_thresholds:
      - value: 0
        color: '#fff'
      - value: 55
        color: '#EE4B2B'
    aggregate_fun: avg
    update_interval: 1800
    hours_to_show: 12
    points_per_hour: 6
    show_points: false
    show_line: false
  - type: custom:mini-graph-card
    entities:
      - entity: sensor.wcc_humidity
        name: WCC Humidity
    align_state: center
    font_size: 50
    line_width: 10
    color_thresholds_transition: hard
    color_thresholds:
      - value: 0
        color: '#fff'
      - value: 55
        color: '#EE4B2B'
    aggregate_fun: avg
    update_interval: 1800
    hours_to_show: 12
    points_per_hour: 6
    show_points: false
    show_line: false
  - type: custom:mini-graph-card
    entities:
      - entity: sensor.wcd_humidity
        name: WCD Humidity
    align_state: center
    font_size: 50
    line_width: 10
    color_thresholds_transition: hard
    color_thresholds:
      - value: 0
        color: '#fff'
      - value: 55
        color: '#EE4B2B'
    aggregate_fun: avg
    update_interval: 1800
    hours_to_show: 12
    points_per_hour: 6
    show_points: false
    show_line: false
ildar170975 commented 1 year ago
  1. Using names like "green" or "red" instead of these hex values is more helpful for users to see issues.
  2. There are some similar issues here registered; please use search before posting a new issue (otherwise we have 10 issues about the same).
  3. Just in case - check with lower_bound defined, it usually helps.
ildar170975 commented 8 months ago

@aram535 Do you still observe the issue?

aram535 commented 8 months ago

No, it seems to be working now. I had removed the hard limit as it was distracting. image