Hey Luis,
Let me see if I understand what you want -- the payload shown below should be split into individual msg objects? What do you want each msg to look like?
The node-red core 'split' node will break you payload into 5 msgs, each with a payload of the value, and a parts field with the key name and other internal information, like this:
object_msgid: "d419232b.68c6f"
topic: ""
payload: 34
parts: objectid: "d419232b.68c6f"
type: "object"
key: "Humid"
index: 1
count: 5
The internal fields are used by the 'join' node to put them back together later (if you need to).
But, if you want to create individual msgs with a topic (the key) and a payload (the value), say for pushing to MQTT listeners, you can write a function node, something like this:
var keys = Object.keys(msg.payload);
var msgs = keys.map(function(key) {
return { topic: key, payload: msg.payload[key] };
});
return [msgs];
If the number of output ports on your function node is 1, all 5 msgs will be sent down the same wire -- you can also set your output to 5 ports and have one msg sent to each port. Unfortunately, the order of the keys returned will not always be the same, so you can't count on a given topic always being sent to the same port number. So probably not a very robust solution, unless you write the code to build the output msgs array in a particular order.
Nate mentioned some of the struggles he had parsing his data string into keys and values. I can see that your payload is already an object, but in his case, I would pass the text to a 'json' node, which parses the text and builds the object for you -- much easier to manipulate in that form. And if you haven't seen it yet, I recommend you use the 'change' node with a JSONata expression if you need to restructure more complicated payload objects. Have fun!
--
Steve