Dbstats - Addon for database usage analytics

Hi! That’s my forst post here, don’t be too strict :slight_smile:

I saw many people who were struggling to analyze, what’s taking up space in Home Assistant. We have Quick Start to Home Assistant Data Science | Home Assistant Data Science Portal - but… That’s a bit complex even for me, with my 20 years of web developent.

So I decided to make my own addon, anyway I thought it will be a fun experience.

So, meet DbStats - addon with several simple charts to make things clear.
Installation instructions are here - https://github.com/jehy/hass-addons/tree/master/dbstats .Addon works with mysql/maria, postgres and sqlite.

One of the charts for example:

BTW, it’s built using Node.JS, TypeScript, React and MUI.
Feel free to use, test, star and contrubute.

13 Likes

Wow… thats nice.

amazing, also shows long-term ain’t as small as one might think:

1 Like

Yup. Also, we can add any other charts, it’s really simple with addon.

Nice, how about a deep dive into the long term, as you can see, thats 5-6 times bigger than the rest of my db

Very nice. Makes me want to stop using MariaDB. Though it would be a chore to convert my SQL sensors.

How do I integrate this for Mariadb and Influxdb? The log shows “exec /init: exec format error”. Not quite sure what to put in the config options connectionString* area.

1 Like

Hi! Feel free to contact me on github. Please post your config and logs without sensitive data to help me reproduce any bugs.

Thanks for this nice add-on! For total noobs like me, it would be useful to add the default connection string in the doc (sqlite:////homeassistant/home-assistant_v2.db).

Just run it on the DB and apparently the persistent_notification domain is by far the largest event source. I didn’t even realise I was using this. Any idea where I can start digging to reduce this?

I moved my database to the share folder, how do I configure the addon to look for the db in the correct place?


[Nest] 177  - 07/25/2024, 11:00:24 PM   ERROR [ExceptionHandler] SQLITE_CANTOPEN: unable to open database file
Error: SQLITE_CANTOPEN: unable to open database file

The default connection string in the configuration is sqlite:////homeassistant/home-assistant_v2.db, you should adapt this to use the location you set.

I tried:

/share/ha_db/home-assistant_v2.db

and

sqlite:////share/ha_db/home-assistant_v2.db

None worked

very interesting addon.
thanks for your work!!