Hey,
i'm building a connection between an MQTT Input and an OPC-UA Server (node-red-contrib-opcua).
To give the opc-ua server node a value i need to send my value from the MQTT input as "msg.payload.variableValue". I'm trying to achieve this by using the function node. My OPC-UA Server debugger tells me the variableValue is missing and it seems i can't figure out how to give this value to the server node.
This is the flow i'm using:
[{"id":"cfb91e4987f2c163","type":"tab","label":"Flow 1 Paul","disabled":false,"info":"","env":[]},{"id":"abf7079a.653be8","type":"mqtt in","z":"cfb91e4987f2c163","name":"","topic":"esp32/temperature","qos":"2","datatype":"utf8","broker":"10e78a89.5b4fd5","nl":false,"rap":false,"rh":"0","inputs":0,"x":150,"y":260,"wires":[["470a98984a913228","d65592b613ad7c29"]]},{"id":"ee410d56cb73180b","type":"OpcUa-Server","z":"cfb91e4987f2c163","port":"4841","name":"NROPC","endpoint":"","users":"users.json","nodesetDir":"","folderName4PKI":"","autoAcceptUnknownCertificate":true,"registerToDiscovery":false,"constructDefaultAddressSpace":true,"allowAnonymous":true,"endpointNone":true,"endpointSign":true,"endpointSignEncrypt":true,"endpointBasic128Rsa15":true,"endpointBasic256":true,"endpointBasic256Sha256":true,"maxNodesPerBrowse":"1000","maxNodesPerHistoryReadData":0,"maxNodesPerHistoryReadEvents":0,"maxNodesPerHistoryUpdateData":0,"maxNodesPerRead":"1000","maxNodesPerWrite":"1000","maxNodesPerMethodCall":0,"maxNodesPerRegisterNodes":0,"maxNodesPerNodeManagement":0,"maxMonitoredItemsPerCall":0,"maxNodesPerHistoryUpdateEvents":0,"maxNodesPerTranslateBrowsePathsToNodeIds":0,"maxConnectionsPerEndpoint":"1000","maxMessageSize":4096,"maxBufferSize":4096,"x":560,"y":140,"wires":[["3e828e8b98926363"]]},{"id":"3e828e8b98926363","type":"debug","z":"cfb91e4987f2c163","name":"debug 3","active":false,"tosidebar":false,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":750,"y":140,"wires":[]},{"id":"9a4ac34d270b0fa5","type":"inject","z":"cfb91e4987f2c163","name":"add BME688_TEMP (FLOAT)","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"ns=1;s=BME688_TEMP;datatype=Float","payload":"{\"opcuaCommand\":\"addVariable\"}","payloadType":"json","x":180,"y":140,"wires":[["ee410d56cb73180b"]]},{"id":"854f1b9146b1e3fe","type":"inject","z":"cfb91e4987f2c163","d":true,"name":"Set TestVariable2 23.4","props":[{"p":"payload.messageType","v":"Variable","vt":"str"},{"p":"payload.variableName","v":"BME688_TEMP","vt":"str"},{"p":"payload.datatype","v":"Float","vt":"str"},{"p":"payload.namespace","v":"1","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":160,"y":200,"wires":[["ee410d56cb73180b"]]},{"id":"470a98984a913228","type":"debug","z":"cfb91e4987f2c163","name":"debug 4","active":false,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":750,"y":260,"wires":[]},{"id":"d65592b613ad7c29","type":"function","z":"cfb91e4987f2c163","name":"function 1","func":"var newMsg = { payload : msg.payload.variableValue = msg.payload };\nreturn newMsg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":380,"y":300,"wires":[["3266d2d1ac095ebe","ee410d56cb73180b"]]},{"id":"3266d2d1ac095ebe","type":"debug","z":"cfb91e4987f2c163","name":"debug 7","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":740,"y":320,"wires":[]},{"id":"10e78a89.5b4fd5","type":"mqtt-broker","name":"","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
I'd be happy about any help, thanks in advance.