Lovelace: mini graph card

Possibly in the future.
If you have time and feel like it, have a look at how button-card solves it and submit a PR to mini-graph-card.

Not possible, there’s a feature request for this open on github already though.

Should change with line color, based on current state.

Are you sure, should def be fixed, try clearing cache :thinking:
Related:

This should now be fixed, pressing either legend entry will trigger a more-info popup for that entity, the same now applies for states displayed.

1 Like

Ok, I have found my issue, for some raeson I was loading mini-graph-card.js instead of mini-graph-card-bundle.js which HACS was keeping udpated, not really sure why I had the old file in the HACS folder, it looks it was from 15th July and I am pretty sure I did install it via HACS.

Anyway, fixed that and now is working… basically I’ve been updating and not using anything that was fixed since July :smiley:

Thanks!

1 Like

Actually, apparently I had the previous version already… so… well this is the first update I would have missed and if it wasn’t for that issue we found, I wouldn’t have notice at all since everything else has been working perfectly for me :slight_smile:

1 Like

Wooh, that’s wierd… I’m not on the latest HACS version but I’ve skimmed through the release notes and couldn’t find anything regarding this.
Good to know though, thanks for letting me know! :+1:

Yes it’s quite odd to be honest, also because my resource bit where you load the file also had the wrong name, maybe I did something wrong the first time I installed HACS and I kept that mistake around until I finally noticed…

Beside that, I got a question!

On GitHub there is this intresting example that is using an extrna input_number to define night/day and add a gray area.

I was trying to replicate but I am not sure on what value the input_number should be, I tried with 0/1 but it doesn’t fit the graph (not even sure it’s actually appearing on the graph).

Presumably, the high-value should be higher then current temperature?

Also, What if I don’t want to use the fill option on the temperature line but I do want it on the night/day graph? Would that be possible?

Thanks :slight_smile:

I have been trying to use the dynamic colours for hours, with no luck. Then I realised they don’t work inside incard vertical stacks: https://github.com/custom-cards/vertical-stack-in-card

I am brand new to this and have no idea where to report a bug. I simply wont use it in one of those cards, but thought I should let you know that it doesn’t show the gradients. Picture attached.

By the way, this is a fantastic resource!

EDIT: I just tried it in a standard vertical stack, and the same thing happened. Will not show the dynamic gradients.

I love this graph, but now I have a question, I have a sensor, that update his value once a day, it’s possible to have a bar graph with 7 bars and each bar have the value of each day?

Right now I have this code, but this is not what I was expecting

- type: custom:mini-graph-card
  entities:
  - entity: sensor.energy_washing_machine_day
  name: Washing machine weekly
  show:
    graph: bar  
  hours_to_show: 168
  points_per_hour: 0.04166666667

Can someone help me please?

Shouldn’t really matter, 1/0 should be fine, just remember to put it on the secondary y-axis as in the example!

There’s a show_fill alternative, which you can specify for each entity, for a full list of entity specific options see, entities-object

Hello and welcome! :smiley:
Thank you!

Hmm…strange, it’s working fine for me both inside a vertical-stack & a vertical-stack-in-card, (I’m still on HA 0.96.0 though).

Would you mind telling me what browser you are running, desktop/mobile and HA version?
Thanks!

Thanks, currently not possible I’m afraid, with your current config you’ll have each 24h span calculated from the current time (not at midnight).

Support for daily charts has been requested on github and seems like a popular demand, hopefully I can pull that off sooner than later.

I’m using the Utility Meter component of home assistant and the sensor is updated at midnight every day. https://www.home-assistant.io/components/utility_meter/

Thanks, I actually didn’t notice that the show_fill was also available per entity, pretty nice :slight_smile:

I did copy the night_time bit directly from github creating the input_number myself, but it doesn’t seems to be working for me.

Here is the code I am using:

                 - type: custom:config-template-card
                   entities:
                     - sensor.house_temperature
                   variables:
                     - states['sensor.house_temperature'].state
                   card:
                     type: custom:mini-graph-card
                     name: Temperature
                     icon: "${vars[0] > 30 ? 'fas:thermometer-full' : vars[0] > 25 ? 'fas:thermometer-three-quarters' : vars[0] > 20 ? 'fas:thermometer-half' : vars[0] > 10 ? 'fas:thermometer-quarter' : 'fas:thermometer-empty' }"
                     more_info: false
                     height: 150
                     line_width: 4
                     hours_to_show: 168
                     points_per_hour: 0.25
                     group: false
                     hour24: true
                     animate: true
                     decimals: 1
                     font_size: 100
                     font_size_header: 14
                     align_header: default
                     align_icon: right
                     align_state: center
                     lower_bound: -5
                     upper_bound: 40
                     show:
                       name: true
                       icon: true
                       state: true
                       graph: line
                       fill: true
                       points: false
                       legend: true
                       extrema: false
                       labels: false
                       name_adaptive_color: true
                       icon_adaptive_color: true
                     color_thresholds:
                       - value: 5
                         color: "#0055FF"
                       - value: 15
                         color: "#FF6600"
                       - value: 20
                         color: "#FFAA00"
                       - value: 22.5
                         color: "#FF7700"
                       - value: 25
                         color: "#FF3700"
                     entities:
                       - entity: sensor.house_temperature
                         name: House
                         color: '#FF5000'
                         show_state: true
                       - entity: sensor.dark_sky_temperature
                         name: Outside
                         color: '#0099CC'
                         show_state: true
                       - entity: input_number.night_time
                         color: gray
                         name: Night Time
                         show_fill: true
                         show_line: false
                         show_points: false
                         show_legend: false
                         y_axis: secondary

And the outcome is:
image

Technically, last night the sensor should have been to “1” all night, so I should be able to see at least for yesterday the grey “background”, do you see anything clearly wrong?

Thanks, as usual :slight_smile:

1 Like

I am using the speedtest component for internet and trying to show it results with mini graph with no sucess. A speed verification is done at 5h00m everyday. I would like to show a 7 day range with bar type.
At the moment I believe that it is not possible to do it, but I can be wrong.

      - type: custom:mini-graph-card
        hours_to_show: 168
        points_per_hour: 0.0416
        animate: true
        hour24: true
        decimals: 1
        entities:
          - entity: sensor.speedtest_ping
            name_adaptive_color: true
            state_adaptive_color: true
            show_indicator: true
        show:
          labels: true
          extrema: true
          graph: bar
          name_adaptive_color: true
        line_color: '#ff00ff'
        line_width: 4
        font_size: 75

Since it is measured once a day: 1/24 = 0.0416. Tryed other values too.

What I get is:
sshot-1

When I should get something more like (using Grafana):

Am I missing something? Can it be done? Thanks.

Well, I just recreated the graphs I pictured on my last post, and they now work. Very strange. I am very new, and 100% think it is something I did wrong. Sorry for wasting your time.

1 Like

Thanks for finding that issue. I just discovered that mine was the same.

1 Like

Why i get this everytime i refresh the views?

18

And this happens for all the cards using mini-graph.

I don’t see anything wrong with your config, although I haven’t played around with the feature much myself, could be related to this issue.

Should be possible, although it won’t give you a bar for each “day” but instead a bar for each 24 hours calculated from the current time.
The graph looks weird though, looks like it’s missing data.

You’ll see that until the data is loaded, it’s basically a placeholder, mainly there to circumvent the jumpy/jacky effect you’d get if the card would resize once the data was loaded, which would push down all the other cards below it.

Could the placeholder be nicer? yes :laughing:

Just an idea, you could try making more measurements each day, the mini-graph-card will calculate the moving average, so would probably work better, and should also give you a more accurate result.

I am also having issue with speedtest, but it’s because the sensor have no data, I think the implementation it is no longer working, therefore it “destroy” the graph.

Regarding my issue I will look into that link on Monday evening (or Tuesday) since I am leaving about now for a long holiday weekend :slight_smile:

Thanks

1 Like

Sweet, have a great weekend! :slight_smile:

1 Like

I realized that my recorder in fact purge data before 7 days. You have the reason, that is probably the lack of data. The data is passed to inlfluxdb, so in grafana I have a long history. But I would not like to have 7 days for all my sensors, HA do not permit individual setting. So I will have do decide. Maybe keep the grafana in order to avoid a massive database for my weak pi.
Thanks for the tips.

1 Like