Easily integrate your weather station measurement data into Grafana through the Crodeon API
Are you looking how to integrate your measurement data into Grafana? In this blog we'll take you through the process of linking the Crodeon Cloud API to your Grafana dashboard!
You can use the API for your weather station, cold room monitoring kit, water quality kit, or any other Reporter measuring system.
Crodeon Dashboard vs Grafana
The Crodeon Dashboard is a user-friendly cloud platform that allows you to easily view your data. However, when you want to see extensive graphs or transform your data, the Crodeon Dashboard might not live up to your expectations.
Grafana is an open-source, multi-platform analytics and interactive visualisation tool used for monitoring and analysing data. It connects to various data sources, such as time-series databases and monitoring platforms to create charts, graphs, and alerts. Grafana's flexible interface enables users to visualise and track data.
Connect Crodeon API to Grafana
At Crodeon we built several API options that allow you to integrate your data (live and historical) into third-party platforms or software. For example, you can connect your weather station to a third-party platform using our API.
Let's have a look at how to connect the Crodeon Cloud API in Grafana.
Step 1: Create your API token in the Crodeon Dashboard
For this guide we'll be using our demo Reporter, weather station Roermond, this weather station with API is publicly accessible in the Crodeon Dashboard.
To create your personal API key in the Crodeon Dashboard you follow these steps:
- Go to the group overview of your Reporter(s)
- Click the three vertical dots right of your group name, a menu will appear
- Select 'Manage access tokens', a pop-up window will appear with a button 'ADD NEW TOKEN'
- Give a name to your token and set an expiration date if necessary, click 'SAVE'
- You will now get another pop-up window with your personal API key
- Save this key somewhere as you are unable to view it again!
- Do not share this API key with others!
Step 2: Create a data source in Grafana
We just made an API key for the Crodeon Cloud, now we're going to create a new data source in Grafana that makes use of the data from the weather station through the Crodeon API.
-
Go to your left menu in Grafana and click the sub menu called 'Connections', then click 'Add new data source'
- Search for 'Infinity' in the search bar and select Infinity as your data source of choice
- In the Infinity app, select 'Add new data source' in the top right corner
- Give your data source a name, for this purpose we chose 'Crodeon-API-Demo-Infinity-datasource'
Step 3: Set up authentication for your Grafana data source
Now that we have a data source, we can authenticate the connection and configure all our API settings.
- Click 'Authentication' in the left menu
- Select 'API Key Value pair'
- Enter 'X-API-Key' in the Key field and enter your API key in the Value field
- Enter https://api.crodeon.com/api/v2 in the Allowed hosts field
- Click 'Save & test'
Step 4: Choose your type of Crodeon API call
The API connection is authenticated, now we can choose our type of API call. This determines what kind of data you'll be requesting from the weather station with API.
- Visit the Crodeon API documentation on our stoplight page, here you can choose what kind of data you want to visualise in Grafana:
For our examples, we'll be getting historical measurements per channel. Read on: