Lovelace: mini graph card

Thanks. I’ve been looking for this, but unfortunately I seem to be unable to reproduce your results. All I did was change my entities but things still don’t seem to line up properly.

image

Check this post about vertical misalignment.
Nothing we can do with that.

P.S. Try not using AM/PM time format. It will help - a little (see example on the post mentioned above).

Hi everyone!
Can someone help me? I need to know if theres a way to change de offset position (top, bot) on css of the card. Mine looks bugged because other templates that i use. As you can see, the min and max values they get cut and dont show:
image
image

My code:

          - type: custom:mini-graph-card
            entities:
              - entity: sensor.mikrotik_ether1_rx
                name: test
            name: Download Link 1 
            line_color: var(--state-icon-active-color)
            hours_to_show: 1
            points_per_hour: 10
            min_bound_range: 1
            show:
              icon: false
              average: false
              extrema: true
              state: false


          - type: custom:mini-graph-card
            entities:
              - sensor.mikrotik_ether1_tx
              - sensor.mikrotik_ether1_rx
            name: Upload Link 1 
            line_color: var(--state-icon-active-color)
            hours_to_show: 1
            points_per_hour: 10
            show:
              legend: false

You can probably do it with card-mod. Head over to one of the huge card-mod threads for help.

I thought about it at first. however, even putting the css there, and it appearing in the page code, has no effect on the styles.
I dont know, but the style should be first on the code, right? the card_mod is putting after the code of the card itself:

The code with the card_mod custom:

          - type: custom:mini-graph-card
            entities:
              - sensor.mikrotik_ether1_tx
              - sensor.mikrotik_ether1_rx
            name: Upload Link 1 
            line_color: var(--state-icon-active-color)
            hours_to_show: 1
            points_per_hour: 10
            show:
              legend: false
            card_mod:
                  style: |
                    .graph__labels {
                      top: -30px;
                      }

This doesn’t have anything to do with the mini graph card directly.

Seek help here:
:small_blue_diamond: Card-mod - Super-charge your themes! - Share your Projects! / Themes - Home Assistant Community (home-assistant.io)
:small_blue_diamond: Card-mod - Add css styles to any lovelace card - Share your Projects! / Lovelace & Frontend - Home Assistant Community (home-assistant.io)

Anyway, try:

            card_mod:
                  style: |
                    .graph__labels {
                      top: -30px !important;
                      }
1 Like

Thanks man, the !important flag solve the problem. Thank you!

1 Like

Anyone advise how I could move the humidity text just underneath the temperature? I have seven MGC in a row and there is not enough space to have the temp and humidity side by side because of the screen ratio of my main tablet.

image

type: custom:mini-graph-card
entities:
  - sensor.temperature_xiaomi_rumpus
show:
  labels: false
style: |
  ha-card .states.flex::after {
    color: orange;
    content: "Humidity: {{states('sensor.humidity_xiaomi_rumpus')}}%";
    white-space: pre;
    background-color: rgba(50,50,50,0.4);
    padding: 15px 15px 15px 15px;
    border-radius: 5px;
  }

I’d like to do something like this:

image

Scroll two posts up and check those links.

  - type: custom:mini-graph-card
    entities:
      - sensor.cleargrass_1_temperature
    show:
      labels: true
    style: |
      .states.flex {
        flex-direction: column;
      }
      .states.flex::after {
        color: blue;
        content: "Humidity: {{states('sensor.cleargrass_1_humidity')}} %";
      }

изображение

Examples here (scroll down for mini-graph-card):
post

2 Likes

Gee Whiz! That is freak’n awesome, thank you. Would have never figured that out on my own. :+1:

is there a way to filter out entities? i have some probes that are used now and then and want to filter them out when they are unavailable or unplugged so i dont have to update the config

mini-graph-card + auto-entities

Is there a way to add binary switches with analogue values? I want to show when the switch to my air purifier turns on, and then have the air gas reading on the same graph. Is it possible?

Same as for day/night background graph.

Sorry wrong thread…

The post should be placed in another thread

Can someone please explain how the ‘fixed_value’ setting works? From the description, it sounds like it should just use an entity’s current state rather than looking at its history. I can’t seem to get it to work that way.

My situation is this: I’m using the Dark Sky weather integration (sensor version) which give me lots of individual sensors for rain probability by hour e.g. sensor.precip_probability_1h, sensor.precip_probability_2h, sensor.precip_probability_3h, etc…

I’m trying to graph these as a bar graph, and also exclude these sensors from the recorder (I really don’t need to save any history for these). But it only seems to work if I do enable recording of the sensors. I thought using ‘fixed_value: true’ would allow me to exclude recording of these sensors.

According to the source code:

    if (this.config.entities[index].fixed_value === true) {
      const last = stateHistory[stateHistory.length - 1];
      this.Graph[index].history = [last, last];
    } else {
      this.Graph[index].history = stateHistory;
    }

for this sensor only the LAST value is used to build a graph, the values are taken from DB.

Thanks. So in this case I would still need to record the history for these sensors since the card does look in stateHistory?