If I understand correctly, you are talking about grouping both 001 and 002 ( or temp,volt,hum) readings from bar.
This example may help. It stores incoming topic messages from bar, john, etc
and will only output once it has received three messages (temp,volt,hum).
[{"id":"ea801c4379fcf1a2","type":"inject","z":"65617ffeb779f51c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"foo/bar/Temp","payload":"","payloadType":"date","x":270,"y":4580,"wires":[["8aae3691017739b8"]]},{"id":"8aae3691017739b8","type":"change","z":"65617ffeb779f51c","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{ \"ArrivalTime\": $now(), \"TP\": \"Temp-Feuchte-CO2_002\", \"Tag\": \"TMP\", \"Val\": $round($random()*6+10, 1)}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":4680,"wires":[["a7c385c3a8417dad"]]},{"id":"4e4233dc603787ea","type":"inject","z":"65617ffeb779f51c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"foo/bar/Voltage","payload":"","payloadType":"date","x":280,"y":4620,"wires":[["8aae3691017739b8"]]},{"id":"12bae7f80deda7b3","type":"inject","z":"65617ffeb779f51c","name":"john Temp","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"foo/john/Temp","payload":"","payloadType":"date","x":220,"y":4700,"wires":[["8aae3691017739b8"]]},{"id":"6936fc017d07a139","type":"inject","z":"65617ffeb779f51c","name":"john Volt","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"foo/john/Voltage","payload":"","payloadType":"date","x":220,"y":4740,"wires":[["8aae3691017739b8"]]},{"id":"5308d01d0797909d","type":"inject","z":"65617ffeb779f51c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"foo/john/another","payload":"","payloadType":"date","x":600,"y":4600,"wires":[["8aae3691017739b8"]]},{"id":"5821e56a18523f02","type":"inject","z":"65617ffeb779f51c","name":"john Hum","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"foo/john/Humidity","payload":"","payloadType":"date","x":220,"y":4780,"wires":[["8aae3691017739b8"]]},{"id":"55f2ef1ee96632b6","type":"inject","z":"65617ffeb779f51c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"foo/bar/Humidity","payload":"","payloadType":"date","x":280,"y":4660,"wires":[["8aae3691017739b8"]]},{"id":"a7c385c3a8417dad","type":"mqtt out","z":"65617ffeb779f51c","name":"","topic":"","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"e8ba3ef5.22f4a8","x":670,"y":4680,"wires":[]},{"id":"4235b6534949180b","type":"mqtt in","z":"65617ffeb779f51c","name":"","topic":"foo/+/+","qos":"2","datatype":"auto-detect","broker":"e8ba3ef5.22f4a8","nl":false,"rap":true,"rh":0,"inputs":0,"x":150,"y":4860,"wires":[["83d53f3b33bda1c7","eb9778148fdbdeb0"]]},{"id":"eb9778148fdbdeb0","type":"change","z":"65617ffeb779f51c","name":"","rules":[{"t":"set","p":"topic_array","pt":"msg","to":"$split($$.topic, \"/\")","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":330,"y":4860,"wires":[["5feb7b9a84d38c0b"]]},{"id":"5feb7b9a84d38c0b","type":"switch","z":"65617ffeb779f51c","name":"","property":"$$.topic_array[2] in [\"Temp\", \"Voltage\", \"Humidity\"]","propertyType":"jsonata","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":490,"y":4860,"wires":[["76bdf0a51223d976"]]},{"id":"9462d9cc801e1bba","type":"debug","z":"65617ffeb779f51c","name":"debug 250","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":690,"y":4860,"wires":[]},{"id":"9fc07bc776bb3f6d","type":"change","z":"65617ffeb779f51c","name":"","rules":[{"t":"delete","p":"foo[msg.topic_array[1]]","pt":"flow"},{"t":"move","p":"payload","pt":"msg","to":"payload[0]","tot":"msg"},{"t":"set","p":"payload[1].tag1","pt":"msg","to":"topic_array[1]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":4900,"wires":[["9462d9cc801e1bba"]]},{"id":"0bba405707acd54d","type":"join","z":"65617ffeb779f51c","name":"","mode":"custom","build":"merged","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":390,"y":4900,"wires":[["9fc07bc776bb3f6d"]]},{"id":"76bdf0a51223d976","type":"change","z":"65617ffeb779f51c","name":"","rules":[{"t":"set","p":"foo[msg.topic_array[1]][msg.topic_array[2]]","pt":"flow","to":"payload.Val","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"foo[msg.topic_array[1]]","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":240,"y":4900,"wires":[["0bba405707acd54d"]]},{"id":"e8ba3ef5.22f4a8","type":"mqtt-broker","name":"testb","broker":"192.168.1.25","port":"1883","clientid":"node-red-test","autoConnect":true,"usetls":false,"compatmode":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""}]
Have a play.
The output would be for something like below, for six random incoming message you get an output for bar and john grouped.
[edit] added fuller example with some filtering and output for influx.