Creation of a Dashboard
This guide will walk you through the process of creating your first dashboard in Grafana, using InfluxDB as the data source. For this tutorial, we will connect to the local InfluxDB server hosted at https://iot.hs-pforzheim.de/influx/.
Prerequisites
Before proceeding, ensure that:
- You have access to the Grafana instance. A user is provided by the lecturers.
- The InfluxDB server at
https://iot.hs-pforzheim.de:8086/is running. - You have the necessary credentials to access InfluxDB (if authentication is required).
Login and Creation of the Dashboard
Login to Grafana
- Open Grafana in your web browser. The URL is
https://iot.hs-pforzheim.de/grafana. The Grafana instance is accessible without active use of VPN.
- Log in using your provided email or username and password.
- You might be prompted to change your password after logging in. If so, choose a strong password and proceed.
- If you see a dropdown on the top right corner (might not be the case for everybody!): Ensure, you are associated with the organisation “Württembergische VWA”. You can ensure this by looking at the top-left side of the interface.

Check Connection to the InfluxDB Instance
- In the Grafana side menu, navigate to Connections.
- Select Data Sources.
- Check, if the list has the available option called IoT InfluxDB.

- In the connection settings, the following details should be visible:
- Type: InfluxDB
- Query language: Flux
- URL:
https://iot.hs-pforzheim.de:8086/ - Auth: Skip TLS Verify (only tick this option)
- After validating in the details, you can create your first dashboard.
Creating Your First Dashboard
- Once you have successfully connected to InfluxDB, return to the Grafana side menu.
- Click on Dasboards and select the button New. Next, select New Dashboard

- On the landing page, select Add visualization

- Select the
IoT InfluxDBas data source to begin building your first panel.
- In the Query editor, build a query to retrieve the data from your InfluxDB instance. You can use the query builder to select measurements, fields, and time ranges or write a custom query.

- To easy create a query, you can navigate to the InfluxDB interface and use the Data Explorer to build a query.

- Select your bucket
- Select your preffered measurement, e.g.
air_pressure. - Select the corresponding field, e.g.
air_pressure. - Click the button SCRIPT EDITOR to see your query.

- Copy the querie’s code to paste it in Grafana.
InfluxQLfrom(bucket: "vwa_group0") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r["_measurement"] == "air_pressure") |> filter(fn: (r) => r["_field"] == "air_pressure") |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false) |> yield(name: "mean") - Hit the Query inspector to check if your query returns data.

- Choose the appropriate visualisation type for your data, such as a graph, table, or heatmap, depending on how you want to display the information.

- Adjust the panel settings to customise the appearance of your visualisation. You can change colours, axes, and formatting options to make the data presentation more intuitive.
- Save the panel and provide it with a meaningful title that reflects the data being displayed.
- Continue adding panels to the dashboard to visualise different data sets, if necessary. Followed below are two possible outcomes in terms of granularity of displaying the data.

Exporting and Importing Dashboards
Exporting Dashboards
If you want to share your dashboard with others or migrate it to a different environment:
- Open the dashboard you wish to export.
- Click the Share button and select Export.
- Save the dashboard as a
JSONfile.
Importing Dashboards
To import an existing dashboard:
- In the side menu, navigate to Create > Import.
- Upload the
JSONfile of the dashboard you want to import or paste the content into the provided input field.
Conclusion
By following these steps, you will have successfully created your first Grafana dashboard connected to an InfluxDB instance running on the local server at https://iot.hs-pforzheim.de:8086. Grafana offers extensive options to customise your dashboards, including visualisation styles, data transformations, and alerting mechanisms. For more advanced configuration options, refer to the official Grafana documentation or contact your lecturers.