[
    {
        "id": "f9e28c9cf87b10de",
        "type": "tab",
        "label": "Carlo Gavazzi EM24 Emulator",
        "disabled": false,
        "info": "# Emulador de Carlo Gavazzi EM24</h1>\n## [www.alferez.es](https://www.alferez.es/)\n\n## Configuración\n### IP De Shelly EM\nPara configurar todo, primero hay que\nespecificar la IP del Shelly.\n\nLo primero es Editar el Http Request y\nespecificar la IP de nuestro Shelly\npara que obtenga los datos correctamente.\n\n",
        "env": []
    },
    {
        "id": "d85ca744fbfe6e5e",
        "type": "modbus-server",
        "z": "f9e28c9cf87b10de",
        "name": "Zähler Wallbox 502",
        "logEnabled": true,
        "hostname": "192.168.170.101",
        "serverPort": "502",
        "responseDelay": 100,
        "delayUnit": "ms",
        "coilsBufferSize": "50000",
        "holdingBufferSize": "50000",
        "inputBufferSize": "50000",
        "discreteBufferSize": "50000",
        "showErrors": true,
        "x": 510,
        "y": 660,
        "wires": [
            [],
            [],
            [],
            [],
            []
        ]
    },
    {
        "id": "2b4b6dd6aa10fa59",
        "type": "comment",
        "z": "f9e28c9cf87b10de",
        "name": "Servidor Modbus Local",
        "info": "",
        "x": 120,
        "y": 120,
        "wires": []
    },
    {
        "id": "ef3777476848e255",
        "type": "comment",
        "z": "f9e28c9cf87b10de",
        "name": "Escribimos datos",
        "info": "Escribimos datos en el Servidor Node Red Local",
        "x": 740,
        "y": 720,
        "wires": []
    },
    {
        "id": "90bb79e977b6ca06",
        "type": "comment",
        "z": "f9e28c9cf87b10de",
        "name": "CONFIGURACIÓN",
        "info": "# Emulador de Carlo Gavazzi EM24</h1>\n## [www.alferez.es](https://www.alferez.es/)\n\n## Configuración\n### IP De Shelly EM\nPara configurar todo, primero hay que\nespecificar la IP del Shelly.\n\nLo primero es Editar el Http Request y\nespecificar la IP de nuestro Shelly\npara que obtenga los datos correctamente.\n\n",
        "x": 110,
        "y": 40,
        "wires": []
    },
    {
        "id": "5144969614df4fcb",
        "type": "inject",
        "z": "f9e28c9cf87b10de",
        "name": "Cada 5seg",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "5",
        "crontab": "",
        "once": true,
        "onceDelay": "5",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 110,
        "y": 860,
        "wires": [
            [
                "da12bd71a288bef5",
                "d3b9633eb916db2e",
                "d5ee6a83d356ca80",
                "f7c2b725c50da8ea",
                "f006808b128050d4",
                "38e8bbcade1c7b52",
                "e67a5777118a7f48",
                "e2737b712da619e9",
                "8a1f7a09e682ebbb"
            ]
        ]
    },
    {
        "id": "f2a00ecdc7885bae",
        "type": "comment",
        "z": "f9e28c9cf87b10de",
        "name": "Tomamos datos de Shelly cada 5 seg",
        "info": "",
        "x": 170,
        "y": 760,
        "wires": []
    },
    {
        "id": "357253f85a0b1480",
        "type": "modbus-write",
        "z": "f9e28c9cf87b10de",
        "name": "V L1",
        "showStatusActivities": true,
        "showErrors": false,
        "showWarnings": true,
        "unitid": "1",
        "dataType": "MHoldingRegisters",
        "adr": "0",
        "quantity": "2",
        "server": "866daf61d2f53247",
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 1150,
        "y": 1200,
        "wires": [
            [],
            []
        ]
    },
    {
        "id": "f1ba4bacd50b0d30",
        "type": "modbus-write",
        "z": "f9e28c9cf87b10de",
        "name": "A L1",
        "showStatusActivities": true,
        "showErrors": false,
        "showWarnings": true,
        "unitid": "1",
        "dataType": "MHoldingRegisters",
        "adr": "0x000C",
        "quantity": "2",
        "server": "866daf61d2f53247",
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 1150,
        "y": 1420,
        "wires": [
            [],
            []
        ]
    },
    {
        "id": "726cd7160ac15a5b",
        "type": "modbus-write",
        "z": "f9e28c9cf87b10de",
        "name": "W L1",
        "showStatusActivities": true,
        "showErrors": false,
        "showWarnings": true,
        "unitid": "1",
        "dataType": "MHoldingRegisters",
        "adr": "18",
        "quantity": "2",
        "server": "866daf61d2f53247",
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 1370,
        "y": 740,
        "wires": [
            [],
            []
        ]
    },
    {
        "id": "45ba44771f3b7960",
        "type": "function",
        "z": "f9e28c9cf87b10de",
        "name": "Set",
        "func": "// Para usarlo en el calculo de los Amps\nflow.set('volts1',msg.payload);\n\nvar volts=new Int32Array(2);\nvolts[0] = (msg.payload * 10).toFixed(1);\nmsg={};\nmsg.payload=volts;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 810,
        "y": 1200,
        "wires": [
            [
                "357253f85a0b1480"
            ]
        ]
    },
    {
        "id": "e39f83c0a9afb2d9",
        "type": "function",
        "z": "f9e28c9cf87b10de",
        "name": "Set",
        "func": "// Para usarlo en el calculo del sumatorio\nflow.set('watts1',msg.payload);\n\nvar watts=new Int32Array(2);\nwatts[0]=msg.payload.toFixed(0) * 10;\nif (watts[0] < 0 ) {\n    watts[0] = 65535 + watts[0];\n    watts[1] = 65535;\n}\nmsg={};\nmsg.payload=watts;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1110,
        "y": 740,
        "wires": [
            [
                "726cd7160ac15a5b"
            ]
        ]
    },
    {
        "id": "0bb77d9dcb3e2c18",
        "type": "modbus-write",
        "z": "f9e28c9cf87b10de",
        "name": "V L2",
        "showStatusActivities": true,
        "showErrors": false,
        "showWarnings": true,
        "unitid": "1",
        "dataType": "MHoldingRegisters",
        "adr": "0x0002",
        "quantity": "2",
        "server": "866daf61d2f53247",
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 1150,
        "y": 1260,
        "wires": [
            [],
            []
        ]
    },
    {
        "id": "f732f84cf8c95e80",
        "type": "modbus-write",
        "z": "f9e28c9cf87b10de",
        "name": "A L2",
        "showStatusActivities": true,
        "showErrors": false,
        "showWarnings": true,
        "unitid": "1",
        "dataType": "MHoldingRegisters",
        "adr": "0x000E",
        "quantity": "2",
        "server": "866daf61d2f53247",
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 1150,
        "y": 1480,
        "wires": [
            [],
            []
        ]
    },
    {
        "id": "c871b67cd93a4dae",
        "type": "modbus-write",
        "z": "f9e28c9cf87b10de",
        "name": "W L2",
        "showStatusActivities": true,
        "showErrors": false,
        "showWarnings": true,
        "unitid": "1",
        "dataType": "MHoldingRegisters",
        "adr": "0x0014",
        "quantity": "2",
        "server": "866daf61d2f53247",
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 1150,
        "y": 940,
        "wires": [
            [],
            []
        ]
    },
    {
        "id": "a6d1ff1ddb1ff686",
        "type": "function",
        "z": "f9e28c9cf87b10de",
        "name": "Set",
        "func": "// Para usarlo en el calculo de los Amps\nflow.set('volts2',msg.payload);\n\nvar volts=new Int32Array(2);\nvolts[0] = (msg.payload * 10).toFixed(1);\nmsg={};\nmsg.payload=volts;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 810,
        "y": 1260,
        "wires": [
            [
                "0bb77d9dcb3e2c18"
            ]
        ]
    },
    {
        "id": "77bf9e0a52e514da",
        "type": "function",
        "z": "f9e28c9cf87b10de",
        "name": "Set",
        "func": "// Para usarlo en el calculo de los Amps\nflow.set('amps2', msg.payload);\n\nvar amps = new Int32Array(2);\namps[0] = (msg.payload * 1000).toFixed(1);\nmsg = {};\nmsg.payload = amps;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 810,
        "y": 1480,
        "wires": [
            [
                "f732f84cf8c95e80"
            ]
        ]
    },
    {
        "id": "d7f09fa1e5fb4b47",
        "type": "function",
        "z": "f9e28c9cf87b10de",
        "name": "Set",
        "func": "// Para usarlo en el calculo del sumatorio\nflow.set('watts2',msg.payload);\n\nvar watts=new Int32Array(2);\nwatts[0]=msg.payload.toFixed(0) * 10;\nif (watts[0] < 0 ) {\n    watts[0] = 65535 + watts[0];\n    watts[1] = 65535;\n}\nmsg={};\nmsg.payload=watts;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 990,
        "y": 940,
        "wires": [
            [
                "c871b67cd93a4dae"
            ]
        ]
    },
    {
        "id": "9469e19eb6011e9f",
        "type": "modbus-write",
        "z": "f9e28c9cf87b10de",
        "name": "V L3",
        "showStatusActivities": true,
        "showErrors": false,
        "showWarnings": true,
        "unitid": "1",
        "dataType": "MHoldingRegisters",
        "adr": "0x0004",
        "quantity": "2",
        "server": "866daf61d2f53247",
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 1150,
        "y": 1320,
        "wires": [
            [],
            []
        ]
    },
    {
        "id": "b01d0ff5d7fdb1bb",
        "type": "modbus-write",
        "z": "f9e28c9cf87b10de",
        "name": "A L3",
        "showStatusActivities": true,
        "showErrors": false,
        "showWarnings": true,
        "unitid": "1",
        "dataType": "MHoldingRegisters",
        "adr": "0x0010",
        "quantity": "2",
        "server": "866daf61d2f53247",
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 1150,
        "y": 1540,
        "wires": [
            [],
            []
        ]
    },
    {
        "id": "989321cef997cfbf",
        "type": "modbus-write",
        "z": "f9e28c9cf87b10de",
        "name": "W L3",
        "showStatusActivities": true,
        "showErrors": false,
        "showWarnings": true,
        "unitid": "1",
        "dataType": "MHoldingRegisters",
        "adr": "0x0016",
        "quantity": "2",
        "server": "866daf61d2f53247",
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 1150,
        "y": 1060,
        "wires": [
            [],
            [
                "e36f090eabbf2753"
            ]
        ]
    },
    {
        "id": "8de4fd13347b532c",
        "type": "function",
        "z": "f9e28c9cf87b10de",
        "name": "Set",
        "func": "// Para usarlo en el calculo de los Amps\nflow.set('volts3',msg.payload);\n\nvar volts=new Int32Array(2);\nvolts[0] = (msg.payload * 10).toFixed(1);\nmsg={};\nmsg.payload=volts;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 810,
        "y": 1320,
        "wires": [
            [
                "9469e19eb6011e9f"
            ]
        ]
    },
    {
        "id": "dbaf70c0429a6671",
        "type": "function",
        "z": "f9e28c9cf87b10de",
        "name": "Set",
        "func": "// Para usarlo en el calculo del sumatorio\nflow.set('watts3',msg.payload);\n\nvar watts=new Int32Array(2);\nwatts[0]=msg.payload.toFixed(0) * 10;\nif (watts[0] < 0 ) {\n    watts[0] = 65535 + watts[0];\n    watts[1] = 65535;\n}\nmsg={};\nmsg.payload=watts;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 990,
        "y": 1060,
        "wires": [
            [
                "989321cef997cfbf"
            ]
        ]
    },
    {
        "id": "e36f090eabbf2753",
        "type": "function",
        "z": "f9e28c9cf87b10de",
        "name": "Sum",
        "func": "var watts1=flow.get('watts1');\nvar watts2=flow.get('watts2');\nvar watts3=flow.get('watts3');\nvar watts = new Int32Array(2);\n\nwatts[0]=(watts1.toFixed(0) * 10 ) + (watts2.toFixed(0) * 10) + (watts3.toFixed(0) * 10);\nif (watts[0] < 0 ) {\n    watts[0] = 65535 + watts[0];\n    watts[1] = 65535;\n}\nmsg = {payload: watts};\n\nreturn msg;",
        "outputs": 2,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1370,
        "y": 1060,
        "wires": [
            [
                "6ae219f0a7358252"
            ],
            []
        ]
    },
    {
        "id": "6ae219f0a7358252",
        "type": "modbus-write",
        "z": "f9e28c9cf87b10de",
        "name": "Sum Watts",
        "showStatusActivities": true,
        "showErrors": false,
        "showWarnings": true,
        "unitid": "1",
        "dataType": "MHoldingRegisters",
        "adr": "40",
        "quantity": "2",
        "server": "866daf61d2f53247",
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 1590,
        "y": 1060,
        "wires": [
            [],
            []
        ]
    },
    {
        "id": "2fb89b6c5276c576",
        "type": "function",
        "z": "f9e28c9cf87b10de",
        "name": "Set",
        "func": "// Para usarlo en el calculo del sumatorio\n//flow.set('twatts1',msg.payload);\n\nvar twatts=new Int32Array(2);\nvar valor = (parseInt(msg.payload / 100)).toString(2).padStart(32, '0');\n\nvar twatts = new Int32Array(2);\ntwatts[0] = parseInt(valor.substring(16, 32), 2);\ntwatts[1] = parseInt(valor.substring(0, 16), 2);\n\nmsg = { payload: twatts};\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1110,
        "y": 780,
        "wires": [
            [
                "f0e7d6179e37722c"
            ]
        ]
    },
    {
        "id": "f0e7d6179e37722c",
        "type": "modbus-write",
        "z": "f9e28c9cf87b10de",
        "name": "Total W Energia L1",
        "showStatusActivities": true,
        "showErrors": false,
        "showWarnings": true,
        "unitid": "1",
        "dataType": "MHoldingRegisters",
        "adr": "64",
        "quantity": "2",
        "server": "866daf61d2f53247",
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 1410,
        "y": 780,
        "wires": [
            [],
            []
        ]
    },
    {
        "id": "f6d5913e5b967ed5",
        "type": "function",
        "z": "f9e28c9cf87b10de",
        "name": "Set",
        "func": "// Para usarlo en el calculo del sumatorio\nflow.set('twatts2',msg.payload);\n\nvar twatts=new Int32Array(2);\ntwatts[0] = (msg.payload * 10).toFixed(0);\ntwatts[1] = 0;\nmsg={};\nmsg.payload=twatts;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 990,
        "y": 1000,
        "wires": [
            [
                "d95420a974d4a870"
            ]
        ]
    },
    {
        "id": "d95420a974d4a870",
        "type": "modbus-write",
        "z": "f9e28c9cf87b10de",
        "name": "Total W L2",
        "showStatusActivities": true,
        "showErrors": false,
        "unitid": "1",
        "dataType": "MHoldingRegisters",
        "adr": "0x0042",
        "quantity": "2",
        "server": "866daf61d2f53247",
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 1170,
        "y": 1000,
        "wires": [
            [],
            []
        ]
    },
    {
        "id": "ed4935e8dd804b32",
        "type": "function",
        "z": "f9e28c9cf87b10de",
        "name": "Set",
        "func": "// Para usarlo en el calculo del sumatorio\nflow.set('twatts3',msg.payload);\n\nvar twatts=new Int32Array(2);\ntwatts[0] = (msg.payload * 10).toFixed(0);\ntwatts[1] = 0;\nmsg={};\nmsg.payload=twatts;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 990,
        "y": 1120,
        "wires": [
            [
                "cec58ed8e2357f6c"
            ]
        ]
    },
    {
        "id": "cec58ed8e2357f6c",
        "type": "modbus-write",
        "z": "f9e28c9cf87b10de",
        "name": "Total W L3",
        "showStatusActivities": true,
        "showErrors": false,
        "unitid": "1",
        "dataType": "MHoldingRegisters",
        "adr": "0x0044",
        "quantity": "2",
        "server": "866daf61d2f53247",
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 1170,
        "y": 1120,
        "wires": [
            [],
            []
        ]
    },
    {
        "id": "da12bd71a288bef5",
        "type": "ioBroker get",
        "z": "f9e28c9cf87b10de",
        "name": "Hausanschluss_L1_Leistung",
        "topic": "hm-rega.0.28633",
        "attrname": "payload",
        "payloadType": "value",
        "errOnInvalidState": "nothing",
        "x": 480,
        "y": 820,
        "wires": [
            [
                "48e7ed7b6861dcd8",
                "b06d7b007aaab749",
                "1ce212f0c79db925",
                "ab1234a45e0a8774"
            ]
        ]
    },
    {
        "id": "d3b9633eb916db2e",
        "type": "ioBroker get",
        "z": "f9e28c9cf87b10de",
        "name": "Hausanschluss_L2_Leistung",
        "topic": "hm-rega.0.28634",
        "attrname": "payload",
        "payloadType": "value",
        "errOnInvalidState": "nothing",
        "x": 480,
        "y": 940,
        "wires": [
            [
                "be40508b6446758d",
                "e825cf7e813c968f"
            ]
        ]
    },
    {
        "id": "d5ee6a83d356ca80",
        "type": "ioBroker get",
        "z": "f9e28c9cf87b10de",
        "name": "Hausanschluss_L3_Leistung",
        "topic": "hm-rega.0.28635",
        "attrname": "payload",
        "payloadType": "value",
        "errOnInvalidState": "nothing",
        "x": 480,
        "y": 1060,
        "wires": [
            [
                "22cce512d3b2647d",
                "336a68b856c72ad5"
            ]
        ]
    },
    {
        "id": "f7c2b725c50da8ea",
        "type": "ioBroker get",
        "z": "f9e28c9cf87b10de",
        "name": "Hausanschluss_L1_Spannung",
        "topic": "hm-rega.0.27680",
        "attrname": "payload",
        "payloadType": "value",
        "errOnInvalidState": "nothing",
        "x": 490,
        "y": 1200,
        "wires": [
            [
                "45ba44771f3b7960"
            ]
        ]
    },
    {
        "id": "f006808b128050d4",
        "type": "ioBroker get",
        "z": "f9e28c9cf87b10de",
        "name": "Hausanschluss_L2_Spannung",
        "topic": "hm-rega.0.27681",
        "attrname": "payload",
        "payloadType": "value",
        "errOnInvalidState": "nothing",
        "x": 490,
        "y": 1260,
        "wires": [
            [
                "a6d1ff1ddb1ff686"
            ]
        ]
    },
    {
        "id": "38e8bbcade1c7b52",
        "type": "ioBroker get",
        "z": "f9e28c9cf87b10de",
        "name": "Hausanschluss_L3_Spannung",
        "topic": "hm-rega.0.27682",
        "attrname": "payload",
        "payloadType": "value",
        "errOnInvalidState": "nothing",
        "x": 490,
        "y": 1320,
        "wires": [
            [
                "8de4fd13347b532c"
            ]
        ]
    },
    {
        "id": "e67a5777118a7f48",
        "type": "ioBroker get",
        "z": "f9e28c9cf87b10de",
        "name": "Hausanschluss_L1_Strom",
        "topic": "hm-rega.0.28488",
        "attrname": "payload",
        "payloadType": "value",
        "errOnInvalidState": "nothing",
        "x": 470,
        "y": 1420,
        "wires": [
            [
                "7d5ed3eec5a6f49b"
            ]
        ]
    },
    {
        "id": "e2737b712da619e9",
        "type": "ioBroker get",
        "z": "f9e28c9cf87b10de",
        "name": "Hausanschluss_L2_Strom",
        "topic": "hm-rega.0.28489",
        "attrname": "payload",
        "payloadType": "value",
        "errOnInvalidState": "nothing",
        "x": 470,
        "y": 1480,
        "wires": [
            [
                "77bf9e0a52e514da"
            ]
        ]
    },
    {
        "id": "8a1f7a09e682ebbb",
        "type": "ioBroker get",
        "z": "f9e28c9cf87b10de",
        "name": "Hausanschluss_L3_Strom",
        "topic": "hm-rega.0.28490",
        "attrname": "payload",
        "payloadType": "value",
        "errOnInvalidState": "nothing",
        "x": 470,
        "y": 1540,
        "wires": [
            [
                "a1d8e8a15e2c8b36"
            ]
        ]
    },
    {
        "id": "7d5ed3eec5a6f49b",
        "type": "function",
        "z": "f9e28c9cf87b10de",
        "name": "Set",
        "func": "// Para usarlo en el calculo de los Amps\nflow.set('amps1',msg.payload);\n\nvar amps=new Int32Array(2);\namps[0] = (msg.payload * 1000).toFixed(1);\nmsg={};\nmsg.payload=amps;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 810,
        "y": 1420,
        "wires": [
            [
                "f1ba4bacd50b0d30"
            ]
        ]
    },
    {
        "id": "a1d8e8a15e2c8b36",
        "type": "function",
        "z": "f9e28c9cf87b10de",
        "name": "Set",
        "func": "// Para usarlo en el calculo de los Amps\nflow.set('amps3', msg.payload);\n\nvar amps = new Int32Array(2);\namps[0] = (msg.payload * 1000).toFixed(1);\nmsg = {};\nmsg.payload = amps;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 810,
        "y": 1540,
        "wires": [
            [
                "b01d0ff5d7fdb1bb"
            ]
        ]
    },
    {
        "id": "7d11db7b00d54855",
        "type": "comment",
        "z": "f9e28c9cf87b10de",
        "name": "Inicializamos al arrancar",
        "info": "",
        "x": 130,
        "y": 220,
        "wires": []
    },
    {
        "id": "f232b0e3864ad187",
        "type": "inject",
        "z": "f9e28c9cf87b10de",
        "name": "Inicializar",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": "10",
        "topic": "",
        "payloadType": "date",
        "x": 320,
        "y": 260,
        "wires": [
            [
                "eb42043ba8794be0"
            ]
        ]
    },
    {
        "id": "ad19ee6e1b2b9c99",
        "type": "modbus-write",
        "z": "f9e28c9cf87b10de",
        "name": "Modelo",
        "showStatusActivities": true,
        "showErrors": true,
        "unitid": "1",
        "dataType": "HoldingRegister",
        "adr": "11",
        "quantity": "1",
        "server": "866daf61d2f53247",
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 700,
        "y": 160,
        "wires": [
            [],
            []
        ]
    },
    {
        "id": "ce5f9aa72c6c4d0e",
        "type": "modbus-write",
        "z": "f9e28c9cf87b10de",
        "name": "HW Version",
        "showStatusActivities": true,
        "showErrors": true,
        "unitid": "1",
        "dataType": "HoldingRegister",
        "adr": "777",
        "quantity": "1",
        "server": "866daf61d2f53247",
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 710,
        "y": 200,
        "wires": [
            [],
            []
        ]
    },
    {
        "id": "78815d56e051e3cc",
        "type": "modbus-write",
        "z": "f9e28c9cf87b10de",
        "name": "FW Version",
        "showStatusActivities": true,
        "showErrors": true,
        "unitid": "1",
        "dataType": "HoldingRegister",
        "adr": "772",
        "quantity": "1",
        "server": "866daf61d2f53247",
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 710,
        "y": 240,
        "wires": [
            [],
            []
        ]
    },
    {
        "id": "198a6465eb033dbe",
        "type": "modbus-write",
        "z": "f9e28c9cf87b10de",
        "name": "PH Config",
        "showStatusActivities": true,
        "showErrors": true,
        "unitid": "1",
        "dataType": "HoldingRegister",
        "adr": "4098",
        "quantity": "1",
        "server": "866daf61d2f53247",
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 710,
        "y": 280,
        "wires": [
            [],
            []
        ]
    },
    {
        "id": "caf897d25cd3dcc5",
        "type": "modbus-write",
        "z": "f9e28c9cf87b10de",
        "name": "Serial",
        "showStatusActivities": true,
        "showErrors": true,
        "unitid": "1",
        "dataType": "MHoldingRegisters",
        "adr": "20480",
        "quantity": "7",
        "server": "866daf61d2f53247",
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 690,
        "y": 320,
        "wires": [
            [],
            []
        ]
    },
    {
        "id": "e3b112ed6ea41956",
        "type": "modbus-write",
        "z": "f9e28c9cf87b10de",
        "name": "ShitchPos",
        "showStatusActivities": true,
        "showErrors": true,
        "unitid": "1",
        "dataType": "HoldingRegister",
        "adr": "41216",
        "quantity": "1",
        "server": "866daf61d2f53247",
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 700,
        "y": 360,
        "wires": [
            [],
            []
        ]
    },
    {
        "id": "eb42043ba8794be0",
        "type": "function",
        "z": "f9e28c9cf87b10de",
        "name": "Definiciones",
        "func": "var data1 = { payload: 1648 };\nvar data2 = { payload: 0x101E };\nvar data3 = { payload: 3 };\nvar data4 = { payload: [22359,22320,16716,17989,21061,23088,17747]};\nvar data5 = { payload: 0x1 };\nvar data6 = { paload: 7 }\nreturn [data1, data2, data3, data4, data5, data6];",
        "outputs": 6,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 470,
        "y": 260,
        "wires": [
            [
                "ad19ee6e1b2b9c99"
            ],
            [
                "ce5f9aa72c6c4d0e",
                "78815d56e051e3cc"
            ],
            [
                "198a6465eb033dbe"
            ],
            [
                "caf897d25cd3dcc5"
            ],
            [
                "e3b112ed6ea41956"
            ],
            [
                "0f20e509b80dc879"
            ]
        ]
    },
    {
        "id": "0f20e509b80dc879",
        "type": "modbus-write",
        "z": "f9e28c9cf87b10de",
        "name": "Aplication",
        "showStatusActivities": true,
        "showErrors": true,
        "unitid": "1",
        "dataType": "MCoils",
        "adr": "40960",
        "quantity": "1",
        "server": "866daf61d2f53247",
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 700,
        "y": 400,
        "wires": [
            [],
            []
        ]
    },
    {
        "id": "48e7ed7b6861dcd8",
        "type": "change",
        "z": "f9e28c9cf87b10de",
        "name": "Watt => Kilowatt",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "payload / 1000",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 890,
        "y": 780,
        "wires": [
            [
                "2fb89b6c5276c576"
            ]
        ]
    },
    {
        "id": "ef90c94a09aa51df",
        "type": "buffer-maker",
        "z": "f9e28c9cf87b10de",
        "name": "",
        "specification": "spec",
        "specificationType": "ui",
        "items": [
            {
                "name": "item1",
                "type": "floatbe",
                "length": 1,
                "dataType": "msg",
                "data": "payload"
            }
        ],
        "swap1": "",
        "swap2": "",
        "swap3": "",
        "swap1Type": "swap",
        "swap2Type": "swap",
        "swap3Type": "swap",
        "msgProperty": "payload",
        "msgPropertyType": "str",
        "x": 1010,
        "y": 820,
        "wires": [
            [
                "64099d52a0a6f579",
                "364501a42aeddf1a"
            ]
        ]
    },
    {
        "id": "64099d52a0a6f579",
        "type": "buffer-parser",
        "z": "f9e28c9cf87b10de",
        "name": "",
        "data": "payload",
        "dataType": "msg",
        "specification": "spec",
        "specificationType": "ui",
        "items": [
            {
                "type": "uint16be",
                "name": "item1",
                "offset": 0,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "uint16be",
                "name": "item2",
                "offset": 2,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            }
        ],
        "swap1": "",
        "swap2": "",
        "swap3": "",
        "swap1Type": "swap",
        "swap2Type": "swap",
        "swap3Type": "swap",
        "msgProperty": "payload",
        "msgPropertyType": "str",
        "resultType": "value",
        "resultTypeType": "return",
        "multipleResult": false,
        "fanOutMultipleResult": false,
        "setTopic": true,
        "outputs": 1,
        "x": 1190,
        "y": 820,
        "wires": [
            [
                "6936fa4769127b7a"
            ]
        ]
    },
    {
        "id": "b06d7b007aaab749",
        "type": "change",
        "z": "f9e28c9cf87b10de",
        "name": "Watt => Kilowatt",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "payload / 1000",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 890,
        "y": 740,
        "wires": [
            [
                "e39f83c0a9afb2d9"
            ]
        ]
    },
    {
        "id": "be40508b6446758d",
        "type": "change",
        "z": "f9e28c9cf87b10de",
        "name": "Watt => Kilowatt",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "payload / 1000",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 810,
        "y": 940,
        "wires": [
            [
                "d7f09fa1e5fb4b47"
            ]
        ]
    },
    {
        "id": "e825cf7e813c968f",
        "type": "change",
        "z": "f9e28c9cf87b10de",
        "name": "Watt => Kilowatt",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "payload / 1000",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 810,
        "y": 1000,
        "wires": [
            [
                "f6d5913e5b967ed5"
            ]
        ]
    },
    {
        "id": "22cce512d3b2647d",
        "type": "change",
        "z": "f9e28c9cf87b10de",
        "name": "Watt => Kilowatt",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "payload / 1000",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 810,
        "y": 1060,
        "wires": [
            [
                "dbaf70c0429a6671"
            ]
        ]
    },
    {
        "id": "336a68b856c72ad5",
        "type": "change",
        "z": "f9e28c9cf87b10de",
        "name": "Watt => Kilowatt",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "payload / 1000",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 810,
        "y": 1120,
        "wires": [
            [
                "ed4935e8dd804b32"
            ]
        ]
    },
    {
        "id": "6936fa4769127b7a",
        "type": "debug",
        "z": "f9e28c9cf87b10de",
        "name": "debug 1",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 1420,
        "y": 880,
        "wires": []
    },
    {
        "id": "1ce212f0c79db925",
        "type": "change",
        "z": "f9e28c9cf87b10de",
        "name": "Watt => Kilowatt",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "payload / 1000",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 810,
        "y": 820,
        "wires": [
            [
                "ef90c94a09aa51df",
                "c0435f080e3937a1"
            ]
        ]
    },
    {
        "id": "364501a42aeddf1a",
        "type": "debug",
        "z": "f9e28c9cf87b10de",
        "name": "debug 2",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 1200,
        "y": 880,
        "wires": []
    },
    {
        "id": "c0435f080e3937a1",
        "type": "debug",
        "z": "f9e28c9cf87b10de",
        "name": "debug 3",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 1000,
        "y": 880,
        "wires": []
    },
    {
        "id": "ab1234a45e0a8774",
        "type": "debug",
        "z": "f9e28c9cf87b10de",
        "name": "debug 4",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 780,
        "y": 880,
        "wires": []
    },
    {
        "id": "866daf61d2f53247",
        "type": "modbus-client",
        "name": "Wallbox",
        "clienttype": "tcp",
        "bufferCommands": true,
        "stateLogEnabled": true,
        "queueLogEnabled": true,
        "failureLogEnabled": false,
        "tcpHost": "192.168.170.101",
        "tcpPort": "502",
        "tcpType": "DEFAULT",
        "serialPort": "/dev/ttyUSB",
        "serialType": "RTU-BUFFERD",
        "serialBaudrate": "9600",
        "serialDatabits": "8",
        "serialStopbits": "1",
        "serialParity": "none",
        "serialConnectionDelay": "100",
        "serialAsciiResponseStartDelimiter": "0x3A",
        "unit_id": "1",
        "commandDelay": "1",
        "clientTimeout": "1000",
        "reconnectOnTimeout": true,
        "reconnectTimeout": "2000",
        "parallelUnitIdsAllowed": true
    }
]
 
[/s]