Topic Identification¶
This page gives a comprehensive understanding of our topic structure used for messaging through the MQTT Protocol. It provides explanations and visuals on how to categorize, subscribe to, and manage data points efficiently. This resource is the foundation of understanding our topic model for publishing data.
graph LR;
A(Sm@rtGear DPU) -- Published with <br> detailed topic format--> B((MQTT Databus));
Topic Format¶
Category/Data Point/Device Type/Device Name/Device Source
graph LR;
A[Category - Numeric] --> B[Data Point - Numeric]
B --> C[Device Type - Numeric];
C --> D[Device Name - String];
D --> E[Device Source - String];
{Category} Numeric: The group type of data being transferred
{Data Point} Numeric: The specific data point being requested
{Device Type} Numeric: The type of device that the data is coming from
{Device Name} String: The specific name of the device that is transferring the data
{Device Source} String: Additional name specification of the device providing the information
Wildcard¶
When subscribing to a topic, wildcards are used to to subscribe to different subtopics simultaneously within the same topic string. This allow to capture all the data provided by a certain subtopic at different levels.
Single-Level¶
A single level wildcard can only replace one topic level within a topic string.
graph LR
A[Category]
A --> B[Data Point]
B --> C{{+}}
C --> D[Device Name]
D --> E[Device Source]
In this topic string, we are subscribed to all the different {Device Type} information available from the MQTT Databus
Multi-Level¶
A multi level wildcard can replace multiple topic levels at the end of a topic string.
graph LR
A[Category]
A --> B[Data Point]
B --> C[Device Type]
C --> D{{#}}
In this topic string, we are subscribed to all the different {Device Name} and {Device Source} information available from the MQTT Databus
Examples ¶
Example 1: Subscribing to Electrical AC Metering Data - Current L1 (refer to Electrical AC Metering Page)¶
Category Subscription¶
"11/21" category
- "11" represents the Category
- "21" represents the data point
To get specific data point from the category, subscribe to the category subtopic first, then the data point subtopic.
Data Point Subscription¶
(ex. "CAT/DP/#" or "11/21/#" for the Current L1).
# - Multi-Level Wildcard
graph LR;
A[11] --> B[21];
B --> C{{# : Device Type/Device Name/Device Source}};
The multi-level (#) represents all the possible subtopics subscribed to simultaneously.
Example 2: Subscribing to Temperature Metering Data - Temperature Reading (refer to Temperature Metering Page)¶
Category Subscription¶
"13/1" category
- "13" represents the category
- "1" represents the data point
Data Point Subscription¶
(ex. "CAT/DP/#" or "13/1/#" for the Temperature Reading).
# - Multi-Level Wildcard
graph LR;
A[13] --> B[1];
B --> C{{# : Device Type/Device Name/Device Source}};
The multi-level (#) represents all the possible subtopics subscribed to simultaneously.