Displaying Sensor Data with Forge's Grafana Plugin

Welcome to our showcase article, where we demonstrate how OPC UA Forge brings real-world data pipelines to life. In this scenario, air-condition sensors stream their measurements as JSON messages to an MQTT broker. Forge consumes this data, harmonizes the structure, and buffers it for visualization, making the information consistent, scalable, and ready for further use. From there, Grafana presents the data on a monitoring dashboard, with the Forge plugin handling the connection details so the integration stays effortless and reliable.

Flow diagram showing how Ruuvi sensors send measurements through a RuuviGateway to an MQTT broker, which forwards the data into OPC UA Forge. Forge then provides the data to the Forge Grafana Plugin and InfluxDB using an information model.

During this tutorial, we’ll be using the following products from Prosys OPC:

1. Sending Ruuvi Sensor Data to MQTT Broker

In this demo, we collect environmental data using RuuviTag Bluetooth sensors and Ruuvi Air air-quality sensors. Both sensor types connect to a RuuviGateway, which forwards their measurements to an MQTT broker as JSON messages. With Prosys OPC UA Browser—or any MQTT client—you can inspect the sensor topics and payloads in real time. The image below shows an example of the JSON data format, with new messages published once per second.

Ruuvi Sensor MQTT Payload

2. Creating Information Model of the System

In the next step, we import an information model into Forge’s address space to represent the RuuviGateway, its sensors, and all measurement variables. This creates a structured view of the entire system inside Forge. From there, we can enhance the raw data with additional logic using Forge’s Expressions feature. For example, the QualityScore value in the image below isn’t provided by the sensor itself, but it’s calculated dynamically from multiple measurement variables.

Ruuvi Sensor Information Model

3. Connecting Forge to the MQTT Broker

Next, we establish a connection between Forge and the same MQTT broker used by the RuuviGateway to publish its measurements. In this demo, we use a locally running Eclipse Mosquitto broker without any security, but the setup can be secured using authentication or MQTTS when needed. This allows Forge to reliably subscribe to the sensor topics and start processing the incoming data stream.

Connecting Forge to MQTT Broker

4. Configuring MQTT Subscriber

Now we’re ready to set up the data flow from the incoming MQTT messages into the standardized information model. We create MQTT subscribers for the relevant measurement topics and map the parsed values directly to their corresponding OPC UA nodes. This process transforms the raw JSON payloads into structured data, making it easy to scale, visualize, and further process.

MQTT Subscription for the Ruuvi Sensor

5. Grafana Dashboard

Finally, we configure historical buffering for the measurement data in Forge using the History module. This enables Forge to store past values and serve them efficiently to external applications. With history in place, we set up Grafana to fetch both real-time and historical data from Forge through the Grafana Plugin, making it straightforward to visualize the sensor values in customizable dashboards.

The image below shows a Grafana dashboard displaying the past five minutes of Ruuvi Air data. On the left, you can see CO2 levels, temperature, air pressure, and humidity. On the right, the graphs present the air quality score and related air-quality metrics, all sourced directly from Forge.

Grafana Dashboard Wiew of Ruuvi Sensor Data

6. Summary

In this showcase, we demonstrated how OPC UA Forge can integrate real-world sensor data into a scalable, standardized data pipeline. Starting with RuuviTag and Ruuvi Air sensors publishing JSON measurements to an MQTT broker, we imported a structured information model into Forge and enhanced the raw data using Expressions to create derived values like the QualityScore. Forge then connected to the MQTT broker, subscribed to the sensor topics, and mapped the incoming measurements into OPC UA nodes for harmonized representation.

To support analysis and visualization, we enabled historical buffering through Forge’s History module, allowing both real-time and past data to be accessed efficiently. Finally, Grafana was configured to retrieve this data through the Forge Grafana plugin, resulting in a clear, intuitive dashboard showing live environmental measurements and air-quality indicators. Altogether, the demo illustrates how Forge simplifies data ingestion, modeling, processing, and visualization, providing a robust foundation for scalable industrial data solutions.

Man sitting at a computer examining a Ruuvi sensor while viewing Grafana charts and OPC UA Forge on the screen.

This demonstration was created by Artturi Korhonen, Jere Jaakkola, and Iivo Yrjölä, combining practical engineering experience with OPC UA Forge’s capabilities to build a clear and scalable example of real-world data integration.

A headshot of Iivo Yrjölä

Iivo Yrjölä

Customer Integration & Support, Prosys OPC

Email: iivo.yrjola@prosysopc.com

Related Posts

Develop OPC UA Applications on Android with Prosys SDK

Develop OPC UA applications on Android with the Prosys OPC UA SDK for Java. This updated guide shows how to get started with Android SDK API 35, including a simple client example. Please note that testing on Android is limited, so full interoperability with all OPC UA systems cannot be guaranteed.

Read More »

Interested in this topic?

Get updated about new posts through our newsletter!