Help with the function node

No, we don't understand each other. I don't know why the translator translates it so imperfectly..
I'll try to write it like this:
1: temperature <80C, soc >80%, bat >=1400w - message "spirala1 1" (spirala1 ON)

2: the temperature, soc, power to the 1400w flashlight and also which spirals are switched on are checked, that is, we have spiral 1 switched on - the message "spirala 2 1" - (turns on spiral2)

3: the temperature, soc, power to the 1400w flashlight are checked and again which spirals are switched on, that is, spiral 1 and 2 are switched on, so the third spiral is switched on - message "spirala3 1"

temperature >80, soc >80 - all spirals OFF
temperature <80, soc <80 - all spirals OFF
temperature <80, soc >80 - Fastening spirals according to conditions

Why not take the tip from @craigcurtin do it the "node-red way"

it may simplify debugging to understanding what happens in the flow.

lebo potrebujem aby mi spínalo špirály na základe výkonu do batérie!Ked je vykon 1400W a teplota<80 a soc >80 tak zapne jednu spiralu.Ak vykon do baterie zase bude 1400W tak skontroluje podmienky teploty,soc a ktore spiraly su zopnute tak podla toho zopne dalsiu spirálu

Is it close now?
I expect the inject nodes to be replaced with Victron nodes.
I don't have a Victron to try it with, so inject the nodes.

[{"id":"5c22dc58c00d6d57","type":"tab","label":"Victron1","disabled":false,"info":"","env":[]},{"id":"a9ee9143e3a2a6b3","type":"group","z":"5c22dc58c00d6d57","name":"voľba vyťažovania ovládanie v dashboarde","style":{"label":true,"color":"#3f3f3f","stroke":"#3f3f3f","label-position":"n"},"nodes":["9b8f22f3a1d85b7b","85fee20f9cceed0e","25e4887cfbfb3b2a","e1ba89f7bded151a"],"x":45,"y":45,"w":392,"h":142},{"id":"25337b7337cddde2","type":"junction","z":"5c22dc58c00d6d57","x":620,"y":140,"wires":[["e1ba89f7bded151a"]]},{"id":"57f3c15c9fb9be2c","type":"junction","z":"5c22dc58c00d6d57","x":620,"y":60,"wires":[["25e4887cfbfb3b2a"]]},{"id":"893996183c5fcd8c","type":"junction","z":"5c22dc58c00d6d57","x":480,"y":380,"wires":[["df09d5bc174815ed"]]},{"id":"52d2066b05f4371d","type":"victron-input-temperature","z":"5c22dc58c00d6d57","service":"com.victronenergy.temperature/24","path":"/Temperature","serviceObj":{"service":"com.victronenergy.temperature/24","name":"Akumulacka vrch"},"pathObj":{"path":"/Temperature","type":"float","name":"Temperature (°C)"},"name":"temperature","onlyChanges":false,"roundValues":"1","x":115,"y":400,"wires":[["24175936f23b4cf3"]]},{"id":"df09d5bc174815ed","type":"join","z":"5c22dc58c00d6d57","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","useparts":true,"accumulate":true,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":335,"y":280,"wires":[["2393b485adccca9f","bda2d11e53c3ca8b"]]},{"id":"5218fc9afce42845","type":"inject","z":"5c22dc58c00d6d57","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1401","payloadType":"num","x":115,"y":320,"wires":[["4f14979b6a142fdc"]]},{"id":"08df8b03d51e1f33","type":"inject","z":"5c22dc58c00d6d57","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"81","payloadType":"num","x":115,"y":240,"wires":[["02dfab8d47fa2ab9"]]},{"id":"718e4d7a7df110b9","type":"function","z":"5c22dc58c00d6d57","name":"function 49","func":"msg.topic = \"spirala1\";\nflow.set(\"spirala1\", msg.payload);\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":370,"y":1040,"wires":[[]]},{"id":"b36f08f37382f041","type":"function","z":"5c22dc58c00d6d57","name":"function 50","func":"msg.topic = \"spirala2\";\nflow.set(\"spirala2\", msg.payload);\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":370,"y":1100,"wires":[[]]},{"id":"1d4a561c52c243fc","type":"function","z":"5c22dc58c00d6d57","name":"function 51","func":"msg.topic = \"spirala3\";\nflow.set(\"spirala3\", msg.payload);\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":370,"y":1160,"wires":[[]]},{"id":"8d67fd36ad2bc6e8","type":"debug","z":"5c22dc58c00d6d57","name":"debug 34","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":745,"y":260,"wires":[]},{"id":"63539cda9d86b948","type":"debug","z":"5c22dc58c00d6d57","name":"debug 35","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":745,"y":300,"wires":[]},{"id":"2393b485adccca9f","type":"function","z":"5c22dc58c00d6d57","name":"function 53","func":"// Look in On Start\nlet msg1 = {}; let msg2 = { payload: 'OFF' }\nlet vytazovanie = flow.get(\"vytazovanie\") ?? true // false\nlet prepinac = flow.get(\"prepinac\") ?? 'hore' // 'dulo\n\nlet spirala1 = flow.get(\"spirala1\") ?? '0'\nlet spirala2 = flow.get(\"spirala2\") ?? '0'\nlet spirala3 = flow.get(\"spirala3\") ?? '0'\n\nlet temperature = msg.payload.temperature\nlet bat = msg.payload.bat\nlet soc = msg.payload.soc\n\nfunction OFF() {\n    flow.set(\"spirala1\", \"0\")\n    flow.set(\"spirala2\", \"0\")\n    flow.set(\"spirala3\", \"0\")\n    msg1 = { payload: 'OFF' }\n}\n\nif (vytazovanie) { // true\n\n    if (temperature < 80 && soc > 80) {\n    //if (temperature < 80) {\n\n            if (bat > 1400) {\n            //if (bat > 1400 && soc > 80) {\n\n            if (spirala1 === \"1\" && spirala2 === \"1\" && spirala3 === \"1\") {\n                msg1.payload = null\n            }\n\n            if (spirala1 === \"1\" && spirala2 === \"1\" && spirala3 === \"0\") {\n                msg1.payload = \"spirala3 1\"\n                flow.set(\"spirala3\", \"1\")\n            }\n\n            if (spirala1 === \"1\" && spirala2 === \"0\" && spirala3 === \"0\") {\n                msg1.payload = \"spirala2 1\"\n                flow.set(\"spirala2\", \"1\")\n            }\n\n            if (spirala1 === \"0\" && spirala2 === \"0\" && spirala3 === \"0\") {\n                msg1.payload = \"spirala1 1\"\n                flow.set(\"spirala1\", \"1\")\n            }\n\n        }\n\n    } else { // off\n        OFF()\n    }\n\n    /////////////////////////////////////////////////////////\n\n    if (bat < 30) {\n\n        if (spirala1 === \"0\" && spirala2 === \"0\" && spirala3 === \"0\") {\n            msg1.payload = null\n        }\n\n        if (spirala1 === \"1\" && spirala2 === \"0\" && spirala3 === \"0\") {\n            msg1.payload = \"spirala1 0\"\n            flow.set(\"spirala1\", \"0\")\n        }\n\n        if (spirala1 === \"1\" && spirala2 === \"1\" && spirala3 === \"0\") {\n            msg1.payload = \"spirala2 0\"\n            flow.set(\"spirala2\", \"0\")\n        }\n\n        if (spirala1 === \"1\" && spirala2 === \"1\" && spirala3 === \"1\") {\n            msg1.payload = \"spirala3 0\"\n            flow.set(\"spirala3\", \"0\")\n        }\n\n    }\n\n} else { // false\n    OFF()\n}\n\n// Posielanie hore alebo dole na zaklade prepinaca\nif (prepinac === \"hore\") {\n    return [msg1, msg2]\n} else { // dolu\n    return [msg2, msg1]\n}","outputs":2,"timeout":0,"noerr":0,"initialize":"// Code added here will be run once\n// whenever the node is started.\n\nflow.set(\"spirala1\", \"0\")\nflow.set(\"spirala2\", \"0\")\nflow.set(\"spirala3\", \"0\")\n","finalize":"","libs":[],"x":475,"y":280,"wires":[["8d67fd36ad2bc6e8","6e40322151ee5b96"],["63539cda9d86b948","d5a347640b69be01"]]},{"id":"a76495cbdf7558e8","type":"victron-input-battery","z":"5c22dc58c00d6d57","service":"com.victronenergy.battery/277","path":"/Relay/0/State","serviceObj":{"service":"com.victronenergy.battery/277","name":"Baterka"},"pathObj":{"path":"/Relay/0/State","type":"enum","name":"Relay status","enum":{"0":"Open","1":"Closed"}},"initial":"","name":"spirala1","onlyChanges":false,"x":170,"y":1040,"wires":[["718e4d7a7df110b9"]]},{"id":"26069f48f8eb08c8","type":"victron-input-relay","z":"5c22dc58c00d6d57","service":"com.victronenergy.system/0","path":"/Relay/0/State","serviceObj":{"service":"com.victronenergy.system/0","name":"Venus system"},"pathObj":{"path":"/Relay/0/State","type":"enum","name":"Venus relay 1 state","enum":{"0":"Open","1":"Closed"}},"initial":"","name":"spirala2","onlyChanges":false,"x":170,"y":1100,"wires":[["b36f08f37382f041"]]},{"id":"2a0b303ba93bf873","type":"victron-input-relay","z":"5c22dc58c00d6d57","service":"com.victronenergy.system/0","path":"/Relay/1/State","serviceObj":{"service":"com.victronenergy.system/0","name":"Venus system"},"pathObj":{"path":"/Relay/1/State","type":"enum","name":"Venus relay 2 state","enum":{"0":"Open","1":"Closed"}},"initial":"","name":"spirala3","onlyChanges":false,"x":170,"y":1160,"wires":[["1d4a561c52c243fc"]]},{"id":"fc9edcd44eb237ab","type":"victron-output-relay","z":"5c22dc58c00d6d57","service":"com.victronenergy.system/0","path":"/Relay/0/State","serviceObj":{"service":"com.victronenergy.system/0","name":"Venus device"},"pathObj":{"path":"/Relay/0/State","type":"enum","name":"Venus relay 1 state","enum":{"0":"Open","1":"Closed"},"writable":true,"disabled":false},"initial":"","name":"spirala2","onlyChanges":false,"x":660,"y":580,"wires":[]},{"id":"8c3db7fcd585bb9b","type":"victron-output-relay","z":"5c22dc58c00d6d57","service":"com.victronenergy.system/0","path":"/Relay/1/State","serviceObj":{"service":"com.victronenergy.system/0","name":"Venus device"},"pathObj":{"path":"/Relay/1/State","type":"enum","name":"Venus relay 2 state","enum":{"0":"Open","1":"Closed"},"writable":true},"initial":"","name":"spirala3","onlyChanges":false,"x":660,"y":640,"wires":[]},{"id":"9f6ec0894752f4f2","type":"victron-output-relay","z":"5c22dc58c00d6d57","service":"com.victronenergy.battery/277","path":"/Relay/0/State","serviceObj":{"service":"com.victronenergy.battery/277","name":"Baterka"},"pathObj":{"path":"/Relay/0/State","type":"enum","name":"Relay status","enum":{"0":"Open","1":"Closed"},"writable":true},"initial":"","name":"spirala1","onlyChanges":false,"x":660,"y":520,"wires":[]},{"id":"8c119cfd86e6c6c1","type":"switch","z":"5c22dc58c00d6d57","name":"","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"spirala1 1","vt":"str"},{"t":"cont","v":"spirala1 0","vt":"str"},{"t":"cont","v":"spirala2 1","vt":"str"},{"t":"cont","v":"spirala2 0","vt":"str"},{"t":"cont","v":"spirala3 1","vt":"str"},{"t":"cont","v":"spirala3 0","vt":"str"},{"t":"cont","v":"OFF","vt":"str"}],"checkall":"true","repair":false,"outputs":7,"x":230,"y":580,"wires":[["2c92c18196d249de"],["2c92c18196d249de"],["d50320b313dc3495"],["d50320b313dc3495"],["cc736b7b0c8c0293"],["cc736b7b0c8c0293"],["cc736b7b0c8c0293","d50320b313dc3495","2c92c18196d249de"]]},{"id":"2c92c18196d249de","type":"change","z":"5c22dc58c00d6d57","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"spirala1 1","fromt":"str","to":"1","tot":"num"},{"t":"change","p":"payload","pt":"msg","from":"spirala1 0","fromt":"str","to":"0","tot":"num"},{"t":"change","p":"payload","pt":"msg","from":"OFF","fromt":"str","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":520,"wires":[["9f6ec0894752f4f2","622a436d13a7fbc5"]]},{"id":"d50320b313dc3495","type":"change","z":"5c22dc58c00d6d57","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"spirala2 1","fromt":"str","to":"1","tot":"num"},{"t":"change","p":"payload","pt":"msg","from":"spirala2 0","fromt":"str","to":"0","tot":"num"},{"t":"change","p":"payload","pt":"msg","from":"OFF","fromt":"str","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":580,"wires":[["fc9edcd44eb237ab","c7e1782008f53eae"]]},{"id":"cc736b7b0c8c0293","type":"change","z":"5c22dc58c00d6d57","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"spirala3 1","fromt":"str","to":"1","tot":"num"},{"t":"change","p":"payload","pt":"msg","from":"spirala3 0","fromt":"str","to":"0","tot":"num"},{"t":"change","p":"payload","pt":"msg","from":"OFF","fromt":"str","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":640,"wires":[["8c3db7fcd585bb9b","2bd79f6fbc5efb28"]]},{"id":"9b8f22f3a1d85b7b","type":"ui_multistate_switch","z":"5c22dc58c00d6d57","d":true,"g":"a9ee9143e3a2a6b3","name":"prepinac","group":"","order":2,"width":0,"height":1,"label":"Výber špirál","stateField":"payload","enableField":"enable","passthroughField":"change","inputMsgField":"inputmsg","rounded":true,"useThemeColors":true,"hideSelectedLabel":false,"multilineLabel":false,"passThrough":"change","inputMsg":"none","userInput":"enabled_show","options":[{"label":"vrch AN","value":"hore","valueType":"str","color":"#009933"},{"label":"spodok AN","value":"dolu","valueType":"str","color":"#999999"}],"topic":"msg.payload","x":131,"y":146,"wires":[["e1ba89f7bded151a"]]},{"id":"85fee20f9cceed0e","type":"ui_multistate_switch","z":"5c22dc58c00d6d57","d":true,"g":"a9ee9143e3a2a6b3","name":"vytazovanie","group":"","order":1,"width":0,"height":1,"label":"Vyťažovanie","stateField":"payload","enableField":"enable","passthroughField":"passthrough","inputMsgField":"inputmsg","rounded":true,"useThemeColors":false,"hideSelectedLabel":false,"multilineLabel":false,"passThrough":"change","inputMsg":"none","userInput":"enabled_show","options":[{"label":"Vypnuté","value":"false","valueType":"bool","color":"#ff0019"},{"label":"Zapnuté","value":"true","valueType":"bool","color":"#009900"}],"topic":"msg.payload","x":141,"y":86,"wires":[["25e4887cfbfb3b2a"]]},{"id":"25e4887cfbfb3b2a","type":"function","z":"5c22dc58c00d6d57","g":"a9ee9143e3a2a6b3","name":"context-flow","func":"// Change Node nastavenie\nmsg.topic = \"vytazovanie\";\nflow.set(\"vytazovanie\", msg.payload);\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":341,"y":86,"wires":[[]]},{"id":"e1ba89f7bded151a","type":"function","z":"5c22dc58c00d6d57","g":"a9ee9143e3a2a6b3","name":"context-flow","func":"// Change Node nastavenie\nmsg.topic = \"prepinac\"\nflow.set(\"prepinac\", msg.payload)\n\nflow.set(\"spirala1\", \"0\")\nflow.set(\"spirala2\", \"0\")\nflow.set(\"spirala3\", \"0\")\n\nreturn msg\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":341,"y":146,"wires":[[]]},{"id":"24175936f23b4cf3","type":"function","z":"5c22dc58c00d6d57","name":"topic temperature","func":"msg.topic = 'temperature'\nreturn msg\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":330,"y":420,"wires":[["893996183c5fcd8c"]]},{"id":"5badd2903a1bc8a7","type":"inject","z":"5c22dc58c00d6d57","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"80","payloadType":"num","x":115,"y":460,"wires":[["24175936f23b4cf3"]]},{"id":"bda2d11e53c3ca8b","type":"debug","z":"5c22dc58c00d6d57","name":"debug 2564","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":455,"y":240,"wires":[]},{"id":"b323fff3ebe7e8ee","type":"inject","z":"5c22dc58c00d6d57","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"79","payloadType":"num","x":115,"y":500,"wires":[["24175936f23b4cf3"]]},{"id":"49d53276ea15a0e7","type":"inject","z":"5c22dc58c00d6d57","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"hore","payloadType":"str","x":530,"y":120,"wires":[["25337b7337cddde2"]]},{"id":"7dec6a8cc3c99246","type":"inject","z":"5c22dc58c00d6d57","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"dolu","payloadType":"str","x":530,"y":160,"wires":[["25337b7337cddde2"]]},{"id":"622a436d13a7fbc5","type":"debug","z":"5c22dc58c00d6d57","name":"debug 2565","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":790,"y":500,"wires":[]},{"id":"d40d225eb6277fa4","type":"inject","z":"5c22dc58c00d6d57","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"29","payloadType":"num","x":115,"y":360,"wires":[["4f14979b6a142fdc"]]},{"id":"c7e1782008f53eae","type":"debug","z":"5c22dc58c00d6d57","name":"debug 2566","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":790,"y":560,"wires":[]},{"id":"2bd79f6fbc5efb28","type":"debug","z":"5c22dc58c00d6d57","name":"debug 2567","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":790,"y":620,"wires":[]},{"id":"9508c33a93c565d6","type":"inject","z":"5c22dc58c00d6d57","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"80","payloadType":"num","x":115,"y":280,"wires":[["02dfab8d47fa2ab9"]]},{"id":"64957d3d3c73617f","type":"inject","z":"5c22dc58c00d6d57","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":530,"y":40,"wires":[["57f3c15c9fb9be2c"]]},{"id":"aa53d3d88dcb32e9","type":"inject","z":"5c22dc58c00d6d57","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"false","payloadType":"bool","x":530,"y":80,"wires":[["57f3c15c9fb9be2c"]]},{"id":"e5f6ce14cb743cbe","type":"link in","z":"5c22dc58c00d6d57","name":"link in 15","links":["6e40322151ee5b96"],"x":125,"y":580,"wires":[["8c119cfd86e6c6c1"]]},{"id":"6e40322151ee5b96","type":"link out","z":"5c22dc58c00d6d57","name":"link out 33","mode":"link","links":["e5f6ce14cb743cbe"],"x":620,"y":260,"wires":[]},{"id":"d5a347640b69be01","type":"link out","z":"5c22dc58c00d6d57","name":"link out 34","mode":"link","links":["66a48694be348402"],"x":620,"y":300,"wires":[]},{"id":"66a48694be348402","type":"link in","z":"5c22dc58c00d6d57","name":"link in 16","links":["d5a347640b69be01"],"x":125,"y":780,"wires":[["ec3ec1068e8998ae"]]},{"id":"ec3ec1068e8998ae","type":"switch","z":"5c22dc58c00d6d57","name":"","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"spirala1 1","vt":"str"},{"t":"cont","v":"spirala1 0","vt":"str"},{"t":"cont","v":"spirala2 1","vt":"str"},{"t":"cont","v":"spirala2 0","vt":"str"},{"t":"cont","v":"spirala3 1","vt":"str"},{"t":"cont","v":"spirala3 0","vt":"str"},{"t":"cont","v":"OFF","vt":"str"}],"checkall":"true","repair":false,"outputs":7,"x":230,"y":780,"wires":[["4091d7f25657356d"],["4091d7f25657356d"],["16e560c8e31446ba"],["16e560c8e31446ba"],["be1818c9a5779d3e"],["be1818c9a5779d3e"],["be1818c9a5779d3e","16e560c8e31446ba","4091d7f25657356d"]]},{"id":"4091d7f25657356d","type":"change","z":"5c22dc58c00d6d57","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"spirala1 1","fromt":"str","to":"1","tot":"num"},{"t":"change","p":"payload","pt":"msg","from":"spirala1 0","fromt":"str","to":"0","tot":"num"},{"t":"change","p":"payload","pt":"msg","from":"OFF","fromt":"str","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":720,"wires":[["912f7f801ceaa577","99eb657329f218ce"]]},{"id":"16e560c8e31446ba","type":"change","z":"5c22dc58c00d6d57","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"spirala2 1","fromt":"str","to":"1","tot":"num"},{"t":"change","p":"payload","pt":"msg","from":"spirala2 0","fromt":"str","to":"0","tot":"num"},{"t":"change","p":"payload","pt":"msg","from":"OFF","fromt":"str","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":780,"wires":[["18a0cff917863b86","0ae76fd8100074d5"]]},{"id":"be1818c9a5779d3e","type":"change","z":"5c22dc58c00d6d57","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"spirala3 1","fromt":"str","to":"1","tot":"num"},{"t":"change","p":"payload","pt":"msg","from":"spirala3 0","fromt":"str","to":"0","tot":"num"},{"t":"change","p":"payload","pt":"msg","from":"OFF","fromt":"str","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":840,"wires":[["1df5b54902e01120","d60995f884d519f0"]]},{"id":"912f7f801ceaa577","type":"victron-output-relay","z":"5c22dc58c00d6d57","service":"com.victronenergy.battery/277","path":"/Relay/0/State","serviceObj":{"service":"com.victronenergy.battery/277","name":"Baterka"},"pathObj":{"path":"/Relay/0/State","type":"enum","name":"Relay status","enum":{"0":"Open","1":"Closed"},"writable":true},"initial":"","name":"spirala1","onlyChanges":false,"x":660,"y":720,"wires":[]},{"id":"99eb657329f218ce","type":"debug","z":"5c22dc58c00d6d57","name":"debug 2568","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":790,"y":700,"wires":[]},{"id":"18a0cff917863b86","type":"victron-output-relay","z":"5c22dc58c00d6d57","service":"com.victronenergy.system/0","path":"/Relay/0/State","serviceObj":{"service":"com.victronenergy.system/0","name":"Venus device"},"pathObj":{"path":"/Relay/0/State","type":"enum","name":"Venus relay 1 state","enum":{"0":"Open","1":"Closed"},"writable":true,"disabled":false},"initial":"","name":"spirala2","onlyChanges":false,"x":660,"y":780,"wires":[]},{"id":"0ae76fd8100074d5","type":"debug","z":"5c22dc58c00d6d57","name":"debug 2569","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":790,"y":760,"wires":[]},{"id":"1df5b54902e01120","type":"victron-output-relay","z":"5c22dc58c00d6d57","service":"com.victronenergy.system/0","path":"/Relay/1/State","serviceObj":{"service":"com.victronenergy.system/0","name":"Venus device"},"pathObj":{"path":"/Relay/1/State","type":"enum","name":"Venus relay 2 state","enum":{"0":"Open","1":"Closed"},"writable":true},"initial":"","name":"spirala3","onlyChanges":false,"x":660,"y":840,"wires":[]},{"id":"d60995f884d519f0","type":"debug","z":"5c22dc58c00d6d57","name":"debug 2570","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":790,"y":820,"wires":[]},{"id":"02dfab8d47fa2ab9","type":"function","z":"5c22dc58c00d6d57","name":"topic soc","func":"msg.topic = 'soc'\nreturn msg\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":360,"y":340,"wires":[["893996183c5fcd8c"]]},{"id":"4f14979b6a142fdc","type":"function","z":"5c22dc58c00d6d57","name":"topic bat","func":"msg.topic = 'bat'\nreturn msg\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":360,"y":380,"wires":[["893996183c5fcd8c"]]}]

I did something similar last year, for someone in France. See photo.

lenze mne ten kod co som sem posielal funguje ale stale posiela iba spravu aby zaplo spiralu1.A ked ju zapne tak sa objavy aj v context ale uz dalej nezopne druhu ani tretiu

When you start press input with 81 and input with 1401 and input with 79 then output 1 will be active. For each subsequent press on one of the 3 inputs, the next output becomes active, so after 2 more inputs, all outputs are active. Node Red is event driven.

[
    {
        "id": "9cb4408dec3cec45",
        "type": "victron-input-temperature",
        "z": "7bb4b982f37a1f91",
        "service": "com.victronenergy.temperature/24",
        "path": "/Temperature",
        "serviceObj": {
            "service": "com.victronenergy.temperature/24",
            "name": "Akumulacka vrch"
        },
        "pathObj": {
            "path": "/Temperature",
            "type": "float",
            "name": "Temperature (°C)"
        },
        "name": "temperature",
        "onlyChanges": false,
        "roundValues": "1",
        "x": 130,
        "y": 1520,
        "wires": [
            [
                "72b8afdb0c028826"
            ]
        ]
    },
    {
        "id": "72b8afdb0c028826",
        "type": "join",
        "z": "7bb4b982f37a1f91",
        "name": "",
        "mode": "custom",
        "build": "object",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": false,
        "timeout": "",
        "count": "3",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "",
        "reduceFixup": "",
        "x": 350,
        "y": 1480,
        "wires": [
            [
                "49e114075aa090ce"
            ]
        ]
    },
    {
        "id": "c3454808368cce43",
        "type": "inject",
        "z": "7bb4b982f37a1f91",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "1",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "bat",
        "payload": "1589",
        "payloadType": "num",
        "x": 140,
        "y": 1480,
        "wires": [
            [
                "72b8afdb0c028826"
            ]
        ]
    },
    {
        "id": "a687ace9c2680386",
        "type": "inject",
        "z": "7bb4b982f37a1f91",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "1",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "soc",
        "payload": "85",
        "payloadType": "num",
        "x": 140,
        "y": 1440,
        "wires": [
            [
                "72b8afdb0c028826"
            ]
        ]
    },
    {
        "id": "fa54042223c20b04",
        "type": "function",
        "z": "7bb4b982f37a1f91",
        "name": "function 49",
        "func": "// Change Node nastavenie\nmsg.topic = \"spirala1\";\nflow.set(\"spirala1\", msg.payload);\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 310,
        "y": 1600,
        "wires": [
            []
        ]
    },
    {
        "id": "19284b37d45800ac",
        "type": "function",
        "z": "7bb4b982f37a1f91",
        "name": "function 50",
        "func": "// Change Node nastavenie\nmsg.topic = \"spirala2\";\nflow.set(\"spirala2\", msg.payload);\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 310,
        "y": 1660,
        "wires": [
            []
        ]
    },
    {
        "id": "6c7632b238f16b32",
        "type": "function",
        "z": "7bb4b982f37a1f91",
        "name": "function 51",
        "func": "// Change Node nastavenie\nmsg.topic = \"spirala3\";\nflow.set(\"spirala3\", msg.payload);\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 310,
        "y": 1720,
        "wires": [
            []
        ]
    },
    {
        "id": "36186e634336a10e",
        "type": "debug",
        "z": "7bb4b982f37a1f91",
        "name": "debug 34",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 1040,
        "y": 1320,
        "wires": []
    },
    {
        "id": "0a8a2ea5ea6928e6",
        "type": "debug",
        "z": "7bb4b982f37a1f91",
        "name": "debug 35",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1100,
        "y": 1420,
        "wires": []
    },
    {
        "id": "7274ed0f303db499",
        "type": "victron-input-battery",
        "z": "7bb4b982f37a1f91",
        "service": "com.victronenergy.battery/277",
        "path": "/Relay/0/State",
        "serviceObj": {
            "service": "com.victronenergy.battery/277",
            "name": "Baterka"
        },
        "pathObj": {
            "path": "/Relay/0/State",
            "type": "enum",
            "name": "Relay status",
            "enum": {
                "0": "Open",
                "1": "Closed"
            }
        },
        "initial": "",
        "name": "spirala1",
        "onlyChanges": false,
        "x": 110,
        "y": 1600,
        "wires": [
            [
                "fa54042223c20b04"
            ]
        ]
    },
    {
        "id": "89f26af5d635f161",
        "type": "victron-input-relay",
        "z": "7bb4b982f37a1f91",
        "service": "com.victronenergy.system/0",
        "path": "/Relay/0/State",
        "serviceObj": {
            "service": "com.victronenergy.system/0",
            "name": "Venus system"
        },
        "pathObj": {
            "path": "/Relay/0/State",
            "type": "enum",
            "name": "Venus relay 1 state",
            "enum": {
                "0": "Open",
                "1": "Closed"
            }
        },
        "initial": "",
        "name": "spirala2",
        "onlyChanges": false,
        "x": 110,
        "y": 1660,
        "wires": [
            [
                "19284b37d45800ac"
            ]
        ]
    },
    {
        "id": "f60fb54ea8b74b84",
        "type": "victron-input-relay",
        "z": "7bb4b982f37a1f91",
        "service": "com.victronenergy.system/0",
        "path": "/Relay/1/State",
        "serviceObj": {
            "service": "com.victronenergy.system/0",
            "name": "Venus system"
        },
        "pathObj": {
            "path": "/Relay/1/State",
            "type": "enum",
            "name": "Venus relay 2 state",
            "enum": {
                "0": "Open",
                "1": "Closed"
            }
        },
        "initial": "",
        "name": "spirala3",
        "onlyChanges": false,
        "x": 110,
        "y": 1720,
        "wires": [
            [
                "6c7632b238f16b32"
            ]
        ]
    },
    {
        "id": "da65f8666bfc1a72",
        "type": "victron-output-relay",
        "z": "7bb4b982f37a1f91",
        "service": "com.victronenergy.system/0",
        "path": "/Relay/0/State",
        "serviceObj": {
            "service": "com.victronenergy.system/0",
            "name": "Venus device"
        },
        "pathObj": {
            "path": "/Relay/0/State",
            "type": "enum",
            "name": "Venus relay 1 state",
            "enum": {
                "0": "Open",
                "1": "Closed"
            },
            "writable": true,
            "disabled": false
        },
        "initial": "",
        "name": "spirala2",
        "onlyChanges": false,
        "x": 1100,
        "y": 1460,
        "wires": []
    },
    {
        "id": "352ef9f596e3c543",
        "type": "victron-output-relay",
        "z": "7bb4b982f37a1f91",
        "service": "com.victronenergy.system/0",
        "path": "/Relay/1/State",
        "serviceObj": {
            "service": "com.victronenergy.system/0",
            "name": "Venus device"
        },
        "pathObj": {
            "path": "/Relay/1/State",
            "type": "enum",
            "name": "Venus relay 2 state",
            "enum": {
                "0": "Open",
                "1": "Closed"
            },
            "writable": true
        },
        "initial": "",
        "name": "spirala3",
        "onlyChanges": false,
        "x": 1100,
        "y": 1560,
        "wires": []
    },
    {
        "id": "435a2b80bec00f09",
        "type": "victron-output-relay",
        "z": "7bb4b982f37a1f91",
        "service": "com.victronenergy.battery/277",
        "path": "/Relay/0/State",
        "serviceObj": {
            "service": "com.victronenergy.battery/277",
            "name": "Baterka"
        },
        "pathObj": {
            "path": "/Relay/0/State",
            "type": "enum",
            "name": "Relay status",
            "enum": {
                "0": "Open",
                "1": "Closed"
            },
            "writable": true
        },
        "initial": "",
        "name": "spirala1",
        "onlyChanges": false,
        "x": 1060,
        "y": 1360,
        "wires": []
    },
    {
        "id": "e7c9fc8e9278124f",
        "type": "switch",
        "z": "7bb4b982f37a1f91",
        "name": "",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "cont",
                "v": "spirala1 1",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "spirala1 0",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "spirala2 1",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "spirala2 0",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "spirala3 1",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "spirala3 0",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "OFF",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 7,
        "x": 670,
        "y": 1460,
        "wires": [
            [
                "bccb3ab71d4d9c6b"
            ],
            [
                "bccb3ab71d4d9c6b"
            ],
            [
                "1af6c9287dea1841"
            ],
            [
                "1af6c9287dea1841"
            ],
            [
                "7db54b1f99f24679"
            ],
            [
                "7db54b1f99f24679"
            ],
            [
                "7db54b1f99f24679",
                "1af6c9287dea1841",
                "bccb3ab71d4d9c6b"
            ]
        ]
    },
    {
        "id": "bccb3ab71d4d9c6b",
        "type": "change",
        "z": "7bb4b982f37a1f91",
        "name": "",
        "rules": [
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "spirala1 1",
                "fromt": "str",
                "to": "1",
                "tot": "num"
            },
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "spirala1 0",
                "fromt": "str",
                "to": "0",
                "tot": "num"
            },
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "OFF",
                "fromt": "str",
                "to": "0",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 880,
        "y": 1400,
        "wires": [
            [
                "435a2b80bec00f09",
                "36186e634336a10e"
            ]
        ]
    },
    {
        "id": "1af6c9287dea1841",
        "type": "change",
        "z": "7bb4b982f37a1f91",
        "name": "",
        "rules": [
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "spirala2 1",
                "fromt": "str",
                "to": "1",
                "tot": "num"
            },
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "spirala2 0",
                "fromt": "str",
                "to": "0",
                "tot": "num"
            },
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "OFF",
                "fromt": "str",
                "to": "0",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 880,
        "y": 1460,
        "wires": [
            [
                "da65f8666bfc1a72",
                "0a8a2ea5ea6928e6"
            ]
        ]
    },
    {
        "id": "7db54b1f99f24679",
        "type": "change",
        "z": "7bb4b982f37a1f91",
        "name": "",
        "rules": [
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "spirala3 1",
                "fromt": "str",
                "to": "1",
                "tot": "num"
            },
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "spirala3 0",
                "fromt": "str",
                "to": "0",
                "tot": "num"
            },
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "OFF",
                "fromt": "str",
                "to": "0",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 880,
        "y": 1520,
        "wires": [
            [
                "352ef9f596e3c543",
                "5f73d24b3324551f"
            ]
        ]
    },
    {
        "id": "5f73d24b3324551f",
        "type": "debug",
        "z": "7bb4b982f37a1f91",
        "name": "debug 38",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 1100,
        "y": 1520,
        "wires": []
    },
    {
        "id": "8e1939a573be78e0",
        "type": "debug",
        "z": "7bb4b982f37a1f91",
        "name": "debug 39",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 660,
        "y": 1380,
        "wires": []
    },
    {
        "id": "5fa8b5a05bd48d83",
        "type": "debug",
        "z": "7bb4b982f37a1f91",
        "name": "debug 40",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 660,
        "y": 1560,
        "wires": []
    },
    {
        "id": "2588a2b43b3db522",
        "type": "switch",
        "z": "7bb4b982f37a1f91",
        "name": "",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "cont",
                "v": "spirala1 1",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "spirala1 0",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "spirala2 1",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "spirala2 0",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "spirala3 1",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "spirala3 0",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "OFF",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 7,
        "x": 670,
        "y": 1640,
        "wires": [
            [
                "ea62aef1d1ae32ba"
            ],
            [
                "ea62aef1d1ae32ba"
            ],
            [
                "369e60c6ce36fc75"
            ],
            [
                "369e60c6ce36fc75"
            ],
            [
                "728b3c9fad2cc0a4"
            ],
            [
                "728b3c9fad2cc0a4"
            ],
            [
                "728b3c9fad2cc0a4",
                "369e60c6ce36fc75",
                "ea62aef1d1ae32ba"
            ]
        ]
    },
    {
        "id": "ea62aef1d1ae32ba",
        "type": "change",
        "z": "7bb4b982f37a1f91",
        "name": "",
        "rules": [
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "spirala1 1",
                "fromt": "str",
                "to": "1",
                "tot": "num"
            },
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "spirala1 0",
                "fromt": "str",
                "to": "0",
                "tot": "num"
            },
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "OFF",
                "fromt": "str",
                "to": "0",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 880,
        "y": 1580,
        "wires": [
            []
        ]
    },
    {
        "id": "369e60c6ce36fc75",
        "type": "change",
        "z": "7bb4b982f37a1f91",
        "name": "",
        "rules": [
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "spirala2 1",
                "fromt": "str",
                "to": "1",
                "tot": "num"
            },
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "spirala2 0",
                "fromt": "str",
                "to": "0",
                "tot": "num"
            },
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "OFF",
                "fromt": "str",
                "to": "0",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 880,
        "y": 1640,
        "wires": [
            []
        ]
    },
    {
        "id": "728b3c9fad2cc0a4",
        "type": "change",
        "z": "7bb4b982f37a1f91",
        "name": "",
        "rules": [
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "spirala3 1",
                "fromt": "str",
                "to": "1",
                "tot": "num"
            },
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "spirala3 0",
                "fromt": "str",
                "to": "0",
                "tot": "num"
            },
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "OFF",
                "fromt": "str",
                "to": "0",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 880,
        "y": 1700,
        "wires": [
            []
        ]
    },
    {
        "id": "49e114075aa090ce",
        "type": "function",
        "z": "7bb4b982f37a1f91",
        "name": "function 57",
        "func": "if (flow.get(\"vytazovanie\") === true) {\n    if (flow.get(\"spirala1\") === \"0\" && flow.get(\"spirala2\") === \"0\" && flow.get(\"spirala3\") === \"0\") {\n        if (msg.payload.bat > 1400 && msg.payload.soc > 80 && msg.payload.temperature < 80) {\n            msg.payload = \"spirala1 1\"; // Set the payload value\n            flow.set(\"spirala1\", 1);\n        } else if (flow.get(\"spirala1\") === \"1\" && flow.get(\"spirala2\") === \"0\" && flow.get(\"spirala3\") === \"0\" && msg.payload.bat > 1400 && msg.payload.soc > 80 && msg.payload.temperature < 80) {\n            msg.payload = \"spirala2 1\"; // Set the payload value\n            flow.set(\"spirala2\", 1);\n        } else if (flow.get(\"spirala1\") === \"1\" && flow.get(\"spirala2\") === \"1\" && flow.get(\"spirala3\") === \"0\" && msg.payload.bat > 1400 && msg.payload.soc > 80 && msg.payload.temperature < 80) {\n            msg.payload = \"spirala3 1\"; // Set the payload value\n            flow.set(\"spirala3\", 1);\n        } else if (msg.payload.bat < 30 && flow.get(\"spirala1\") === \"1\" && flow.get(\"spirala2\") === \"1\" && flow.get(\"spirala3\") === \"1\") {\n            msg.payload = \"spirala3 0\"; // Set the payload value\n            flow.set(\"spirala3\", 0);\n        } else if (msg.payload.bat < 30 && flow.get(\"spirala1\") === \"1\" && flow.get(\"spirala2\") === \"1\" && flow.get(\"spirala3\") === \"0\") {\n            msg.payload = \"spirala2 0\"; // Set the payload value\n            flow.set(\"spirala2\", 0);\n        } else if (msg.payload.bat < 30 && flow.get(\"spirala1\") === \"1\" && flow.get(\"spirala2\") === \"0\" && flow.get(\"spirala3\") === \"0\") {\n            msg.payload = \"spirala1 0\"; // Set the payload value\n            flow.set(\"spirala1\", 0);\n        }\n    } else {\n        msg.payload = \"OFF\"; // Set the payload value\n    }\n}\n\n// Posielanie hore alebo dole na zaklade prepinaca\nif (flow.get(\"prepinac\") === \"hore\") {\n    return [msg, null];\n} else {\n    return [null, msg];\n}\n\n// Neustála kontrolaSpiral\nsetInterval(kontrolaSpiral, 1000); // Kontrola každú sekundu\n",
        "outputs": 2,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 490,
        "y": 1480,
        "wires": [
            [
                "8e1939a573be78e0",
                "e7c9fc8e9278124f"
            ],
            [
                "5fa8b5a05bd48d83"
            ]
        ]
    },
    {
        "id": "64ed8a4486002ff5",
        "type": "group",
        "z": "7bb4b982f37a1f91",
        "name": "voľba vyťažovania ovládanie v dashboarde",
        "style": {
            "label": true,
            "color": "#3f3f3f",
            "stroke": "#3f3f3f",
            "label-position": "n"
        },
        "nodes": [
            "bbd2e98c4e13adda",
            "bbf603013f5c4f82",
            "5eded41771b42501",
            "9866c1f1d3d76651"
        ],
        "x": 34,
        "y": 1239,
        "w": 392,
        "h": 142
    },
    {
        "id": "bbd2e98c4e13adda",
        "type": "ui_multistate_switch",
        "z": "7bb4b982f37a1f91",
        "g": "64ed8a4486002ff5",
        "name": "prepinac",
        "group": "d7e013c07cc5b346",
        "order": 2,
        "width": 0,
        "height": 1,
        "label": "Výber špirál",
        "stateField": "payload",
        "enableField": "enable",
        "passthroughField": "change",
        "inputMsgField": "inputmsg",
        "rounded": true,
        "useThemeColors": true,
        "hideSelectedLabel": false,
        "multilineLabel": false,
        "passThrough": "change",
        "inputMsg": "none",
        "userInput": "enabled_show",
        "options": [
            {
                "label": "vrch AN",
                "value": "hore",
                "valueType": "str",
                "color": "#009933"
            },
            {
                "label": "spodok AN",
                "value": "dolu",
                "valueType": "str",
                "color": "#999999"
            }
        ],
        "topic": "msg.payload",
        "x": 120,
        "y": 1340,
        "wires": [
            [
                "9866c1f1d3d76651"
            ]
        ]
    },
    {
        "id": "bbf603013f5c4f82",
        "type": "ui_multistate_switch",
        "z": "7bb4b982f37a1f91",
        "g": "64ed8a4486002ff5",
        "name": "vytazovanie",
        "group": "d7e013c07cc5b346",
        "order": 1,
        "width": 0,
        "height": 1,
        "label": "Vyťažovanie",
        "stateField": "payload",
        "enableField": "enable",
        "passthroughField": "passthrough",
        "inputMsgField": "inputmsg",
        "rounded": true,
        "useThemeColors": false,
        "hideSelectedLabel": false,
        "multilineLabel": false,
        "passThrough": "change",
        "inputMsg": "none",
        "userInput": "enabled_show",
        "options": [
            {
                "label": "Vypnuté",
                "value": "false",
                "valueType": "bool",
                "color": "#ff0019"
            },
            {
                "label": "Zapnuté",
                "value": "true",
                "valueType": "bool",
                "color": "#009900"
            }
        ],
        "topic": "msg.payload",
        "x": 130,
        "y": 1280,
        "wires": [
            [
                "5eded41771b42501"
            ]
        ]
    },
    {
        "id": "5eded41771b42501",
        "type": "function",
        "z": "7bb4b982f37a1f91",
        "g": "64ed8a4486002ff5",
        "name": "context-flow",
        "func": "// Change Node nastavenie\nmsg.topic = \"vytazovanie\";\nflow.set(\"vytazovanie\", msg.payload);\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 330,
        "y": 1280,
        "wires": [
            []
        ]
    },
    {
        "id": "9866c1f1d3d76651",
        "type": "function",
        "z": "7bb4b982f37a1f91",
        "g": "64ed8a4486002ff5",
        "name": "context-flow",
        "func": "// Change Node nastavenie\nmsg.topic = \"prepinac\";\nflow.set(\"prepinac\", msg.payload);\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 330,
        "y": 1340,
        "wires": [
            []
        ]
    },
    {
        "id": "d7e013c07cc5b346",
        "type": "ui_group",
        "name": "Voľba vyťažovania ",
        "tab": "f1fc31401dd012dd",
        "order": 4,
        "disp": true,
        "width": "6",
        "collapse": false,
        "className": ""
    },
    {
        "id": "f1fc31401dd012dd",
        "type": "ui_tab",
        "name": "Tab 2",
        "icon": "dashboard",
        "order": 2
    }
]

Guys, I still haven't progressed with my problem. I've already modified it a bit and now it still sends an OFF message to the output. I sent the whole flow to Tuna, but I don't know how to write the code so that it turns on the spirals one by one under those conditions.

Did you try what I sent you?
It doesn't look like that.
So I pull out again.
Have fun with your project.
Sorry I couldn't help you.

guys, I've already managed to find out where the problem was in my function node.. Here the function node is modified so that it only sends msg.payload "spiral1 1" or "spiral1 0" and so on to the output. I thank those who tried to help me and gave me their time. I'm sorry that I can't communicate better.

if (flow.get("vytazovanie") === true) {
    if (flow.get("spirala1") === 0 && flow.get("spirala2") === 0 && flow.get("spirala3") === 0 && msg.payload.bat > 1400 && msg.payload.soc > 80 && msg.payload.temperature < 80) {
        msg.payload = "spirala1 1";
        flow.set("spirala1", 1);
        return [msg, null];
    }
    if (flow.get("spirala1") === 1 && flow.get("spirala2") === 0 && flow.get("spirala3") === 0 && msg.payload.bat > 1400 && msg.payload.soc > 80 && msg.payload.temperature < 80) {
        msg.payload = "spirala2 1";
        flow.set("spirala2", 1);
        return [msg, null];
    }
    if (flow.get("spirala1") === 1 && flow.get("spirala2") === 1 && flow.get("spirala3") === 0 && msg.payload.bat > 1400 && msg.payload.soc > 80 && msg.payload.temperature < 80) {
        msg.payload = "spirala3 1";
        flow.set("spirala3", 1);
        return [msg, null];
    }
    if (msg.payload.bat < 30 && flow.get("spirala1") === 1 && flow.get("spirala2") === 1 && flow.get("spirala3") === 1) {
        msg.payload = "spirala3 0";
        flow.set("spirala3", 0);
        return [msg, null];
    }
    if (msg.payload.bat < 30 && flow.get("spirala1") === 1 && flow.get("spirala2") === 1 && flow.get("spirala3") === 0) {
        msg.payload = "spirala2 0";
        flow.set("spirala2", 0);
        return [msg, null];
    }
    if (msg.payload.bat < 30 && flow.get("spirala1") === 1 && flow.get("spirala2") === 0 && flow.get("spirala3") === 0) {
        msg.payload = "spirala1 0";
        flow.set("spirala1", 0);
        return [msg, null];
    }
    if ((msg.payload.bat < 30 || msg.payload.soc < 80 || msg.payload.temperature > 80)) {
        msg.payload = "OFF";
        flow.set("spirala1", 0);
        flow.set("spirala2", 0);
        flow.set("spirala3", 0);
        return [msg, null];
    }
} else {
    msg.payload = "OFF";
    return [null, msg];
}

if (flow.get("prepinac") === "hore") {
    return [msg, null];
} else {
    return [null, msg];
}

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.