(Sorry if this isn't exactly the right place, but I think it is just a bit more than general discussion
and could be a developmental/Feature request thing.)
In light of recent events for me with MQTT, this is a bit of out loud thinking:
I get that NR with its message and MQTT are two different animals and speak different languages (if you will).
I have just been through a bit of a painful ordeal (well, ok: I guess I deserved it.) with sending messages over MQTT.
Thought:
A node that will look at an incoming message and construct a MQTT compatible message (and/or) deconstruct (why is spell check not liking that word?) an incoming message and break it back to Node-Red format?
Yes, most people wouldn't want/need it. But, now and then you are needing to send a more complex message than simply msg.payload
.
When you have such a case, you could use this node at both ends and save a lot of messing around.
Example:
At the sending end of the message.
msg.payload = "Something important"
msg.device = "The device's name"
msg.*something_else* = "Other information needed"
*and so on*
(and I'm not sure what happened there with formatting)
Can NR see there are other items than the usual extra parts of the msg
and build a MQTT compatible payload?
like:
msg.payload.payload = msg.payload, msg.payload.device = msg.device, msg.payload.something_else = msg.something_else
And then at the other end extract that structure to its original?
I'd love to give it a go, but I don't think I have enough knowledge / confidence yet to do it.
But I am discussing it for consideration.