Hello everyone, With an inject node as shown in the photo I manage to send a payload with the content 139790555651 and at the same time a topic with the content 120 (the values don't matter)
Here is a picture of the functioning Injectnode and the contents of the debug
If I use the inject node then my function behind it works perfectly.
Now I would like to replace the injectnode with a function.
However, only the payload arrives at the end. I don't get the topic name.
Here is my function node and the contents of the debug
As you can see, the topic is not transferred!?
So it seems to be an error in my function. Can someone tell me how to change my function so that both the contents of Payload and Topic are sent?
Thank you in advance as always
here is the code to change:
var DerStatus = msg.payload;
if (DerStatus === "Geöffnet") {
return [
{ payload: 300 },
{ topic: '139790555651'}
]
}
else {
return [
{ payload: 0 },
{ topic: '139790555651'}
]
}