Lovelace: mini graph card

Is there anyway to do rounding on the grpahs? I would like to round down to a whole number on some of my graphs, as on mouse over for some of the bigger reporting sensors I get for example ‘5007.75’ watts, whereas I would prefer just ‘5007’.

Hey, please try the decimals option, think that should do the trick…

decimals: 0
1 Like

Thanks, that did it.

was looking at the “Alternate y-axis” example and figuring out how to configure the input_number nighttime.
Can get my head around it, does anyone has a working example of it?

I’m a bit new to HA and learning a lot of these examples :slight_smile:

Hey, the same question actually got asked over on github a few weeks ago, please check the link below.

is it possible to add a time frame indication to the x-axis?

1 Like

No, not possible.

I’m having a problem with lovelace saying “custom element doesn’t exist”, so I did all the normal troubleshooting and then went to look in the mini-graph-card-bundle.js file itself, and the file I downloaded (wget, download from git releases, etc) has absolutely zero formatting, ie it’s just one enormous string of characters. Has anyone else had this problem?

That’s intentional, the build is minified in order to reduce file size.

Double check your resource reference or consider installing HACS to streamline the install/update process.

Gotcha, thanks. I figured it out, apparently since updating to 0.96 lovelace is not respecting changes I make to ui-lovelace.yaml.
Thanks for the reply and getting me back on track.

1 Like

Then you must be using Lovelace in storage mode instead of yaml.

This is my actual configuration, i can´t make the color of the line to change according to temperature variations, am i doing something wrong?

type: ‘custom:mini-graph-card’
entities:

  • entity: sensor.speedtest_download
    name: Internet
    hours_to_show: 72
    points_per_hour: 0.25
    show:
    labels: true
    icon_adaptive_color: true
    color_thresholds:
    • value: 20
      color: ‘#f39c12
    • value: 25
      color: ‘#d35400
    • value: 26
      color: ‘#c0392b

Please post you yaml inside a code block, I can’t check if your indentation is correct otherwise.
If it is in fact correct, I don’t see why it wouldn’t work, make sure you’ve updated the card.

how do i post mi yaml inside a code block? Sorry for the newbie question

Here’s a good resource, but basically three backticks before the code and three after.

Thanks, now it should be right.

entities:
  - entity: sensor.speedtest_download
name: Internet
hours_to_show: 72
points_per_hour: 0.25
show:
  labels: true
  icon_adaptive_color: true
  color_thresholds:
    - value: 20
      color: '#f39c12'
    - value: 25
      color: '#d35400'
    - value: 26
      color: '#c0392b'

Okay, your indentation is wrong, color_thresholds should be in the root of the card config, like this:

entities:
  - entity: sensor.speedtest_download
name: Internet
hours_to_show: 72
points_per_hour: 0.25
show:
  labels: true
  icon_adaptive_color: true
color_thresholds:
  - value: 20
    color: '#f39c12'
  - value: 25
    color: '#d35400'
  - value: 26
    color: '#c0392b'

Thanks, worked like a charm!! Is there any way of changing the color codes? And in that case, where can i get the table of color codes?

1 Like

Sure, you can use any color picker to find out color hex codes, this one for example:

Awesome, you´re a genius, thanks for your time and patience!

1 Like