Hi Steve,
I still cant get this to work. I have a test flow with 4 input values. If I activate them in random order, the array will sort them into the correct order but then I am missing the origin of the message. If you see the debug output the "high_1, 2, 3 anf 4" are current measuring devices, so I need to keep track of the current from highest to lowest. any tips?
thanks,
Duncan
[{"id":"808a10e4.3b93","type":"inject","z":"67fb2dd6.473094","name":"","props":[{"p":"payload"},{"p":"index","v":"high_1","vt":"str"},{"p":"id","v":"high_1","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"10","payloadType":"num","x":130,"y":80,"wires":[["b03d3f23.a06af","1fee61e5.52c81e"]]},{"id":"d855bc7e.718fe","type":"inject","z":"67fb2dd6.473094","name":"","props":[{"p":"payload"},{"p":"index","v":"high_2","vt":"str"},{"p":"id","v":"high_2","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"20","payloadType":"num","x":130,"y":120,"wires":[["b03d3f23.a06af","1fee61e5.52c81e"]]},{"id":"56867a1d.5d6f34","type":"inject","z":"67fb2dd6.473094","name":"","props":[{"p":"payload"},{"p":"index","v":"high_3","vt":"str"},{"p":"id","v":"high_3","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"30","payloadType":"num","x":130,"y":160,"wires":[["b03d3f23.a06af","1fee61e5.52c81e"]]},{"id":"771301f4.09eed","type":"inject","z":"67fb2dd6.473094","name":"","props":[{"p":"payload"},{"p":"index","v":"high_4","vt":"str"},{"p":"id","v":"high_4","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"40","payloadType":"num","x":130,"y":200,"wires":[["b03d3f23.a06af","1fee61e5.52c81e"]]},{"id":"b03d3f23.a06af","type":"join","z":"67fb2dd6.473094","name":"phase_1","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"index","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"4","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":480,"y":80,"wires":[["cc5cc1f3.4c447","8544d79a.65c728"]]},{"id":"85edb486.01e618","type":"debug","z":"67fb2dd6.473094","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":930,"y":80,"wires":[]},{"id":"cc5cc1f3.4c447","type":"sort","z":"67fb2dd6.473094","name":"","order":"ascending","as_num":false,"target":"","targetType":"seq","msgKey":"","msgKeyType":"elem","seqKey":"payload","seqKeyType":"msg","x":690,"y":80,"wires":[["85edb486.01e618"]]},{"id":"8544d79a.65c728","type":"debug","z":"67fb2dd6.473094","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":930,"y":40,"wires":[]},{"id":"59450a24.711bd4","type":"sort","z":"67fb2dd6.473094","name":"","order":"ascending","as_num":false,"target":"payload","targetType":"msg","msgKey":"","msgKeyType":"elem","seqKey":"payload","seqKeyType":"msg","x":720,"y":240,"wires":[["3f4bd05e.387c"]]},{"id":"3f4bd05e.387c","type":"debug","z":"67fb2dd6.473094","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":930,"y":240,"wires":[]},{"id":"1fee61e5.52c81e","type":"join","z":"67fb2dd6.473094","name":"phase_1","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"index","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"4","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":480,"y":240,"wires":[["59450a24.711bd4"]]}]
18-7-2021 22:23:34node: 8544d79a.65c728
msg : Object
object
_msgid: "6e87386a.26be88"
payload: object
high_2: 20
high_1: 10
high_3: 30
high_4: 40
index: "high_4"
id: "high_4"
18-7-2021 22:23:34node: 3f4bd05e.387c
msg : Object
object
_msgid: "6e87386a.26be88"
payload: array[4]
0: 10
1: 20
2: 30
3: 40
index: "high_4"
id: "high_4"