Grafana MySQL and Hassio

Hi
Do someone here use Grafana with MySQL?

What I have read here

that I have to use convert so Grafana understand the info from MySQL and when I read this thread

I understand a little but not so much that I can get it to work

Right now I just want to have the information from the “states” table

For exampel I want to have “last_updated”, “state” and “entity_id”

so I easy can use to list value from a sensor and even the timestamp to create a table or a Graph

When you use the Grafana add-on, you can simply add the MariaDB add-on as a server to connect to.

Thanks for the replay
I don’t use MariaDB, I have a MySQL server on another computer on my network.
I have no problem to connect to the MySQL server from Grafana but I have problem with the SQL to get the information I need to show.

Me too, I can connect my grafana to mysql but don’t know how to get sensor data from this. And I also don’t want to take so much time to learn SQL just for this.

Well I did got it to work. did take sometime but I did not look so much at it so after a while I did remove it.
To bad I did not save the SQL

I am planning to use MariaDB to store persistent data but thing doesn’t seem so well, because I run both MariaDB and home assistant in one raspberry Pi, some time both MariaDB and Home assistant use to much ram and cpu and I don’t know why, nothing can sop this behavior, even when I restart Home Assistant, until home assistant hanging and doesn’t record anything but web page still accessible, and I manually restart Home assistant Again thing become normal.
I assume this is because I set 'keep_days ’ too long (365 days) and now I make it default and monitoring home assistant behavior.
May be I will export data to excel or csv file periodically, and use MariaDB only for temporary store.

@frenck attempting to use the MariaDB Hassio addon with the Grafana addon I get the following error from Grafana:
image

Having:

You need to use the internal hostname: core-mariadb

8 Likes

I have MariaDB set up and working, I have Grafana set up and linked to MariaDB.

I can see events etc. in Grafana but can’t get individual sensors to display in Grafana unless Im doing something wrong, can this be done or should I be using InfluxDB

Ops, just found this, I guess this answers my question:

1 Like

Hello everybody,

On my side, I use mariadb add-on and grafana add-on…

In the datasource settings, I use core-mariadb:3306… but I always get a 400 error…

Any idea where it can come from ?