smart-energy-monitor/software/dashboard/docs/csv-import.md

29 lines
1.5 KiB
Markdown
Raw Normal View History

2023-02-24 15:50:24 +01:00
# CSV Import
## Grafana
2023-02-24 16:01:13 +01:00
In Grafana there is a [csv-datasource plugin](https://grafana.github.io/grafana-csv-datasource/). This plug lets you visualize data from any URL that returns CSV data, such as REST APIs or static file servers. You can even load data from a local file path. But it is *not* importing CSV from Grafana into a data source (like InfluxDB) or uploading CSV data to a local file system.
2023-02-24 15:50:24 +01:00
2023-02-24 16:01:13 +01:00
> For visualizing CSV data this is enough. Why should you duplicate data if the true data source is a CSV file located somewhere in the internet. If the CSV is not online, this might be another story.
2023-02-24 15:50:24 +01:00
2023-02-24 16:01:13 +01:00
I added this plugin to our Grafana installation, so it's ready to be used.
2023-02-24 15:50:24 +01:00
> I just mounted the whole [Grafana directory](../grafana/) into our Docker-Compose setup. Maybe we have to come up with a better solution.
2023-02-24 16:01:13 +01:00
Garafana is running on [localhost on port 3000 with credentials admin:admin](http://localhost:3000). So let's get there to add the CSV file as a usable data source.
2023-02-24 15:50:24 +01:00
2023-02-24 16:01:13 +01:00
> I added the CSV file to this repository and mounted it into our Docker-Compose setup. So the CSV file is also available in Grafana. Maybe we have to come up with a better solution..
2023-02-24 15:50:24 +01:00
2023-02-24 16:01:13 +01:00
As the CSV is reachable by Grafana, you can create a data source, there.
2023-02-24 15:50:24 +01:00
![Mounting a CSV file](./images/grafana-csv-data-source.png)
> grafana.ini is also mounted from [this repository](../grafana.ini). So local data mode is enabled.
Whith Grafana having access to data in the CSV file, it's easy to access this data to create a dashboard.
![Using CSV data](./images/grafana-csv-data.png)