Inject node to a function node

Hi

I have this inject node, and works well.
image

How do I make a msg.topic and msg.payload function, so it will work as the inject node?

The equivalent Function node would be:

msg.payload = {
   "warning": { ... }
}
msg.topic = "zigbee2mqtt/R_Alarm_Køkken/set"
return msg

Hi knolleary
And then after the question, then I found Sending value from array to mqtt in nodered

But can see that it's almost the same as you wrote.

Thx alot. :slight_smile:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.