Mini-graph-card Show Lowest Value Entity in Multiple Entities

Hi there,

I am using the mini-graph-card and am storing the fuel (gas for our American friends) prices and tracking this. The card itself shows 3 stations prices but the first entity in the YAML is what is always displayed. Is there any way to have the entity listed with the lowest price in the entity name field? TIA for any help.

P.S. looking to avoid overly complex YAML if it can be avoided.

I would suggest posting your card code to start…

type: custom:mini-graph-card
entities:
  - entity: sensor.bp_forestville_p95
    name: BP Forestville
  - entity: sensor.eg_ampol_glenrose_p95
    name: Glenrose Ampol
  - entity: sensor.shell_reddy_express_forestville_p95
    name: Shell Forestville
show:
  labels: true
  labels_secondary: true
hours_to_show: 336

You can create a Min/Max sensor:

sensor:
  - platform: min_max
    name: min_p95
    type: min
    entity_ids:
      - sensor.bp_forestville_p95
      - sensor.eg_ampol_glenrose_p95
      - sensor.shell_reddy_express_forestville_p95

and use it as a 4th entity like this:

type: custom:mini-graph-card
entities:
  - entity: sensor.min_p95
    name: Min Cost
    show_graph: false
  - entity: sensor.bp_forestville_p95
    name: BP Forestville
    show_state: false
  - entity: sensor.eg_ampol_glenrose_p95
    name: Glenrose Ampol
    show_state: false
  - entity: sensor.shell_reddy_express_forestville_p95
    name: Shell Forestville
    show_state: false
show:
  labels: true
  labels_secondary: true
hours_to_show: 336

If you want to display the name of the gas station with the minimum price at the top, you can also create a text sensor that defines the name and include it as an 5th entity.

1 Like

Think this will be it!!! Appreciate the response.