Create Grafana time series visualisations of stored IoT data from Pareto Anywhere.
Learn how to create geomap visualisations in Grafana with IoT & RTLS data from Pareto Anywhere.
A PostgreSQL database and Grafana installed.
Create a new geomap visualisation with PostgreSQL query.
In Grafana, open an existing dashboard, or create a new dashboard.
From the top menu of the dashboard, click Add and select Visualization.
An Edit panel screen will appear, similar to that shown below.
From the Visualization pull down menu at right, select Geomap.
Grafana offers the possibility to prepare a query via a Builder tool or a Code entry option. In the Queries window, select the Code entry option.
In the code window, enter a PostgreSQL query based on one of the following examples:
All real-time locations over the last minute.
SELECT ST_X(geom) as longitude, ST_Y(geom) as latitude, devicesignature, timestamp FROM spatem WHERE timestamp >= NOW() - interval '1 minute' ORDER BY timestamp DESC;
Location and timestamp of each device's most recent button press.
SELECT DISTINCT ON (dynamb.devicesignature) dynamb.devicesignature, translate(dynamb->>'isButtonPressed', '[]', '{}')::boolean[] as isButtonPressed, ST_X(spatem.geom) as longitude, ST_Y(spatem.geom) as latitude, dynamb.timestamp FROM dynamb JOIN spatem ON dynamb.devicesignature = spatem.devicesignature WHERE true = ANY(translate(dynamb->>'isButtonPressed', '[]', '{}')::boolean[]) ORDER BY devicesignature, timestamp DESC;
Click the Run query button to validate that the query is successful. Correct any errors and repeat as necessary.
The query should now be visualised correctly. It is now possible to customise the panel, which is covered in Step 2 below.
Customise the visualisation and the panel.
Details to come.
Tutorial prepared with ♥ by jeffyactive.
You can reelyActive's open source efforts directly by contributing code & docs, collectively by sharing across your network, and commercially through our packages.Continue exploring our open architecture and all its applications.