[ { "id": "55f05aac.a8e654", "type": "http request", "z": "65678815.9f44b", "name": "Logon and Get Netio states", "method": "GET", "ret": "txt", "url": "http://{{{IP}}}/tgi/control.tgi?login=p:{{{USER}}}:{{{PASS}}}&p=list&quit=quit", "tls": "", "x": 500, "y": 120, "wires": [ [ "947147a6.5d09a", "14040ac5.0f0dfd", "fd797db.a19eb", "38d9d464.51c464" ] ] }, { "id": "c21a1141.a82bb8", "type": "inject", "z": "65678815.9f44b", "name": "", "topic": "", "payload": "", "payloadType": "str", "repeat": "60", "crontab": "", "once": true, "onceDelay": "5", "x": 90, "y": 120, "wires": [ [ "1b515d9f.9b3f3a" ] ] }, { "id": "947147a6.5d09a", "type": "function", "z": "65678815.9f44b", "name": "Process Netio1 state", "func": "if (msg.statusCode != 200) {\n node.warn(msg.payload);\n return;\n}\nvar Netio=msg.payload.slice(6,7);\nif (Netio == \"1\") {\n msg.payload=true;\n}\nelse if (Netio == \"0\") {\n msg.payload=false;\n}\nelse {\n node.warn(msg.payload);\n return;\n}\nreturn msg;", "outputs": 1, "noerr": 0, "x": 800, "y": 60, "wires": [ [ "33dae3d4.749754" ] ] }, { "id": "33dae3d4.749754", "type": "ioBroker out", "z": "65678815.9f44b", "name": "Netio1", "topic": "Netio1", "ack": "false", "autoCreate": "false", "x": 990, "y": 60, "wires": [] }, { "id": "6fbfdadb.56235c", "type": "ioBroker out", "z": "65678815.9f44b", "name": "Netio2", "topic": "Netio2", "ack": "false", "autoCreate": "false", "x": 990, "y": 100, "wires": [] }, { "id": "14040ac5.0f0dfd", "type": "function", "z": "65678815.9f44b", "name": "Process Netio2 state", "func": "if (msg.statusCode != 200) {\n node.warn(msg.payload);\n return;\n}\nvar Netio=msg.payload.slice(8,9);\nif (Netio == \"1\") {\n msg.payload=true;\n}\nelse if (Netio == \"0\") {\n msg.payload=false;\n}\nelse {\n node.warn(msg.payload);\n return;\n}\nreturn msg;", "outputs": 1, "noerr": 0, "x": 800, "y": 100, "wires": [ [ "6fbfdadb.56235c" ] ] }, { "id": "fd797db.a19eb", "type": "function", "z": "65678815.9f44b", "name": "Process Netio3 state", "func": "if (msg.statusCode != 200) {\n node.warn(msg.payload);\n return;\n}\nvar Netio=msg.payload.slice(10,11);\nif (Netio == \"1\") {\n msg.payload=true;\n}\nelse if (Netio == \"0\") {\n msg.payload=false;\n}\nelse {\n node.warn(msg.payload);\n return;\n}\nreturn msg;", "outputs": 1, "noerr": 0, "x": 800, "y": 140, "wires": [ [ "5c6f4d7b.69cbe4" ] ] }, { "id": "5c6f4d7b.69cbe4", "type": "ioBroker out", "z": "65678815.9f44b", "name": "Netio3", "topic": "Netio3", "ack": "false", "autoCreate": "false", "x": 990, "y": 140, "wires": [] }, { "id": "38d9d464.51c464", "type": "function", "z": "65678815.9f44b", "name": "Process Netio4 state", "func": "if (msg.statusCode != 200) {\n node.warn(msg.payload);\n return;\n}\nvar Netio=msg.payload.slice(12,13);\nif (Netio == \"1\") {\n msg.payload=true;\n}\nelse if (Netio == \"0\") {\n msg.payload=false;\n}\nelse {\n node.warn(msg.payload);\n return;\n}\nreturn msg;", "outputs": 1, "noerr": 0, "x": 800, "y": 180, "wires": [ [ "a143c011.362648" ] ] }, { "id": "a143c011.362648", "type": "ioBroker out", "z": "65678815.9f44b", "name": "Netio4", "topic": "Netio4", "ack": "false", "autoCreate": "false", "x": 990, "y": 180, "wires": [] }, { "id": "a31afd75.e39628", "type": "ioBroker in", "z": "65678815.9f44b", "name": "Netio4", "topic": "Netio4", "payloadType": "value", "onlyack": "", "func": "rbe", "gap": "", "x": 90, "y": 400, "wires": [ [ "6650acf8.1376c4" ] ] }, { "id": "abd48eab.8a1b4", "type": "http request", "z": "65678815.9f44b", "name": "change object state", "method": "GET", "ret": "txt", "url": "http://{{{IP}}}/tgi/control.tgi?login=p:{{{USER}}}:{{{PASS}}}&p=uuu{{payload}}&quit=quit", "tls": "", "x": 790, "y": 400, "wires": [ [] ] }, { "id": "44958a81.311e04", "type": "function", "z": "65678815.9f44b", "name": "Process Netio4 Object change", "func": "if (typeof msg.payload == 'string') {\n if (msg.payload === 'true') {\n msg.payload = \"1\";\n } else {\n msg.payload = \"0\";\n }\n} else {\n if (msg.payload === true) {\n msg.payload = \"1\";\n } else {\n msg.payload = \"0\";\n }\n}\nreturn msg;", "outputs": 1, "noerr": 0, "x": 510, "y": 400, "wires": [ [ "abd48eab.8a1b4" ] ] }, { "id": "c97c8ae1.c934d", "type": "ioBroker in", "z": "65678815.9f44b", "name": "Netio3", "topic": "Netio3", "payloadType": "value", "onlyack": "", "func": "rbe", "gap": "", "x": 90, "y": 360, "wires": [ [ "69337ebe.c64f4" ] ] }, { "id": "be7c410f.3a6e1", "type": "http request", "z": "65678815.9f44b", "name": "change object state", "method": "GET", "ret": "txt", "url": "http://{{{IP}}}/tgi/control.tgi?login=p:{{{USER}}}:{{{PASS}}}&p=uu{{payload}}u&quit=quit", "tls": "", "x": 790, "y": 360, "wires": [ [] ] }, { "id": "1e3f703.578821", "type": "function", "z": "65678815.9f44b", "name": "Process Netio3 Object change", "func": "if (typeof msg.payload == 'string') {\n if (msg.payload === 'true') {\n msg.payload = \"1\";\n } else {\n msg.payload = \"0\";\n }\n} else {\n if (msg.payload === true) {\n msg.payload = \"1\";\n } else {\n msg.payload = \"0\";\n }\n}\nreturn msg;", "outputs": 1, "noerr": 0, "x": 510, "y": 360, "wires": [ [ "be7c410f.3a6e1" ] ] }, { "id": "d4d5b54e.c974f8", "type": "ioBroker in", "z": "65678815.9f44b", "name": "Netio2", "topic": "Netio2", "payloadType": "value", "onlyack": "", "func": "rbe", "gap": "", "x": 90, "y": 320, "wires": [ [ "7b05870d.9ac1a" ] ] }, { "id": "e0fd93f9.c1237", "type": "http request", "z": "65678815.9f44b", "name": "change object state", "method": "GET", "ret": "txt", "url": "http://{{{IP}}}/tgi/control.tgi?login=p:{{{USER}}}:{{{PASS}}}&p=u{{payload}}uu&quit=quit", "tls": "", "x": 790, "y": 320, "wires": [ [] ] }, { "id": "23a7e13f.6524fe", "type": "function", "z": "65678815.9f44b", "name": "Process Netio2 Object change", "func": "if (typeof msg.payload == 'string') {\n if (msg.payload === 'true') {\n msg.payload = \"1\";\n } else {\n msg.payload = \"0\";\n }\n} else {\n if (msg.payload === true) {\n msg.payload = \"1\";\n } else {\n msg.payload = \"0\";\n }\n}\nreturn msg;", "outputs": 1, "noerr": 0, "x": 510, "y": 320, "wires": [ [ "e0fd93f9.c1237" ] ] }, { "id": "3ec27337.0bac6c", "type": "ioBroker in", "z": "65678815.9f44b", "name": "Netio1", "topic": "Netio1", "payloadType": "value", "onlyack": "", "func": "rbe", "gap": "", "x": 90, "y": 280, "wires": [ [ "35175c01.4dcc54" ] ] }, { "id": "7eb85412.7225ac", "type": "http request", "z": "65678815.9f44b", "name": "change object state", "method": "GET", "ret": "txt", "url": "http://{{{IP}}}/tgi/control.tgi?login=p:{{{USER}}}:{{{PASS}}}&p={{payload}}uuu&quit=quit", "tls": "", "x": 790, "y": 280, "wires": [ [] ] }, { "id": "a58a04e1.150d8", "type": "function", "z": "65678815.9f44b", "name": "Process Netio1 Object change", "func": "if (typeof msg.payload == 'string') {\n if (msg.payload === 'true') {\n msg.payload = \"1\";\n } else {\n msg.payload = \"0\";\n }\n} else {\n if (msg.payload === true) {\n msg.payload = \"1\";\n } else {\n msg.payload = \"0\";\n }\n}\nreturn msg;", "outputs": 1, "noerr": 0, "x": 510, "y": 280, "wires": [ [ "7eb85412.7225ac" ] ] }, { "id": "9a0da2d6.ebfe58", "type": "inject", "z": "65678815.9f44b", "name": "", "topic": "", "payload": "", "payloadType": "str", "repeat": "", "crontab": "", "once": true, "onceDelay": 0.1, "x": 90, "y": 60, "wires": [ [ "dabec3c.96d854" ] ] }, { "id": "dabec3c.96d854", "type": "function", "z": "65678815.9f44b", "name": "Set Variables", "func": "flow.set(\"NETIO_IP\",\"10.10.1.5\");\nflow.set(\"NETIO_USER\",\"admin\");\nflow.set(\"NETIO_PASS\",\"ver5dich\");\nreturn;", "outputs": 1, "noerr": 0, "x": 250, "y": 60, "wires": [ [] ] }, { "id": "1b515d9f.9b3f3a", "type": "function", "z": "65678815.9f44b", "name": "Get Variables", "func": "msg.IP = flow.get(\"NETIO_IP\");\nmsg.USER = flow.get(\"NETIO_USER\");\nmsg.PASS = flow.get(\"NETIO_PASS\");\nreturn msg;", "outputs": 1, "noerr": 0, "x": 260, "y": 120, "wires": [ [ "55f05aac.a8e654" ] ] }, { "id": "35175c01.4dcc54", "type": "function", "z": "65678815.9f44b", "name": "Get Variables", "func": "msg.IP = flow.get(\"NETIO_IP\");\nmsg.USER = flow.get(\"NETIO_USER\");\nmsg.PASS = flow.get(\"NETIO_PASS\");\nreturn msg;", "outputs": 1, "noerr": 0, "x": 260, "y": 280, "wires": [ [ "a58a04e1.150d8" ] ] }, { "id": "7b05870d.9ac1a", "type": "function", "z": "65678815.9f44b", "name": "Get Variables", "func": "msg.IP = flow.get(\"NETIO_IP\");\nmsg.USER = flow.get(\"NETIO_USER\");\nmsg.PASS = flow.get(\"NETIO_PASS\");\nreturn msg;", "outputs": 1, "noerr": 0, "x": 260, "y": 320, "wires": [ [ "23a7e13f.6524fe" ] ] }, { "id": "69337ebe.c64f4", "type": "function", "z": "65678815.9f44b", "name": "Get Variables", "func": "msg.IP = flow.get(\"NETIO_IP\");\nmsg.USER = flow.get(\"NETIO_USER\");\nmsg.PASS = flow.get(\"NETIO_PASS\");\nreturn msg;", "outputs": 1, "noerr": 0, "x": 260, "y": 360, "wires": [ [ "1e3f703.578821" ] ] }, { "id": "6650acf8.1376c4", "type": "function", "z": "65678815.9f44b", "name": "Get Variables", "func": "msg.IP = flow.get(\"NETIO_IP\");\nmsg.USER = flow.get(\"NETIO_USER\");\nmsg.PASS = flow.get(\"NETIO_PASS\");\nreturn msg;", "outputs": 1, "noerr": 0, "x": 260, "y": 400, "wires": [ [ "44958a81.311e04" ] ] } ]