I have this flow...
[{"id":"229f5611c9af1f6e","type":"tab","label":"FVE - CELL SATUS","disabled":false,"info":"","env":[]},{"id":"11f0130edf74e467","type":"inject","z":"229f5611c9af1f6e","name":"cell_min 2.9","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"cell_min","payload":"2.9","payloadType":"jsonata","x":150,"y":360,"wires":[["14d6e162ec373377"]]},{"id":"b92accaf1dfcf58f","type":"inject","z":"229f5611c9af1f6e","name":"cell_min 3.0","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"cell_min","payload":"3.0","payloadType":"jsonata","x":150,"y":400,"wires":[["14d6e162ec373377"]]},{"id":"863ff59a6ff0566f","type":"inject","z":"229f5611c9af1f6e","name":"cell_min 3.1","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"cell_min","payload":"3.1","payloadType":"jsonata","x":150,"y":440,"wires":[["14d6e162ec373377"]]},{"id":"1d0f2908b0cd6c99","type":"inject","z":"229f5611c9af1f6e","name":"cell_min 3.2","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"cell_min","payload":"3.2","payloadType":"jsonata","x":150,"y":480,"wires":[["14d6e162ec373377"]]},{"id":"0425d641f43661b7","type":"inject","z":"229f5611c9af1f6e","name":"cell_min 3.3","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"cell_min","payload":"3.3","payloadType":"jsonata","x":150,"y":520,"wires":[["14d6e162ec373377"]]},{"id":"c6b0af4e2615be44","type":"inject","z":"229f5611c9af1f6e","name":"cell_min 3.45","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"cell_min","payload":"3.45","payloadType":"jsonata","x":150,"y":560,"wires":[["14d6e162ec373377"]]},{"id":"5e1409f01ce0c8c6","type":"inject","z":"229f5611c9af1f6e","name":"cell_max 2.9","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"cell_max","payload":"2.9","payloadType":"jsonata","x":150,"y":80,"wires":[["3bd2e60daacc5d57"]]},{"id":"c61fdb92442da94e","type":"inject","z":"229f5611c9af1f6e","name":"cell_max 3.0","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"cell_max","payload":"3.0","payloadType":"jsonata","x":150,"y":120,"wires":[["3bd2e60daacc5d57"]]},{"id":"ee99d849ae07ce95","type":"inject","z":"229f5611c9af1f6e","name":"cell_max 3.1","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"cell_max","payload":"3.1","payloadType":"jsonata","x":150,"y":160,"wires":[["3bd2e60daacc5d57"]]},{"id":"92d111892f16f6f7","type":"inject","z":"229f5611c9af1f6e","name":"cell_max 3.2","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"cell_max","payload":"3.2","payloadType":"jsonata","x":150,"y":200,"wires":[["3bd2e60daacc5d57"]]},{"id":"01d819e4d42e154d","type":"inject","z":"229f5611c9af1f6e","name":"cell_max 3.3","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"cell_max","payload":"3.3","payloadType":"jsonata","x":150,"y":240,"wires":[["3bd2e60daacc5d57"]]},{"id":"7f70490197626bd9","type":"inject","z":"229f5611c9af1f6e","name":"cell_max 3.45","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"cell_max","payload":"3.45","payloadType":"jsonata","x":150,"y":280,"wires":[["3bd2e60daacc5d57"]]},{"id":"3bd2e60daacc5d57","type":"range","z":"229f5611c9af1f6e","minin":"2.900","maxin":"3.450","minout":"0","maxout":"100","action":"scale","round":false,"property":"payload","name":"2.9-3.45V to 0-100%","x":440,"y":280,"wires":[["09c1dc6daf0ae65a"]]},{"id":"14d6e162ec373377","type":"range","z":"229f5611c9af1f6e","minin":"2.900","maxin":"3.450","minout":"0","maxout":"100","action":"scale","round":false,"property":"payload","name":"2.9-3.45V to 0-100%","x":440,"y":560,"wires":[["d65e3c691b372797"]]},{"id":"09c1dc6daf0ae65a","type":"function","z":"229f5611c9af1f6e","name":"to 0.00","func":"//msg.payload = msg.payload[86].value\nmsg.payload = parseFloat(msg.payload.toFixed(2))\nreturn msg;\n\n//const result = msg.payload.find(e => e.itemID == 'payload')\n//if (result) { msg.payload = result.value }\n//msg.payload = parseFloat(msg.payload.toFixed(2))\n//return msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":410,"y":340,"wires":[["8f99cbd4688ccde4","6b139a7965a247e0"]]},{"id":"d65e3c691b372797","type":"function","z":"229f5611c9af1f6e","name":"to 0.00","func":"//msg.payload = msg.payload[86].value\nmsg.payload = parseFloat(msg.payload.toFixed(2))\nreturn msg;\n\n//const result = msg.payload.find(e => e.itemID == 'payload')\n//if (result) { msg.payload = result.value }\n//msg.payload = parseFloat(msg.payload.toFixed(2))\n//return msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":410,"y":500,"wires":[["8f99cbd4688ccde4","6b139a7965a247e0"]]},{"id":"8f99cbd4688ccde4","type":"debug","z":"229f5611c9af1f6e","name":"debug_percentage","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":450,"y":420,"wires":[]},{"id":"6b139a7965a247e0","type":"function","z":"229f5611c9af1f6e","name":"function","func":"var outputMsg = 0;\nvar batt_cell_max = 0;\nvar batt_cell_min = 0;\n\nif (msg.topic == \"cell_max\") {\n batt_cell_max = { payload: msg.payload, topic: \"my_topic_cell_max\" };\n }\n else if (msg.topic == \"cell_min\")\n {\n batt_cell_min = { payload: msg.payload, topic: \"my_topic_cell_min\" };\n }\n else if (batt_cell_max > 50)\n {\n outputMsg = batt_cell_max;\n return outputMsg;\n }\n else if (batt_cell_max <= 50)\n {\n outputMsg = batt_cell_min;\n return outputMsg;\n }\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":700,"y":420,"wires":[["367a2b647ceb7d46"]]},{"id":"367a2b647ceb7d46","type":"debug","z":"229f5611c9af1f6e","name":"debug_func","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":850,"y":420,"wires":[]}]
The required function...
- when i input "cell_max 3.2" (over 50% charge) and "cell_min 3.1" so msg.payload "cell_max".
- when i input "cell_max 3.1" (under 50% charge) and "cell_min 3.0" so msg.payload "cell_min".
... i dont see any payload in "debug_func" now.
Thank you very much in advance for your help.