JSON Toolkit with MQTT Publishing
Follow‑Along Guide with Time‑Coded Sections
Based on Niagara Pro Tips – JSON Toolkit + MQTT (James Johnson)
Video Tutorial: Niagara PRO TIPS: JSON Toolkit and MQTT (Part 1)
NOTE:
If you want to watch the video while following along with the text notes, then
Right Click & Open The Video in a new split screen window and the video should appear on the right of the notes so that you can follow along.
0:00 Introduction
This training module shows how to use the Niagara JSON Toolkit to build a JSON payload, embed point data using BQL Queries, and publish the result over MQTT using a String Publish Point.
This guide follows the video step-by-step with the same timecodes so you can pause and follow at your own pace.
0:21 Overview and Demo Station Setup
In the example station:
-
The controller is a JACE running a BACnet network
-
Under the BACnet Driver → Floor 1 → several AHU devices
-
The goal is to collect AHU point data and export it as JSON using MQTT
Key components used:
-
JSON Toolkit → JsonSchema
-
Query → BqlQuery
-
Query Embedding → BoundQueryResult
-
MQTT Driver → String Publish Point
1:50 Working on the Wiresheet (JsonSchema Component)
Steps
-
Drag JsonSchema from the JSON Toolkit palette onto your Wiresheet.
-
Add basic fields, such as:
-
Station Name
-
Current Time
-
Message ID
-
These properties demonstrate how the schema updates each time the message is generated.
Example JsonSchema Structure (simple)
{
"stationName": "{station:name}",
"timestamp": "{currentTime}",
"messageId": "{incrementing-id}"
}
Click Generate to verify the message ID and time update each time.
2:53 Creating a JSON Query (BQL)
Timecode: JSON Query
You now create a BQL query to gather AHU point data.
Steps
-
From JSON Toolkit → Query, drag BqlQuery onto the JsonSchema.
-
Rename it to something meaningful, for example:
allAhuData -
Set Query Scope:
slot:|slot:/Drivers/BacnetNetwork -
Build the BQL query predicate.
Example BQL Predicate
Find all BACnet proxy points whose device name begins with “AHU”:
proxyExt.device.displayName LIKE 'AHU%'
Example Projection Fields
These become JSON columns.
proxyExt.device.displayName AS ahuDisplayName,
displayName AS pointName,
value WITH facets AS value,
status AS status
Test the Query
Click Play next to the ORD field.
Confirm it returns the expected list of ~200+ points (in the video: 285).
4:40 Embedding Query Results in JSON
Timecode: Embedding Results
To embed your query results inside the JSON payload:
Steps
-
Drag BoundQueryResult from the palette.
-
Drop it inside the JsonSchema object.
-
Select your query:
allAhuData -
Choose an output style:
-
Array (most common)
-
Object
-
Key/Value
-
-
Execute the query:
-
Right‑click → Execute All Queries
-
-
Click Generate on JsonSchema again.
Example JSON Payload Output
{
"stationName": "Building1",
"timestamp": "2026-03-04T10:00:00Z",
"messageId": 34,
"ahuData": [
{
"ahuDisplayName": "AHU-1",
"pointName": "SupplyTemp",
"value": 16.2,
"status": "ok"
},
{
"ahuDisplayName": "AHU-1",
"pointName": "FanStatus",
"value": "Off",
"status": "ok"
}
]
}
6:41 Exporting JSON Data
Timecode: Exporting Data
You now export the generated JSON string.
Steps
-
Open the JsonSchema component.
-
Locate the out (string) slot.
-
Right‑click → Link Mark.
This prepares the payload for connection into MQTT.
7:02 Publishing via MQTT
Timecode: Publishing Data
Steps to configure MQTT:
-
Go to Drivers → MQTT Driver.
-
Add an MQTT Connection
-
In the demo, HiveMQ public broker is used.
-
For production, use secure authentication.
-
-
Add a String Publish Point.
-
Set the topic, for example:
building1/floor1/ahuData -
Link the in16 slot to the JsonSchema → out slot.
8:02 MQTT Publish Point Behaviour
Timecode: MQTT Proxy Points
Key proxy extension properties:
Publish On Change
-
Default: true
-
The message publishes whenever the string changes.
Retained
-
If true:
-
The broker stores the last message
-
New subscribers receive it immediately
-
QoS Levels
-
0: Fire and Forget
-
1: At Least Once
-
Recommended for JSON payloads
-
Confirms delivery back to the station
-
9:01 MQTT Example Subscription
Timecode: MQTT Example
Using MQTT Lens or similar client:
-
Connect to the same broker.
-
Subscribe to:
building1/floor1/ahuData -
You will immediately receive the full JSON output.
If retained = true and QoS = 1, clients always get the latest published message.
10:14 Summary
Timecode: Summary
You have now built a complete workflow:
-
Generate JSON Payload
-
Run BQL Query to collect AHU data
-
Embed data into the JSON template
-
Output the JSON string
-
Publish via MQTT
-
Subscribe using an MQTT client to confirm delivery
This approach is suitable for:
-
Whole building exports
-
Device-level summaries
-
Integrating with cloud platforms
-
Data pipelines (HiveMQ, Azure IoT, AWS IoT, Ubidots, Thingsboard)
Future modules will show:
-
Device‑by‑device JSON payloads
-
Using relative JSON schemas
-
More granular publish strategies
Presenter: James Johnson
Series: Niagara PRO TIPS
Topic: Schedule Relations Part 1 – Smart Relations and PX
Part: 1 of 2
Key Concept: Using smart relations to create dynamic, queryable connections between schedules and control points, enabling intelligent navigation and reporting even through complex logic chains
YouTube: http://www.youtube.com/@TridiumInc
Other Resources & Customer Survey:
💬 Don't miss out! Follow the Forest Rock News channel on WhatsApp Click Here!
💬 We’d also love your feedback! Please take a moment to complete our quick Customer Survey
It only takes a minute and helps us serve you better!
IoT Devices for BMS, Automation & Smart Connectivity | Forest Rock