Merge different messages with same TOPIC

As colin suggested should work with a delay node

Or you can use a trigger node to discard the duplicate msg's
Here is an example, I have simulated the incoming messages with a split node and a change node. It will send six msg's. If you run it only the first message from each topic makes it through

[{"id":"b558a74069d392f3","type":"inject","z":"c791cbc0.84f648","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"topic\":\"location\",\"payload\":1},{\"topic\":\"location\",\"payload\":2},{\"topic\":\"cockpit\",\"payload\":1},{\"topic\":\"cockpit\",\"payload\":2},{\"topic\":\"battery_status\",\"payload\":1},{\"topic\":\"battery_status\",\"payload\":2}]","payloadType":"json","x":110,"y":1160,"wires":[["b6b78434.a8e5f8"]]},{"id":"b6b78434.a8e5f8","type":"split","z":"c791cbc0.84f648","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":230,"y":1160,"wires":[["c3cc285a.0ec518"]]},{"id":"c3cc285a.0ec518","type":"change","z":"c791cbc0.84f648","name":"simulate incoming msg's","rules":[{"t":"set","p":"topic","pt":"msg","to":"payload.topic","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":1160,"wires":[["1bd65871.8f7048"]]},{"id":"1bd65871.8f7048","type":"trigger","z":"c791cbc0.84f648","name":"","op1":"","op2":"","op1type":"nul","op2type":"pay","duration":"250","extend":false,"overrideDelay":false,"units":"ms","reset":"","bytopic":"topic","topic":"topic","outputs":1,"x":210,"y":1220,"wires":[["b44fcbe216010fe7"]]},{"id":"b44fcbe216010fe7","type":"debug","z":"c791cbc0.84f648","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":430,"y":1220,"wires":[]}]

First of all thank you all for all the reply's.

Probably I'm messing with this question and not been able to understand really what i need. I'm new to node-red, I've saw what a guy did a really cool dashboard with this node so i'm trying to apply something similar to what i need.

So I've tried the change node solution, that fairly looks what i need, in other way, because sooner in the flow i will need this properties isolated from the rest to display in the flow, but i'm getting messy responses.

The option with the delay node, i don't want to drop messages, because if there are any change on the battery-status i want the dashboard to be updated with the info.

And the trigger node to discard the messages it was the only that retrieve me the response that i wanted, one message per topic. So i will continue to create the rest of the flow for the dashboard to check if is this solution that i really need (i even don't now if i really now what i need!)

So once again, sorry for all this mess, I'm new in node-red and exploring and learning new things, sorry for the messy questions.

Best regards

Just for the record, using a Delay node (configured correctly) will have exactly the same effect as the Trigger node, which also drops later messages when they come in close together. Using a Trigger node is the neater solution though.

I believe so, but for me was the easiest to configure, and its not dropping the messages.

lets see in the future!

Thank you all

If you configured it correctly, with the same timeout as the trigger (which I see is 250ms) then it will behave exactly the same.

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