Lovelace: mini graph card

Is this in HA?
It looks very nice :smiley:

If yes, would you mind share the config?

Thanks :slight_smile:

It is HA Lovelace, base theme is dwains theme and I made this custom addon for it. There is no reason you couldnā€™t use it without the base theme however as itā€™s all just lovelace resources used in conjunction together.

Same here. I tried to configure soft limits on the graphā€¦

Awesome job!
Is it any way to get a time label on the x-axis? I think that would be great! Now itā€™s a little bit hard to know what you really are looking at without clicking around on the graph.
image

5 Likes

Do you have any other idea or tests I could perform ? Thanks

i would like to implement a monthly versio of the 7 days so not 7 days groups but by month
anyone ideas?

currnetly config for 7 days;

type: 'custom:mini-graph-card'
name: Energy consumption
bar_spacing: 2
decimals: 3
group_by: date
height: 200
hours_to_show: 168
icon: 'mdi:flash'
unit: kWh
update_interval: 60
entities:
  - entity: sensor.monthly_energy_peak
    name: Piek
    aggregate_func: max
    color: orange
  - entity: sensor.monthly_energy_offpeak
    name: Dal
    aggregate_func: max
    color: 'rgb(52, 152, 219)'
show:
  labels: false
  graph: bar
  hour24: true
  extrema: false
  average: false

also i just started the graph and it show 7 days but i only started collecting from today so it takes the first 6 days equal to to last day? Anyone knows how to set those first 6 to zero or to hide them?

This is not the tool for graphing monthly statistics. Look at Grafana and influxdb instead.

how do you connect grafana with the local hassio db then?

This is not the place to ask.

1 Like

Thank you for your helpā€¦

Iā€™ve tried installing this card but getting an error that I canā€™t work out.
Installed using HACS.
Installed to;

/local/community/mini-graph-card

Hereā€™s the top of my ui-lovelace file that shows other working resources including the non working mini-graph-card

resources:
  - url: /local/community/lovelace-slider-entity-row/slider-entity-row.js
    type: module
  - url: /local/community/media-player-mini/mini-media-player-bundle.js
    type: module   
  - url: /local/community/mini-graph-card/mini-graph-card-bundle.js?v=0.9.3
    type: module
  - url: /local/custom_cards/icloud3-event-log-card.js?v=1.000
    type: js

Here is where I am trying to create a quick test card;

      - type: custom:mini-graph-card
        entity: sensor.rumba_memory_usage

and here is the resulting error in the card on the dashboard;

Cannot read property 'length' of undefined
type: 'custom:mini-graph-card'
entity: sensor.rumba_memory_usage

Any help would be appreciated.
Thank you!

if you install using hacs no need to add the recources manually anymore, they are done automatically in config > lovelace ui > recources

trie to remove those recources in your ui file and restart your server and make the entity card again (make a manual card with this:

type: custom:mini-graph-card
entity: sensor.rumba_memory_usage

so no ā€˜-ā€™

you can also trie this in th manual card:
comes in handy if you want more entities in 1 graph card

entities:
  - entity: sensor.rumba_memory_usage
type: 'custom:mini-graph-card'

Thanks for the help, but sadly none of that has worked for me.
If I remove the resources from the top of my UI file, then it breaks all my custom cards that I have working.

  • I can however see them all as well in config > lovelace ui > recources

I tried changing the card as well, and still no luck.
I did consider whether it was something to do with changing over to hacsfiles from community, but i tried all combinations of that as well, and still it made no difference.

are you on the latest stable build of hassio and hacs?

Hi something i forgot to mention
in order to let this work install following hac plugins
card-tools

This is a collection of tools to simplify creating custom cards for Home Assistant
If you see ā€œCanā€™t find card-tools. [ā€¦]ā€ in your Home Assistant UI, this is what you want.

please install this and remove the recources in you ui yaml file and let me know if you still have the cant find the custom ā€¦

Thanks again.

I have now installed the card-tools plugin.
Sadly if I remove the resources from my UI file, it still breaks all the links to everything else.

The error I am now receiving on the mini-graph-card is;

Cannot read property ā€˜lengthā€™ of undefined
type: ā€˜custom:mini-graph-cardā€™ entity: sensor.rumba_memory_usage

Also, yes, on latest release for everything, however my HACS folder is all still based on community and not hacsfiles.

1 Like

from my opnion i would reinstal hacs following the install procedure on their website.
in that mather all links will be correct and functioning
hacs has to be installed in the ā€œcustom_componentsā€ folder

in www/community the differents plugins wil be installed because they should be accesible throught /local/community (symbolic auto link)

when you install a plugin the recource will auto be addded in config > lovelance > recources
card tools will allow the lovelace UI to open through ā€˜hacfilesā€™

i think your base problem is the incorrect installation of hacs

to be clear you acces tour lovelace UI file by:
go to a dashboard > three dots upper right corner > edit > three dots upper right corner > raw
???

i have no recources listed there
everything goes by the recources from config > lovelace > recources (automatic if you install a plugin from hacs and added afterwarths to lovelace ==> after installation there willl be a pop up on the plugin screen that says add to lovelace, thats making the symbolic link)
card tools delivers me the ā€˜hacfilesā€™ to lovelace link ==> so all my plugins work because of that without the mentioning of recources in my ui file

This card doesnā€™t depend on card-tools.

From reading the error, itā€™s most likely because you didnā€™t provide a valid card config, entity is not a valid root option, entities should be provided as a list, try the following instead:

type: custom:mini-graph-card
entities:
  - entity: sensor.rumba_memory_usage
1 Like