1.5 Create your first Node-RED flow

Once the nodes for the device have been created, we can now add create a simple Node-RED flow. This flow will cyclically get the process data from the connected distance sensor and display the data on a dashboard.

For the first step, we use our imported process data node. To trigger the data exchange, we need to create a trigger. The inject node is selected for this purpose:

The inject node need so to be configured (double-click) to execute cyclically:

Now, connect the inject node with the process data node:

Please note that this direct connection is only valid for devices without output data (data from the Pinebox to the device). If there is output data, the inject node needs to be connected to the node that compiles the output data.

To place an output gauge, a new tab for the dashboard needs to be created:

Create a new tab:

Within the new tab, create a new group:

The output distance data now can be connected to a gauge node:

The upper output of the PDV1 is the actual value, the other two outputs are Min and Max values. The gauge needs to be assigned to a dashboard group to be visible in the dashboard. To use the previously created dashboard, select the following:

Now, you need to deploy your changes:

If you now go to the dasboard page (e.g. over the Pinebox web interface), you will see the gauge:

You may now set the colors, labels and thresholds to match with the distance sensor’s parameters:

Congrats! You have created your first dashboard using live data from a sensor with the Pinebox.