Hi @pinie_pinie
There are a few ways to accomplish this.
One that springs to my mind is using the join
node.
you can set it to output a key:value pair after n payloads have been received.
The key will be the topic
of each incoming payload.
[{"id":"d18ef770d90dd6f9","type":"inject","z":"5f4f6ef5a6e88063","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"M1","payload":"","payloadType":"date","x":2110,"y":215,"wires":[["11566532fd5b14da"]]},{"id":"fc46771fd736960d","type":"inject","z":"5f4f6ef5a6e88063","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"M2","payload":"","payloadType":"date","x":2115,"y":255,"wires":[["11566532fd5b14da"]]},{"id":"11566532fd5b14da","type":"join","z":"5f4f6ef5a6e88063","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":2325,"y":240,"wires":[["56aecb562d938a0e"]]},{"id":"56aecb562d938a0e","type":"debug","z":"5f4f6ef5a6e88063","name":"debug 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":2535,"y":240,"wires":[]}]
In a function
node after the join
you can then do.
if(payload.M1 === 20 && payload.M2 < 40){
// do stuff
}