Lovelace: mini graph card

Oh my god, thank you. Not just for releasing you config in the future but for letting me know about badnest. I didn’t even know it was a thing!

I don’t understand. Can you explain?

Take a look here: 0.107 Warning about community_plugin

Thanks! That did the trick for me!

1 Like

Is it possible to use template instead of value

e.g

color_thresholds:

  • value: ‘{{ states(’‘sensor.min_kwh_idag’’) | float }}’
    color: green
  • value: ‘{{ states(’‘sensor.max_kwh_idag’’) | float }}’
    color: red
  • value: 21.5
    color: “#c0392b
1 Like

Please format your pasted code.

It is only possible with something like this:

Hi,

I’m showing bar charts to track activities like so:

image

based on these

  - platform: history_stats
    name: fridge open for
    entity_id: binary_sensor.fridge_contact
    state: 'on'
    type: time
    start: '{{ now().replace(hour=0, minute=0, second=0) }}'
    end: '{{ now() }}'

  - platform: history_stats
    name: tv playing for
    entity_id: media_player.shieldtv
    state: 'playing'
    type: time
    start: '{{ now().replace(hour=0, minute=0, second=0) }}'
    end: '{{ now() }}'

so that’s great, but when I hover over the far right column (today), it shows the “real” value for how long the TV has been on today:

image

I can’t sort out the discrepancy.

heres the yaml for the cards

entities:
  - entity: sensor.fridge_open_for
    name: Fridge Open For
hours_to_show: 168
name: Fridge Door Open
group_by: date
icon: 'mdi:fridge'
show:
  fill: fade
  state: true
  icon: true
  graph: bar
type: 'custom:mini-graph-card'
entities:
  - entity: sensor.watching_tv_for
    name: tv
hours_to_show: 168
name: TV playing
group_by: date
icon: 'mdi:youtube-tv'
show:
  fill: fade
  state: true
  icon: true
  graph: bar
type: 'custom:mini-graph-card'

Sellerone:

if you put deaths on a different axis you can see the trend more clearly

image

also if you sort by date it will smooth out the graph significantly:

entities:
  - entity: sensor.canada_coronavirus_current
    name: Infected
    unit: Infected
  - entity: sensor.canada_coronavirus_recovered
    name: Recovered
    unit: Recovered
  - entity: sensor.canada_coronavirus_deaths
    name: dead
    show_state: true
    unit: dead
    y_axis: secondary
hours_to_show: 168
name: Covid-19 Infections in Canada (7 days)
group_by: date
show:
  fill: fade
  state: true
type: 'custom:mini-graph-card'
1 Like

Thanks for the suggestion, I changed to the group_by: date (I forgot that), regarding the deaths on a secondary axis I don’t agree too much because, as per you graph, it looks like the deaths are as much as the infectet.

But for the smoothness of it yes, that it is something I wanted to fix but I forgot to change that option, thanks!

I think you need to add “points: false” to the “show:” list if you don’t want to have the “mouse-over” functionality

I’m having a strange problem for the last few versions that I can’t seem to figure out. This code used to work fine:

type: 'custom:mini-graph-card'
entities:
  - entity: sensor.current_power_use
points_per_hour: 3
unit: W
show:
  labels: true
color_thresholds:
  - value: 2000
    color: '#0FE8DD'
  - value: 4000
    color: '#65E80F'
  - value: 6000
    color: '#E8AC0F'
  - value: 10000
    color: '#E8350F'

Lately though, it gives me this error:

Cannot assign to read only property '0' of object '[object Array]'

I can resolve the error by removing all but one of the color_thresholds: members.

Any idea what I’m doing wrong?

I have a problem with the group_by: date function. When I want to plot gas consumption for the past 7 days (168 hrs) it always has value ‘0’ for the first day. When I switch to 6 days (144 hrs) I have the same issue.

Am I doing something wrong? This is my configuration:

  - type: custom:mini-graph-card
    name: Gas (7 days)
    icon: mdi:fire
    entities:
    - entity: sensor.daily_gas
      aggregate_func: max
      name: Gas
      color: "#0da035"
    group_by: date
    hours_to_show: 168
    hour24: true
    decimals: 1
    animate: true
    show:
      graph: bar
      labels: true
  - type: custom:mini-graph-card
    name: Gas (6 days)
    icon: mdi:fire
    entities:
    - entity: sensor.daily_gas
      aggregate_func: max
      name: Gas 
      color: "#0da035"
    group_by: date
    hours_to_show: 144
    hour24: true
    decimals: 1
    animate: true
    show:
      graph: bar
      labels: true

I have history data retention already set to 8 days but that is not solving it.

recorder:
  ...
  purge_keep_days: 8
  ...

Update the card, HA 0.106.0 introduced a breaking change.

Known issue

D’oh! Thanks for that, I had updated the HACS card, but there was another button to “install” or “deploy” or something like that which I failed to notice at first!

Thanks for putting me straight!

1 Like

Fantastic addon! I really love how smooth and well everything looks, and it has so much configuration options :open_mouth: I have one question that documentation was not able to answer (from my searches). Is it possible to disable title/name change when hovering over measure points? Here is quick example:
xeAlZkldNZ
I manually assign title of the card/graph but it changes to the sensor name when hovering over data points. I know that that might be the desired behavior but still I would prefer to have control over it and disable this function if possible. Any ideas are welcome :slight_smile:

1 Like

Try to use the same name for your card and your entity:

- type: custom:mini-graph-card
  name: Air Purifier Pro
  entities:
  - entity: sensor.home_aqi
    name: Air Purifier Pro
    ...
2 Likes

Maaan! It works! I can’t imagine I didn’t think about something as simple as this:) Thank you :bowing_man:

There is one flaw. When you show two entities like so:
vivaldi_FXmJMtfWfF
you can’t actually name both the same way :wink:

Anyone else seeing Attempted to assign to readonly property errors? I’ve been having these since updating to the new version of the card. Error was occurring on 0.107.7 and 0.108.0.

A few posts up