Custom Topic Configuration for Litmus Edge OPC UA Server
See the steps below to update a tag in the Litmus Edge OPC UA server that originates from a source other than DeviceHub.
The Litmus Edge OPC UA server allows you to enter any topic as the data source when configuring a new tag. The server still expects a custom topic to have the same fields in the message as a DeviceHub message. At a minimum, the fields success and value are required in the payload of the message for the OPC UA server to update the tag.
This guide assumes that you have already configured and enabled the OPC UA server and that a tag is already configured. The following instructions show how to update a tag on the OPC UA server with the current timestamp.
Note: It is important to match the data type of the value you are sending with the data type of the configured tag in the OPC UA server. If the data types do not match, the value may not be updated on the OPC UA server.
To update a custom topic in LE OPA UA Server:
- In Litmus Edge, navigate to Flows Manager and open the flow canvas. See Create a Flow to learn more.
On the flows canvas, add an inject node, a function node, and a DeviceHub Publish node.
Double-click the inject node. Configure it to inject the timestamp on an interval, every 1 second.
Double-click the function node. Insert the following code.
The payload will generate the following output.
Double-click the DataHub Publish node. In the Topic field, enter the topic name configured in your OPC UA tag. Below is the configuration of the OPC UA tag used in this example.
The structure of the JSON string you are sending to the custom topic must have the and value keys at minimum for the OPC UA server to update the value from that topic. If success is set to true, the value is updated and the status of the tag is Good.

If success is set to false, the value is updated and the status of the tag is BadResourceUnavailable.
