How to Use Client Tags for Device Indexing

In this tutorial, you’ll use client tags in Nimbus808 to control which data appears in your IoT dashboard or MQTT application. When multiple devices publish the same data set, you can assign unique topics to identify which machine is sending each data set. By applying a Client Tag, a tag that affects only the client displaying the project, you can filter, organize, and display the correct data source in your Nimbus808 interface.

Nimbus808 Data Source and Tag Setup

First, open the Data Source page and select Devices.
If you don’t have a device yet, go ahead and add one so you can attach tags to it. Then, click the Tags tab to begin configuring your tags.

First add a client tag. Click Add Tag :

We’ll use machineName for the Tag Name :

Select a device for the tag:

Set the scope to client, and click Edit Tag :

Now add a tag that will display data from a machine. Click Add Tag, call this one speed, select the device: ex: HMI. Select MQTT for scope.

For the topic we will reference the client tag by embedding the tag name using a dollar sign and curly braces. Enter the following for Topic :

/machines/${client.machineName:machine1}/stats/

Breaking this down, /machines/.../stats/ are the static parts of the topic. ${client.machineName:machine1} is the dynamic part of the topic. ${} lets delimits the dynamic section. client. refers to the scope of the tag. machineName references the tag created above. The value after the semicolon is the default value for the dynamic part of the topic if the machineName tag is not read or doesn’t have a valid value.

Keep the Payload Format as JSON, click the Use default JSON format checkbox and click Add Tag to add the tag to the tag database.

Nimbus808 Project Configuration

Navigate to the Projects view, and click the Add Project button. Name the Project: MachineStats, enter a description and set the Slug to machine/stats. Use Blank Project for the template, and click Add Project.

In the project, first add a text widget to display the value of the client tag.

Enter: Current Machine: ${1}, for the text widget text.

Under Data click the Add Tag button

Select the machineName client tag.

Add a button widget to set the value of the machineName tag.

In the Action menu, change Mode to Set Value. Select the machineName tag under TAG SELECTOR. Enter, machine1 for the SET VALUE.

Under APPEARANCE > LABEL, enter Machine 1.

Once it is configured correctly, copy this button and, in the copy’s settings, change SET VALUE to machine2. Change the label to Machine 2.

Add a Numeric widget to display the speed. In the widget attributes, select the speed tag under DATA > TAG SELECTOR.

In the File menu select Save and Publish to Runtime.

MQTT Client Configuration

For this tutorial we will use an HMI as a client device.

In the Nimbus808 dashboard, click on the Home view. The broker URL and TCP Port shown on this view are required to configure the client project.

Open your HMI programming software.

Open the MQTT settings to configure the connection.

  • For the Domain name, enable the option to use a domain name and enter the broker URL from your Nimbus808 dashboard.
  • Enter the corresponding Port number from the dashboard as well.
    Click OK to save and return to the MQTT configuration screen.

Next, in your client device (HMI)

  • Pubish to the topic /machineStatus/machineX/status

Once selected, save the configuration and place the object on the screen.

Run the Project

In the Nimbus808 dashboard click on the link for the MachineStats project, in the projects view. Login may be required to access the project.

Click on the Machine 1 button in the MachineStats project, then enter a number in the speed field. Note that the value on the HMI named machine1 changes. Click on the Machine 2 button and enter a different value. Note that the value on machine2 changes. You can enter values on the HMI and switch back and forth as needed.

Next Steps

Configure additional widgets to visualize speed in new ways.

Add more tags to the same topic to display other data points per machine.

To add new devices, simply create a new value for the client tag, no changes to the client project are needed.

Resources and Documentation

Nimbus808 Documentation

FAQ

Technical Support