Reputation: 177
I'm currently working on an application that uses MQTT to communicate between an android app and a LoRaWAN gateway. It uses node-RED on the gateway's side.
I can manually set up on what topic my MQTT output node publishes to. I was wondering if there was a way to make this property of the node change depending on the message it receives.
For exemple, would it be possible to send a topic attribute alongside my msg and payload and use that value to set the property inside the node.
Thanks for the help!
Upvotes: 1
Views: 2266
Reputation: 59628
Yes, just leave the topic field blank in the mqtt-out node config and set the msg.topic
property on the message to be the topic you want to publish that message to.
Upvotes: 1