kalkih / mini-graph-card

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

bug: states and colors get confused with multiple sensors. #971

Closed ex-nerd closed 3 months ago

ex-nerd commented 1 year ago

I'm trying to set up a card to graph the 3 particulate readings from my AirGradient sensor. Given a config like this:

type: custom:mini-graph-card
title: Outdoor Particulate Matter
entities:
  - entity: >-
      sensor.airgradient_open_air_1_airgradient_open_air_particulate_matter_2_5um_concentration
    name: PM2.5
    show_state: true
    state_adaptive_color: true
  - entity: >-
      sensor.airgradient_open_air_1_airgradient_open_air_particulate_matter_10_0um_concentration
    name: PM10
    show_state: true
    state_adaptive_color: true
  - entity: >-
      sensor.airgradient_open_air_1_airgradient_open_air_particulate_matter_1_0um_concentration
    name: PM1
    show_state: true
    state_adaptive_color: true
line_width: 2
hours_to_show: 24
min_bound_range: 10
show:
  # labels: true
  fill: fade
  # name: false
  state: true
  # icon: false
  icon_adaptive_color: true
  name_adaptive_color: true
  state_adaptive_color: true

It renders this oddity that shows 3 measurements in different colors/sizes. I get states for entities 2 and 3, but for some reason the "overall average" (?) larger value is colored the same as the "primary" PM2.5 (I really wish I could specify which one is primary rather than just the first), while the name shows PM2.5 in the top left corner.

Screenshot 2023-05-31 at 11 43 10 PM

However, if I move the cursor over the PM1 legend to get its current state (sorry, screenshot hides the cursor), you notice that the name in the top left corner changes to PM1 and the larger orange value now shows the value of the PM1 sensor. But it's still orange.

Screenshot 2023-05-31 at 11 44 05 PM

I was hoping with various config options to:

ildar170975 commented 1 year ago

However, if I move the cursor over the PM1 legend to get its current state (sorry, screenshot hides the cursor), you notice that the name in the top left corner changes to PM1 and the larger orange value now shows the value of the PM1 sensor. But it's still orange.

https://github.com/kalkih/mini-graph-card/issues/698

ildar170975 commented 6 months ago

@ex-nerd

  1. Regarding confusing color - already gave that link: https://github.com/kalkih/mini-graph-card/issues/698
  2. Regarding your proposals for layout of states - please consider creating a separate FR for this.
ildar170975 commented 3 months ago
  1. Explanations & recommendations were provided.
  2. No feedback within 3.5 months, closing.