Hi,
I'm using node RED as a gateway between an API and OPC UA. Node RED receives values from API with a timestamp. I'm successfully writing values to a variable "vannstand" on opc ua server from node red, but i struggle to forward the timestamp as "sourceTimestamp" attribute. I tried different format but no one succeeded.
From blockquote under, the timestamp should be 10/07/2023, 16:00:00 [UTC+2]. Here is the payload sent to OPC UA server node:
msg.payload= {"namespace": 2, "messageType": "Variable",
"variableName": "Vannstand",
"variableValue": 1.6,
"sourceTimestamp": 1688997600000}}
return msg;
But my opc ua client shows only current time. Here is the result when injecting the node at 16:31:
Could someone tell me if opc ua server is able to receive "sourceTimestamp" attribute?
P.S: I found the solution. The problem was due to a missing attribute. By adding "quality" attribute in the payload, the OPCUA server accept "sourceTimestamp":
msg.payload= {"namespace": 2, "messageType": "Variable",
"variableName": "Vannstand",
"variableValue": 1.6,
"sourceTimestamp": 1688997600000,
"quality": "Good"}}
return msg;
Regards,
Yoann