JSON Device Publisher MQTT Topics for Publishing and Writes
The JSON Device Publisher will create multiple topics to publish to.
Writing values to devices through the JSON Device Publisher requires the use of specific topics subscribed to by the JSON Device Publisher.
MQTT Topics
The topics published to by the JSON Device Publisher use the following format:
<NodeID>/<DeviceName>
<NodeID> is taken from the Node ID field on the MQTT tab of the Standard Publisher
<DeviceName> is the name of the Device object in Edge ACM
Message Format
The JSON formatting of each publish is in the form:
{
"Tags": [
{
"Name": "TagName1",
"Value": <value>,
"Timestamp": <timestamp>
},
{
"Name": "TagName2",
"Value": <value>,
"Timestamp": <timestamp>
}...
]
}
TagName1, Tagname2, etc. will be the Name field of the Tag objects
Value is the Value of the tag
Timestamp is the time at which the Value was read in Epoch format
Note: This example includes only the default keys
All JSON keys can be changed on the JSON Payload tab of the JSON Device Publisher object
Additional optional keys may be added and Timestamp can be removed
MQTT Writes
To write to any given tag, publish a value of the appropriate data type on topic:
<NodeID>/WRITE/<DeviceName>
<NodeID> is taken from the Node ID field on the MQTT tab of the Standard Publisher
<DeviceName> is the name of the Device object in Edge ACM
The format of the message must match the format of the published messages, but only requires the keys for Name and Value.
Eg.
{
"Tags": [
{
"Name": "TagName1",
"Value": <value>
}
]
}
Related content
For assistance, please submit a ticket via our Support Portal, email autosol.support@autosoln.com or call 281.286.6017 to speak to a support team member.