How to process multiple data

Hi, while I cannot quite see how your logic works (i suspect there are existing issues) I can offer you a more manageable way to work by using single (re-usable) functions (via LINK CALL) and show you how to name the values for better debugging and understanding.

Your flow...

This is the my modifications

[{"id":"28a21573.ea443a","type":"buffer-parser","z":"a44db49552121df2","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"hex","name":"item1","offset":6,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"hex","name":"item2","offset":7,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"hex","name":"item3","offset":8,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"hex","name":"item4","offset":9,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"hex","name":"item5","offset":10,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"hex","name":"item6","offset":11,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"hex","name":"item7","offset":12,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"hex","name":"item8","offset":13,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"hex","name":"item9","offset":14,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"hex","name":"item10","offset":15,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"hex","name":"item11","offset":16,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"hex","name":"item12","offset":17,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"hex","name":"item13","offset":18,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"uint8","name":"room1POT","offset":19,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"uint8","name":"room2POT","offset":20,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"uint8","name":"room3POT","offset":21,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"return","multipleResult":false,"fanOutMultipleResult":true,"setTopic":false,"outputs":1,"x":410,"y":480,"wires":[["e2d9f453c503b642","f4df18a91ef96436"]]},{"id":"7b6c56a5.d52e58","type":"buffer-parser","z":"a44db49552121df2","name":"Real values","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"uint8","name":"item1","offset":6,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"uint8","name":"item2","offset":7,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"uint8","name":"item3","offset":8,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"uint8","name":"item4","offset":9,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"uint8","name":"item5","offset":10,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"uint8","name":"item6","offset":11,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"uint8","name":"item7","offset":12,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"uint8","name":"item8","offset":13,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"uint8","name":"item9","offset":14,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"uint8","name":"item10","offset":15,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"uint8","name":"item11","offset":16,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"uint8","name":"item12","offset":17,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"uint8","name":"item13","offset":18,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"uint8","name":"room1RT","offset":19,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"uint8","name":"room2RT","offset":20,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"uint8","name":"room3RT","offset":21,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"return","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":490,"y":200,"wires":[["2a08c251412a6eeb","ee8ff341ba0cae8d","9719ade126ac2f0f","837b1c1187a33b87"]]},{"id":"71500ed9.1d2ae","type":"ui_text","z":"a44db49552121df2","group":"3da36874.a9b2c8","order":3,"width":3,"height":1,"name":"","label":"","format":"{{msg.status}}","layout":"col-center","className":"","x":1150,"y":480,"wires":[]},{"id":"6a191d09.8997e4","type":"ui_text","z":"a44db49552121df2","group":"3da36874.a9b2c8","order":2,"width":3,"height":1,"name":"","label":"","format":"{{msg.payload + 5}}","layout":"col-center","className":"","x":1150,"y":440,"wires":[]},{"id":"a0d6625.f4f5ba","type":"ui_text","z":"a44db49552121df2","group":"3da36874.a9b2c8","order":1,"width":3,"height":1,"name":"","label":"","format":"<font color= {{msg.color}} > {{msg.payload + 5}} </font>","layout":"col-center","className":"","x":1150,"y":200,"wires":[],"inputLabels":["Pracovna broskev reálná teplota"]},{"id":"62f8f1cdee8e5719","type":"inject","z":"a44db49552121df2","name":"Fake TCP","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[255,255,16,23,255,255,141,255,129,141,141,255,255,129,143,143,143,143,143,141,141,141,0,0,151,221]","payloadType":"bin","x":320,"y":200,"wires":[["7b6c56a5.d52e58"]]},{"id":"e751ee119f9eacae","type":"inject","z":"a44db49552121df2","name":"Fake TCP","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[255,255,16,23,255,255,13,31,12,14,14,31,31,18,16,15,15,15,15,13,13,15,0,0,148,190]","payloadType":"bin","x":320,"y":440,"wires":[["28a21573.ea443a"]]},{"id":"f4421b557843b5db","type":"function","z":"a44db49552121df2","name":"Cmp.RT/POT","func":"var RT = msg.payload;\nvar POT = msg.POT;\nif ( RT == POT ) {\n  msg.color = \"white\"\n} else if ( RT > POT ) {\n  msg.color = \"red\"\n} else if ( RT < POT ) {\n  msg.color = \"blue\"\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":940,"y":140,"wires":[["fd95d7121b1792fd"]]},{"id":"87dfab8668cf4244","type":"link in","z":"a44db49552121df2","name":"PT/POT - calculate color","links":[],"x":825,"y":140,"wires":[["f4421b557843b5db"]]},{"id":"fd95d7121b1792fd","type":"link out","z":"a44db49552121df2","name":"","mode":"return","links":[],"x":1065,"y":140,"wires":[]},{"id":"a88d9ea58b1cedb1","type":"link call","z":"a44db49552121df2","name":"","links":["87dfab8668cf4244"],"timeout":"30","x":930,"y":200,"wires":[["a0d6625.f4f5ba","7cfcec1617b9cfe6"]]},{"id":"2a08c251412a6eeb","type":"change","z":"a44db49552121df2","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.room1RT","tot":"msg"},{"t":"set","p":"POT","pt":"msg","to":"POTs.room1POT","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":200,"wires":[["a88d9ea58b1cedb1"]]},{"id":"6f35133d27328bfa","type":"ui_text","z":"a44db49552121df2","group":"3da36874.a9b2c8","order":1,"width":3,"height":1,"name":"","label":"","format":"<font color= {{msg.color}} > {{msg.payload + 5}} </font>","layout":"col-center","className":"","x":1150,"y":240,"wires":[],"inputLabels":["Pracovna broskev reálná teplota"]},{"id":"93d587c136a803fa","type":"link call","z":"a44db49552121df2","name":"","links":["87dfab8668cf4244"],"timeout":"30","x":930,"y":240,"wires":[["6f35133d27328bfa","f2a32a7aae305d2b"]]},{"id":"ee8ff341ba0cae8d","type":"change","z":"a44db49552121df2","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.room2RT","tot":"msg"},{"t":"set","p":"POT","pt":"msg","to":"POTs.room2POT","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":240,"wires":[["93d587c136a803fa"]]},{"id":"6f1c62cdafebc0cf","type":"ui_text","z":"a44db49552121df2","group":"3da36874.a9b2c8","order":1,"width":3,"height":1,"name":"","label":"","format":"<font color= {{msg.color}} > {{msg.payload + 5}} </font>","layout":"col-center","className":"","x":1150,"y":280,"wires":[],"inputLabels":["Pracovna broskev reálná teplota"]},{"id":"118f23128c4f5703","type":"link call","z":"a44db49552121df2","name":"","links":["87dfab8668cf4244"],"timeout":"30","x":930,"y":280,"wires":[["6f1c62cdafebc0cf","ea96d518d5fd5fec"]]},{"id":"9719ade126ac2f0f","type":"change","z":"a44db49552121df2","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.room3RT","tot":"msg"},{"t":"set","p":"POT","pt":"msg","to":"POTs.room3POT","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":280,"wires":[["118f23128c4f5703"]]},{"id":"7cfcec1617b9cfe6","type":"debug","z":"a44db49552121df2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload & \":\" & color","statusType":"jsonata","x":1250,"y":180,"wires":[]},{"id":"f2a32a7aae305d2b","type":"debug","z":"a44db49552121df2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload & \":\" & color","statusType":"jsonata","x":1250,"y":220,"wires":[]},{"id":"ea96d518d5fd5fec","type":"debug","z":"a44db49552121df2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload & \":\" & color","statusType":"jsonata","x":1250,"y":260,"wires":[]},{"id":"e2d9f453c503b642","type":"change","z":"a44db49552121df2","name":"","rules":[{"t":"set","p":"POTs","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":480,"wires":[["bf8702d7bdeea79f","3e73057efc68436b","da51ac710239f960"]]},{"id":"9aae56b9c1a2041a","type":"function","z":"a44db49552121df2","name":"Calculate msg.status","func":"var mod = msg.payload\nlet answer = \"xxx\";\n\nif (mod == 0) {\n  answer = \"1\"\n} else if (mod == 1) {\n  answer = \"2\"\n} else if (mod == 2) {\n  answer = \"3\"\n} else if (mod == 3) {\n  answer = \"4\"\n} else if (mod == 4) {\n  answer = \"PRG\"\n}\n\nmsg.status = answer;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":900,"y":400,"wires":[["d0fb08412537bb69"]]},{"id":"cf63291864b6d1b0","type":"link in","z":"a44db49552121df2","name":"get msg.status","links":[],"x":765,"y":400,"wires":[["9aae56b9c1a2041a"]]},{"id":"d0fb08412537bb69","type":"link out","z":"a44db49552121df2","name":"","mode":"return","links":[],"x":1045,"y":400,"wires":[]},{"id":"6fa6ce0e90cb2d57","type":"link call","z":"a44db49552121df2","name":"","links":["cf63291864b6d1b0"],"timeout":"30","x":980,"y":480,"wires":[["71500ed9.1d2ae","d0486c83c8662bc6","6a191d09.8997e4"]]},{"id":"bf8702d7bdeea79f","type":"change","z":"a44db49552121df2","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.room1POT","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":800,"y":480,"wires":[["6fa6ce0e90cb2d57"]]},{"id":"5d477a576c7f0fbf","type":"ui_text","z":"a44db49552121df2","group":"3da36874.a9b2c8","order":3,"width":3,"height":1,"name":"","label":"","format":"{{msg.status}}","layout":"col-center","className":"","x":1150,"y":620,"wires":[]},{"id":"733e0ca322fcd1f4","type":"ui_text","z":"a44db49552121df2","group":"3da36874.a9b2c8","order":2,"width":3,"height":1,"name":"","label":"","format":"{{msg.payload + 5}}","layout":"col-center","className":"","x":1150,"y":580,"wires":[]},{"id":"935bded8eff062ab","type":"link call","z":"a44db49552121df2","name":"","links":["cf63291864b6d1b0"],"timeout":"30","x":980,"y":620,"wires":[["5d477a576c7f0fbf","bcd26933404767f3","733e0ca322fcd1f4"]]},{"id":"3e73057efc68436b","type":"change","z":"a44db49552121df2","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.room2POT","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":800,"y":620,"wires":[["935bded8eff062ab"]]},{"id":"1986075a465b07d8","type":"ui_text","z":"a44db49552121df2","group":"3da36874.a9b2c8","order":3,"width":3,"height":1,"name":"","label":"","format":"{{msg.status}}","layout":"col-center","className":"","x":1150,"y":760,"wires":[]},{"id":"7762be3aef18c64a","type":"ui_text","z":"a44db49552121df2","group":"3da36874.a9b2c8","order":2,"width":3,"height":1,"name":"","label":"","format":"{{msg.payload + 5}}","layout":"col-center","className":"","x":1150,"y":720,"wires":[]},{"id":"e49e94da3a3e9215","type":"link call","z":"a44db49552121df2","name":"","links":["cf63291864b6d1b0"],"timeout":"30","x":980,"y":760,"wires":[["1986075a465b07d8","6ebb8677a2db8543","7762be3aef18c64a"]]},{"id":"da51ac710239f960","type":"change","z":"a44db49552121df2","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.room3POT","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":800,"y":760,"wires":[["e49e94da3a3e9215"]]},{"id":"d0486c83c8662bc6","type":"debug","z":"a44db49552121df2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload & \":\" & status","statusType":"jsonata","x":1150,"y":520,"wires":[]},{"id":"bcd26933404767f3","type":"debug","z":"a44db49552121df2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload & \":\" & status","statusType":"jsonata","x":1150,"y":660,"wires":[]},{"id":"6ebb8677a2db8543","type":"debug","z":"a44db49552121df2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload & \":\" & status","statusType":"jsonata","x":1150,"y":800,"wires":[]},{"id":"827f8af4b6b52b1d","type":"inject","z":"a44db49552121df2","name":"Fake TCP 2","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[255,255,16,23,255,255,13,31,12,14,14,31,31,18,16,15,15,15,15,2,3,4,0,0,148,190]","payloadType":"bin","x":330,"y":520,"wires":[["28a21573.ea443a"]]},{"id":"f4df18a91ef96436","type":"debug","z":"a44db49552121df2","name":"SEE ME IN DEBUG","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":500,"y":600,"wires":[]},{"id":"837b1c1187a33b87","type":"debug","z":"a44db49552121df2","name":"SEE ME IN DEBUG","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":440,"y":280,"wires":[]},{"id":"3da36874.a9b2c8","type":"ui_group","name":"Group 1","tab":"befeb13c.bfa17","order":1,"disp":true,"width":6},{"id":"befeb13c.bfa17","type":"ui_tab","name":"Tab 1","icon":"dashboard","order":1}]

NOTES

Your function code was doing unnecessary hula hoops to convert a number into a number. Simply chose the number type in buffer parser and it will give you that number...

And this is the output...
image

Note the values are actual numbers (no need to do conversions in functions) Note also the "copy path" button under the mouse? - use that to get the path to any value e.g. msg.payload.room3POT