mini-graph-card icon indicating copy to clipboard operation
mini-graph-card copied to clipboard

Entity colors should use checksum on entity name to select color

Open Maltavius opened this issue 3 years ago • 2 comments

That way multiple graphs containing the same name will have the same color

image The image above describes it well. Köket (Kitchen) should be the same color since it's the same name.

Either it would work on the set name or on the beginning of the entity name (eg. sensor.kitchen_X, where X is temperature, llight_level or other.

entities:
  - entity: sensor.avg_home_temp
    show_graph: false
  - entity: sensor.sensor_temperature
    icon: mdi:sofa
    name: Vardagsrummet
  - entity: sensor.sensor_hallen_temperature
    icon: mdi:door
    name: Hallen
  - entity: sensor.kitchen_temperature
    icon: mdi:table-chair
    name: Köket
  - entity: sensor.sensor_allrummet_temperature
    icon: mdi:desktop-classic
    name: Allrummet
  - entity: sensor.bedroom2_temperature
    icon: mdi:bunk-bed
    name: Barnens rum
group_by: hour
hour24: true
hours_to_show: 24
name: Temperatur
points_per_hour: 1.25
type: custom:mini-graph-card

Maltavius avatar Sep 13 '22 22:09 Maltavius

Good point.

type: vertical-stack
cards:
  - type: custom:mini-graph-card
    entities:
      - entity: sensor.xiaomi_cg_1_temperature
      - entity: sensor.xiaomi_cg_2_temperature
      - entity: sensor.mijia_300_1_temperature
    show: &ref_show
      name: false
      legend: true
      icon: false
      fill: false
  - type: custom:mini-graph-card
    entities:
      - entity: sensor.xiaomi_cg_1_temperature
      - entity: sensor.mijia_300_1_temperature
      - entity: sensor.xiaomi_cg_2_temperature
    show: *ref_show

изображение

Notes:

  1. This is good for automatically selected colors (i.e. if colors are not set explicitly).
  2. Better to use entity_id instead of "entity name".

ildar170975 avatar Sep 14 '22 14:09 ildar170975

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this is still an active issue, please let us know!

stale[bot] avatar Nov 14 '22 06:11 stale[bot]