Lovelace: mini graph card

This is my compact customization

code
type: custom:mini-graph-card
name: Inverter power
align_icon: left
align_header: left
align_state: right
show:
  name: true
  icon: true
  state: true
  legend: false
line_width: 3
entities:
  - entity: sensor.inverter_active_power
style: |
  ha-card .header.flex .name.flex {
    width: 200px;
  }
  ha-card .states.flex {
    margin-top: -50px;
  }
  ha-card .states.flex .state .state__value.ellipsis {
    font-size: 150%;
    align-self: center;
  }

How did you achieve to colour the font of the value according to the threshold on the graph? Can you share your code please?

Why doesnā€™t rounding of sensors work with Mini Graph card? If I set a sensor to round a value to 1 decimal, it only reflects on ā€œstandardā€ HA gaugesā€¦?

Why MUST it round?)
Rounding is for Frontend only; let us say that custom cards are not obliged to show the rounded value.
Besides, mini-graph has its own rounding option.

Anyway, you may start monitoring a corresponding Github issue (there is one if I am not mistaken).

2 Likes

Thank you! I have totally missed that the number of decimals can be set whitin mini graph card!

Correct. It has own option.
Also, the card could follow those entityā€™s accuracy settings; but this needs changes in the cardā€™s code and may not happen soon.

Hi, does anyone know how to make the graph ignore the other sections, similar to the ā€˜Realtime Usageā€™ graph in this post:
Post 1792

I am trying to make it so the line graph covers the whole card, or just behind the main/max and state.

Thanks!

Iā€™m using this wonderful card to display the power of the water boiler, this is the card I have now:
Capture

This device has several sensors:
Capture1

Is there any way to add the ā€œremaining timeā€ on the card as well? Not as a graph, just on the side to have this displayed, any ideas?

Card mod
Go to the huge card mod thread - 1st post - link at the bottom - styles for mini-graph - how to add additional info

1 Like

Capture
Amazing, thank you @Ildar_Gabdullin

Iā€™m trying to create cards that use colors for different temperatures and humidifies thresholds. This is what Iā€™m getting:

image

and this i the code that Iā€™m using:

type: custom:mini-graph-card
entities:
  - sensor.sonoff_snzb_02d_living_room_temperature
name: Temperature
show_state: true
decimals: 0
points_per_hour: 6
hours_to_show: 24
hour24: true
more_info: false
state_adaptive_color: true
show:
  legend: false
  extrema: true
  fill: fade
  icon: true
  labels: false
  name: true
  state: true
  points: false
color_thresholds:
  - value: 59
    color: Blue
  - value: 77
    color: Red

What am I doing wrong?

??? what is this? This attribute does not exist.

These are per-entity attributes.

As for color_thresholds:
open existing related issues on GitHub and read about bugs & possible workarounds.

Iā€™ve added a mini-graph-card and set the name to Living Room, when ever I click the graph for additional details it changes the name to living room temperature. Anyone know how to set the name when selected?

Post a screenshot with this changed name.
And show where you changed the name to ā€œLiving Roomā€.

type: custom:mini-graph-card
entities:
  - sensor.living_room_temperature
name: Living Room
card_mod:
  style: |
    ha-card
     {background: transparent;
     border-style: none;
     }


  1. You posted an unformatted code. It does not have indents which are crucial in yaml.
  2. Avoid posting picture containing unrelated things which only distracts. There are plenty of tools like MS Paint to get rid of unneeded info.
  3. In short:
    ā€“ if ā€œnameā€ is defined on a card level - it will be displayed when a graph is NOT selected;
    ā€“ if ā€œnameā€ is defined on an entity level - it will be displayed when a graph is selected.

I donā€™t seem to have the option to insert code on my phone, anyway Iā€™ve update the code and the pictures; hope you are less distracted now and maybe able to help.

As it was explained here:
Test with this:

type: custom:mini-graph-card
entities:
  - entity: sensor.living_room_temperature
    name: Living Room

Thanks for the suggestion, unfortunately that didnā€™t work.
ā€œbad indentation of a sequence entryā€