Lovelace: mini graph card

Yep, Switched to MariaDB, keeping 7 days as well, still slow :frowning_face:

But it’s faster than the default SQLite db at least (I think?) :laughing:

Yes, slightly faster but it should be way faster.
Not sure about your setup, but I am using my hosting servers to host the mysql database, and those are fast…
I also checked connectivity, but 20Mbps even if are not that much, are quite enough for MySQL queries…
So, for now, I think my bottleneck is the raspberry itself, I will have to test other HW soon to make it a little more performant :smiley:

I’m running HA and the database on the same server, and it’s pretty beefy, so should be fast imo :slight_smile:

So not a Raspberry but a server, and it is still slow?
If so, there is some serious design problem there :open_mouth:

Yes, database is located on a regular hdd though and not an ssd, not sure if that could make any difference.

No, not on an application that should work on a raspberry tho :slight_smile:
Got hundreds of hosted websites and everything works smoothly, this is just too slow, not sure what’s wrong tho… it might be db design or queries or even completely something different.

It might also be that the query response is fast but the “lookup” process is slow.

You should have a look at the tables in there… kinda a mess :frowning:

Just did, my states table have 191700 lines in it and I’ve been using MariaDB not even for a week now :open_mouth:

there’s not any issue with mariadb and many lines as log as you don’t need sql with joined tables…
I have mysql dbs with tables with more than 100 million lines running on low end machines

in HA on raspberry there are other problems:

  • a small amount of ram
  • micro sd
  • probably a bad design with tables or queries

I don’t run MariaDB on my Pi so 1 and 2 are off the list :stuck_out_tongue:

I never said MariaDB was the problem.

What I said is that probably there was a design issue or a data management (post-query results) that wasn’t tweaked enough.

I do run MariaDB aswell on separated dedicated harware.

The HA issue might be by design or because of the raspberry, but those problems also appears on powerfull VMs, so it is probably somewhere in the design/implementations.

Can someone help me using this on a docker installation?
Where do I have to paste the “mini-graph-card-bundle.js”?

Thanks

The www folder… just follow the instructions. It’s no different to any other custom-card

This is my first attempt to install a custom-card.
I can’t find any www folder. I just found a config folder with a daemon.json file, but I can’t paste anything there, it’s read-only folder and can’t change to write.

You may need to create the www folder. Mine for example is here:

~/docker/homeassistant/www/

Is there a way to use this card (or another card) to show just the static value (no history, just what it is right now) of a percentage sensor in a bar chart? I’m trying to do this for my disk usage sensor, but it seems to show at minimum two bars.

  - type: custom:mini-graph-card
    name: Disk usage
    hours_to_show: 1
    points_per_hour: 1
    upper_bound: 100
    lower_bound: 0
    entities:
      - sensor.disk_use_percent
    show:
      graph: bar

Even though I’m specifying to show 1 hour and 1 point per hour, it still shows 2 bars.

Yes, there’s a bug in the latest release where the bar chart will show an additional bar.
The fix will be in the next release, and you should only see one bar with your config.

The bar will not represent the current state exactly though, unless the sensor only updates once an hour, it will show an average of all history entries from the past hour.

1 Like

Cool. Showing an average is fine, as long as there’s just one value.

Thanks!

I gave it some more thought, and I think the graph algorithm should be robust enough now to possibly let users specify floating values for hours_to_show.
Then you would be able to set something like hours_to_show: 0.00001 and get the desired result.

I’ll see if it can be made possible.

Just tried that. Anything less than 1, and it shows the default number of bars.