[
  {
    "id": "92c9cabb.72c3",
    "type": "tab",
    "label": "SDM630 Modbus Gateway",
    "disabled": false,
    "info": ""
  },
  {
    "id": "e9b3f9a0.9c6d5",
    "type": "tab",
    "label": "SDM630 dynamic",
    "disabled": false,
    "info": ""
  },
  {
    "id": "b56de45f.f8861",
    "type": "tab",
    "label": "SDM630 static",
    "disabled": false,
    "info": ""
  },
  {
    "id": "1bf9637b.fcaa35",
    "type": "subflow",
    "name": "OPC UA Server",
    "info": "",
    "in": [
      {
        "x": 80,
        "y": 80,
        "wires": [
          {
            "id": "e4e75ba4.092028"
          }
        ]
      }
    ],
    "out": []
  },
  {
    "id": "d8dd83e7.2d5f98",
    "type": "subflow",
    "name": "Model",
    "info": "",
    "in": [],
    "out": [
      {
        "x": 680,
        "y": 390,
        "wires": [
          {
            "id": "a7cefbfd.53b2",
            "port": 0
          },
          {
            "id": "c6bf3d0e.e38538",
            "port": 0
          },
          {
            "id": "f88e90ab.8cb848",
            "port": 0
          },
          {
            "id": "348011f5.f6759e",
            "port": 0
          },
          {
            "id": "1c0f75c1.99bb7a",
            "port": 0
          },
          {
            "id": "115b7b7.75b3505",
            "port": 0
          },
          {
            "id": "7ce1e8d5.d29d68",
            "port": 0
          },
          {
            "id": "79fb8a18.976f6c",
            "port": 0
          },
          {
            "id": "4e1488bd.803378",
            "port": 0
          },
          {
            "id": "2c8e91fa.0847b6",
            "port": 0
          },
          {
            "id": "4f65c288.11ea74",
            "port": 0
          },
          {
            "id": "79d04a44.09951c",
            "port": 0
          },
          {
            "id": "84f5ed8d.c9c588",
            "port": 0
          },
          {
            "id": "837a8aed.befcc",
            "port": 0
          },
          {
            "id": "29410f9b.053928",
            "port": 0
          },
          {
            "id": "c2b3053.5c4c278",
            "port": 0
          },
          {
            "id": "9edf10da.3a47b",
            "port": 0
          },
          {
            "id": "f8232b11.c51bc8",
            "port": 0
          },
          {
            "id": "e7f8f825.d9ade8",
            "port": 0
          }
        ]
      }
    ]
  },
  {
    "id": "8cae93d.3604d7",
    "type": "subflow",
    "name": "SDM630 charts",
    "info": "",
    "in": [
      {
        "x": 170,
        "y": 360,
        "wires": [
          {
            "id": "96a05c7.bfd24a"
          },
          {
            "id": "307d37f1.a25678"
          },
          {
            "id": "18da947e.d6390c"
          },
          {
            "id": "3f35ad83.d9b902"
          },
          {
            "id": "5fbc5bf0.76f724"
          },
          {
            "id": "7c75c56a.88d7ec"
          },
          {
            "id": "961ac2c1.169ce"
          },
          {
            "id": "94f79c36.9194e"
          },
          {
            "id": "d5f99c3e.1a0ea"
          },
          {
            "id": "69b05811.286528"
          },
          {
            "id": "5634635c.5d136c"
          }
        ]
      }
    ],
    "out": [
      {
        "x": 680,
        "y": 100,
        "wires": [
          {
            "id": "96a05c7.bfd24a",
            "port": 0
          },
          {
            "id": "307d37f1.a25678",
            "port": 0
          },
          {
            "id": "18da947e.d6390c",
            "port": 0
          },
          {
            "id": "3f35ad83.d9b902",
            "port": 0
          }
        ]
      },
      {
        "x": 680,
        "y": 320,
        "wires": [
          {
            "id": "5fbc5bf0.76f724",
            "port": 0
          },
          {
            "id": "7c75c56a.88d7ec",
            "port": 0
          },
          {
            "id": "961ac2c1.169ce",
            "port": 0
          }
        ]
      },
      {
        "x": 680,
        "y": 480,
        "wires": [
          {
            "id": "94f79c36.9194e",
            "port": 0
          },
          {
            "id": "d5f99c3e.1a0ea",
            "port": 0
          },
          {
            "id": "69b05811.286528",
            "port": 0
          },
          {
            "id": "5634635c.5d136c",
            "port": 0
          }
        ]
      }
    ]
  },
  {
    "id": "8321718e.e9d488",
    "type": "subflow",
    "name": "static charts",
    "info": "",
    "in": [
      {
        "x": 280,
        "y": 220,
        "wires": [
          {
            "id": "11e8206f.21eb3"
          },
          {
            "id": "435f152c.3cd86c"
          },
          {
            "id": "b2db30fd.35c41"
          },
          {
            "id": "d228a3a.44ff56"
          }
        ]
      }
    ],
    "out": [
      {
        "x": 780,
        "y": 80,
        "wires": [
          {
            "id": "11e8206f.21eb3",
            "port": 0
          },
          {
            "id": "435f152c.3cd86c",
            "port": 0
          },
          {
            "id": "b2db30fd.35c41",
            "port": 0
          },
          {
            "id": "d228a3a.44ff56",
            "port": 0
          }
        ]
      }
    ]
  },
  {
    "id": "2a101dfb.122152",
    "type": "ui_base",
    "z": "",
    "theme": {
      "name": "theme-dark",
      "lightTheme": {
        "default": "#0094CE",
        "baseColor": "#0094CE",
        "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif",
        "edited": true,
        "reset": false
      },
      "darkTheme": {
        "default": "#097479",
        "baseColor": "#097479",
        "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif",
        "edited": true,
        "reset": false
      },
      "customTheme": {
        "name": "Untitled Theme 1",
        "default": "#4B7930",
        "baseColor": "#4B7930",
        "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"
      },
      "themeState": {
        "base-color": {
          "default": "#097479",
          "value": "#097479",
          "edited": false
        },
        "page-titlebar-backgroundColor": {
          "value": "#097479",
          "edited": false
        },
        "page-backgroundColor": {
          "value": "#111111",
          "edited": false
        },
        "page-sidebar-backgroundColor": {
          "value": "#000000",
          "edited": false
        },
        "group-textColor": {
          "value": "#0eb8c0",
          "edited": false
        },
        "group-borderColor": {
          "value": "#555555",
          "edited": false
        },
        "group-backgroundColor": {
          "value": "#333333",
          "edited": false
        },
        "widget-textColor": {
          "value": "#eeeeee",
          "edited": false
        },
        "widget-backgroundColor": {
          "value": "#097479",
          "edited": false
        },
        "widget-borderColor": {
          "value": "#333333",
          "edited": false
        },
        "base-font": {
          "value": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"
        }
      }
    },
    "site": {
      "name": "Node-RED Dashboard",
      "hideToolbar": "false",
      "allowSwipe": "false",
      "dateFormat": "DD/MM/YYYY",
      "sizes": {
        "sx": 48,
        "sy": 48,
        "gx": 6,
        "gy": 6,
        "cx": 6,
        "cy": 6,
        "px": 0,
        "py": 0
      }
    }
  },
  {
    "id": "1707cb53.3e54ad",
    "type": "OPCUA-IIoT-Connector",
    "z": "e9b3f9a0.9c6d5",
    "discoveryUrl": "",
    "endpoint": "opc.tcp://localhost:55388/",
    "keepSessionAlive": true,
    "loginEnabled": false,
    "securityPolicy": "Basic256",
    "securityMode": "SignAndEncrypt",
    "name": "Dynamic Connector",
    "showStatusActivities": false,
    "showErrors": false,
    "publicCertificateFile": "",
    "privateKeyFile": "",
    "defaultSecureTokenLifetime": "",
    "endpointMustExist": false,
    "autoSelectRightEndpoint": false
  },
  {
    "id": "d730fe1b.be9188",
    "type": "ui_tab",
    "z": "e9b3f9a0.9c6d5",
    "name": "smartHome Energy",
    "icon": "dashboard",
    "order": 1
  },
  {
    "id": "a7d889b8.8d4638",
    "type": "ui_tab",
    "z": "b56de45f.f8861",
    "name": "smartHouse",
    "icon": "dashboard",
    "order": 3
  },
  {
    "id": "82a80892.06eb38",
    "type": "ui_group",
    "z": "e9b3f9a0.9c6d5",
    "name": "Dynamic",
    "tab": "d730fe1b.be9188",
    "disp": true,
    "width": "30"
  },
  {
    "id": "f4f863e1.12067",
    "type": "ui_group",
    "z": "b56de45f.f8861",
    "name": "Static",
    "tab": "a7d889b8.8d4638",
    "order": 2,
    "disp": true,
    "width": "6"
  },
  {
    "id": "27cb7a6b.f6dd86",
    "type": "OPCUA-IIoT-Connector",
    "z": "b56de45f.f8861",
    "discoveryUrl": "",
    "endpoint": "opc.tcp://localhost:55388/",
    "keepSessionAlive": true,
    "loginEnabled": false,
    "securityPolicy": "Basic256",
    "securityMode": "Sign",
    "name": "Static Connector",
    "showStatusActivities": false,
    "showErrors": false,
    "publicCertificateFile": "",
    "privateKeyFile": "",
    "defaultSecureTokenLifetime": "",
    "endpointMustExist": false,
    "autoSelectRightEndpoint": false
  },
  {
    "id": "3bb47cc7.2bd524",
    "type": "ui_group",
    "z": "",
    "name": "Model",
    "tab": "8c1d90ba.dbd978",
    "order": 2,
    "disp": true,
    "width": "8"
  },
  {
    "id": "8c1d90ba.dbd978",
    "type": "ui_tab",
    "z": "",
    "name": "OPC UA",
    "icon": "dashboard"
  },
  {
    "id": "ede6d7ce.0d092",
    "type": "ui_group",
    "z": "",
    "name": "Browser",
    "tab": "8c1d90ba.dbd978",
    "order": 1,
    "disp": true,
    "width": "20"
  },
  {
    "id": "c6cb2fc5.8d8718",
    "type": "modbus-client",
    "z": "92c9cabb.72c3",
    "name": "SDM630 Modbus Gateway",
    "clienttype": "tcp",
    "bufferCommands": true,
    "stateLogEnabled": true,
    "tcpHost": "192.168.178.16",
    "tcpPort": "502",
    "tcpType": "DEFAULT",
    "serialPort": "/dev/ttyUSB",
    "serialType": "RTU-BUFFERD",
    "serialBaudrate": "9600",
    "serialDatabits": "8",
    "serialStopbits": "1",
    "serialParity": "none",
    "serialConnectionDelay": "100",
    "unit_id": "1",
    "commandDelay": "1",
    "clientTimeout": "1000",
    "reconnectTimeout": "2000"
  },
  {
    "id": "dd4b34ea.9a3888",
    "type": "function",
    "z": "92c9cabb.72c3",
    "name": "extract buffer data L1-L3",
    "func": "let voltageL1 = msg.payload.buffer.readFloatBE(0,4) // 1,2\nlet voltageL2 = msg.payload.buffer.readFloatBE(4,4) // 3,4\nlet voltageL3 = msg.payload.buffer.readFloatBE(8,4) // 5,6\n\nlet powerL1 = msg.payload.buffer.readFloatBE(12,4) // 7,8\nlet powerL2 = msg.payload.buffer.readFloatBE(16,4) // 9,10\nlet powerL3 = msg.payload.buffer.readFloatBE(20,4) // 11,12\n\nlet demandL1 = msg.payload.buffer.readFloatBE(24,4) // 13,14\nlet demandL2 = msg.payload.buffer.readFloatBE(28,4) // 15,16\nlet demandL3 = msg.payload.buffer.readFloatBE(32,4) // 17,18\n\nlet voltageAVG = msg.payload.buffer.readFloatBE(84,8) // 43-46\nlet powerAVG = msg.payload.buffer.readFloatBE(92,4) // 47,48\n\nreturn [\n    {\n        payload: {\n            L1: {\n                voltage: voltageL1,\n                power: powerL1,\n                demand: demandL1\n            },\n            L2: {\n                voltage: voltageL2,\n                power: powerL2,\n                demand: demandL2\n            },\n            L3: {\n                voltage: voltageL3,\n                power: powerL3,\n                demand: demandL3\n            },\n            voltageAVG: voltageAVG,\n            powerAVG: powerAVG,            \n        }\n    }\n];",
    "outputs": "1",
    "noerr": 0,
    "x": 390,
    "y": 180,
    "wires": [
      [
        "423cc3e1.456ffc",
        "f2380658.ab4cf8"
      ]
    ]
  },
  {
    "id": "2a2ba7f5.87ce5",
    "type": "function",
    "z": "92c9cabb.72c3",
    "name": "extract buffer data sum",
    "func": "let powerSum = msg.payload.buffer.readFloatBE(0,8)\nlet demandSum = msg.payload.buffer.readFloatBE(8,8)\n\nreturn [\n    {\n        payload: {\n            powerSum: powerSum,\n            demandSum: demandSum\n        }\n    }\n];",
    "outputs": "1",
    "noerr": 0,
    "x": 390,
    "y": 290,
    "wires": [
      [
        "423cc3e1.456ffc",
        "f2380658.ab4cf8"
      ]
    ]
  },
  {
    "id": "69dd5984.e47ed",
    "type": "function",
    "z": "92c9cabb.72c3",
    "name": "extract buffer data statics",
    "func": "let frequency = msg.payload.buffer.readFloatBE(0,4) // 71,72\n\nlet ampHourSinceLastReset = msg.payload.buffer.readFloatBE(24,4) // 83,84\nlet totalSystemPowerDemand = msg.payload.buffer.readFloatBE(28,4) // 85,86\nlet maxTotalSystemPowerDemand = msg.payload.buffer.readFloatBE(32,4) // 87,88\n\nreturn { \n    payload: {\n       frequency: frequency,\n       ampHourSinceLastReset: ampHourSinceLastReset,\n       ampHourSinceLastResetKilo: ampHourSinceLastReset / 1000.0,\n       totalSystemPowerDemand: totalSystemPowerDemand,\n       totalSystemPowerDemandKilo: totalSystemPowerDemand / 1000.0,\n       maxTotalSystemPowerDemand: maxTotalSystemPowerDemand,\n       maxTotalSystemPowerDemandKilo: maxTotalSystemPowerDemand / 1000.0\n    }\n}",
    "outputs": "1",
    "noerr": 0,
    "x": 390,
    "y": 410,
    "wires": [
      [
        "423cc3e1.456ffc",
        "f2380658.ab4cf8"
      ]
    ]
  },
  {
    "id": "423cc3e1.456ffc",
    "type": "link out",
    "z": "92c9cabb.72c3",
    "name": "",
    "links": [
      "ad2661ec.7b23a",
      "44054254.88aa5c",
      "54f113d5.6e55bc"
    ],
    "x": 585,
    "y": 290,
    "wires": []
  },
  {
    "id": "946bb7b4.8312e8",
    "type": "OPCUA-IIoT-Write",
    "z": "e9b3f9a0.9c6d5",
    "connector": "1707cb53.3e54ad",
    "name": "",
    "justValue": false,
    "showStatusActivities": false,
    "showErrors": false,
    "x": 670,
    "y": 140,
    "wires": [
      [
        "432e797c.e878d"
      ]
    ]
  },
  {
    "id": "432e797c.e878d",
    "type": "OPCUA-IIoT-Response",
    "z": "e9b3f9a0.9c6d5",
    "name": "",
    "showStatusActivities": false,
    "showErrors": false,
    "x": 820,
    "y": 140,
    "wires": [
      [
        "d63a33a7.835368"
      ]
    ]
  },
  {
    "id": "d63a33a7.835368",
    "type": "debug",
    "z": "e9b3f9a0.9c6d5",
    "name": "",
    "active": false,
    "console": "false",
    "complete": "true",
    "x": 970,
    "y": 140,
    "wires": []
  },
  {
    "id": "54f113d5.6e55bc",
    "type": "link in",
    "z": "e9b3f9a0.9c6d5",
    "name": "",
    "links": [
      "423cc3e1.456ffc"
    ],
    "x": 235,
    "y": 140,
    "wires": [
      [
        "59505b4a.4fc694",
        "cf967f96.f69748"
      ]
    ]
  },
  {
    "id": "59505b4a.4fc694",
    "type": "function",
    "z": "e9b3f9a0.9c6d5",
    "name": "Modbus to OPC UA value mapping",
    "func": "\nmsg.nodetype = \"inject\"\nmsg.injectType = \"write\"\n\nif(msg.payload.L1) {\n    msg.addressSpaceItems = [\n        {nodeId: 'ns=1;s=L1Voltage', datatypeName: 'Float'}, \n        {nodeId: 'ns=1;s=L1Power', datatypeName: 'Float'}, \n        {nodeId: 'ns=1;s=L1Demand', datatypeName: 'Float'},\n        {nodeId: 'ns=1;s=L2Voltage', datatypeName: 'Float'}, \n        {nodeId: 'ns=1;s=L2Power', datatypeName: 'Float'}, \n        {nodeId: 'ns=1;s=L2Demand', datatypeName: 'Float'},\n        {nodeId: 'ns=1;s=L3Voltage', datatypeName: 'Float'}, \n        {nodeId: 'ns=1;s=L3Power', datatypeName: 'Float'}, \n        {nodeId: 'ns=1;s=L3Demand', datatypeName: 'Float'}        \n    ]\n    \n    msg.valuesToWrite = [\n        msg.payload.L1.voltage, \n        msg.payload.L1.power, \n        msg.payload.L1.demand,\n        msg.payload.L2.voltage, \n        msg.payload.L2.power, \n        msg.payload.L2.demand,\n        msg.payload.L3.voltage, \n        msg.payload.L3.power, \n        msg.payload.L3.demand\n    ]\n    \n    return msg;\n}\n\nif(msg.payload.demandSum) {\n    msg.addressSpaceItems = [\n        {nodeId: 'ns=1;s=DemandSum', datatypeName: 'Float'}, \n        {nodeId: 'ns=1;s=PowerSum', datatypeName: 'Float'}\n    ]\n    \n    msg.valuesToWrite = [\n        msg.payload.demandSum, \n        msg.payload.powerSum\n    ]\n    \n    return msg;\n}\n",
    "outputs": 1,
    "noerr": 0,
    "x": 420,
    "y": 140,
    "wires": [
      [
        "946bb7b4.8312e8",
        "ee04aaf1.ee8048"
      ]
    ]
  },
  {
    "id": "ee04aaf1.ee8048",
    "type": "debug",
    "z": "e9b3f9a0.9c6d5",
    "name": "",
    "active": false,
    "console": "false",
    "complete": "true",
    "x": 670,
    "y": 100,
    "wires": []
  },
  {
    "id": "cf967f96.f69748",
    "type": "debug",
    "z": "e9b3f9a0.9c6d5",
    "name": "",
    "active": false,
    "console": "false",
    "complete": "true",
    "x": 330,
    "y": 100,
    "wires": []
  },
  {
    "id": "bce961c2.acf8f",
    "type": "OPCUA-IIoT-Inject",
    "z": "e9b3f9a0.9c6d5",
    "injectType": "listen",
    "payload": "1000",
    "payloadType": "num",
    "topic": "",
    "repeat": "",
    "crontab": "",
    "once": true,
    "startDelay": "28",
    "name": "Listen every sec",
    "addressSpaceItems": [
      {
        "name": "L1Voltage",
        "nodeId": "ns=1;s=L1Voltage",
        "datatypeName": "Float"
      },
      {
        "name": "L1Power",
        "nodeId": "ns=1;s=L1Power",
        "datatypeName": "Float"
      },
      {
        "name": "L1Demand",
        "nodeId": "ns=1;s=L1Demand",
        "datatypeName": "Float"
      },
      {
        "name": "L2Voltage",
        "nodeId": "ns=1;s=L2Voltage",
        "datatypeName": "Float"
      },
      {
        "name": "L2Power",
        "nodeId": "ns=1;s=L2Power",
        "datatypeName": "Float"
      },
      {
        "name": "L2Demand",
        "nodeId": "ns=1;s=L2Demand",
        "datatypeName": "Float"
      },
      {
        "name": "L3Voltage",
        "nodeId": "ns=1;s=L3Voltage",
        "datatypeName": "Float"
      },
      {
        "name": "L3Power",
        "nodeId": "ns=1;s=L3Power",
        "datatypeName": "Float"
      },
      {
        "name": "L3Demand",
        "nodeId": "ns=1;s=L3Demand",
        "datatypeName": "Float"
      },
      {
        "name": "DemandSum",
        "nodeId": "ns=1;s=DemandSum",
        "datatypeName": "Float"
      },
      {
        "name": "PowerSum",
        "nodeId": "ns=1;s=PowerSum",
        "datatypeName": "Float"
      }
    ],
    "x": 340,
    "y": 260,
    "wires": [
      [
        "5c4c6075.5747a"
      ]
    ]
  },
  {
    "id": "46b1d83a.f64f18",
    "type": "debug",
    "z": "92c9cabb.72c3",
    "name": "",
    "active": false,
    "console": "false",
    "complete": "true",
    "x": 330,
    "y": 470,
    "wires": []
  },
  {
    "id": "64f7fbf9.870c4c",
    "type": "link in",
    "z": "b56de45f.f8861",
    "name": "",
    "links": [
      "423cc3e1.456ffc"
    ],
    "x": 255,
    "y": 120,
    "wires": [
      [
        "ff6b122e.594a18",
        "603f6331.cdeb6c"
      ]
    ]
  },
  {
    "id": "ff6b122e.594a18",
    "type": "function",
    "z": "b56de45f.f8861",
    "name": "Modbus to OPC UA value mapping",
    "func": "\nmsg.nodetype = \"inject\"\nmsg.injectType = \"write\"\n\nif(msg.payload.frequency) {\n    msg.addressSpaceItems = [\n        {nodeId: 'ns=1;s=frequency', datatypeName: 'Float'}, \n        {nodeId: 'ns=1;s=ampHourSinceLastReset', datatypeName: 'Float'}, \n        {nodeId: 'ns=1;s=totalSystemPowerDemand', datatypeName: 'Float'},\n        {nodeId: 'ns=1;s=maxTotalSystemPowerDemand', datatypeName: 'Float'}      \n    ]\n    \n    msg.valuesToWrite = [\n        msg.payload.frequency, \n        msg.payload.ampHourSinceLastResetKilo, \n        msg.payload.totalSystemPowerDemandKilo,\n        msg.payload.maxTotalSystemPowerDemandKilo\n    ]\n    \n    return msg;\n}\n",
    "outputs": 1,
    "noerr": 0,
    "x": 460,
    "y": 120,
    "wires": [
      [
        "9a6ae481.0b19d",
        "7da2a478.40fadc"
      ]
    ]
  },
  {
    "id": "9a6ae481.0b19d",
    "type": "OPCUA-IIoT-Write",
    "z": "b56de45f.f8861",
    "connector": "27cb7a6b.f6dd86",
    "name": "",
    "justValue": false,
    "showStatusActivities": false,
    "showErrors": false,
    "x": 690,
    "y": 120,
    "wires": [
      [
        "6f980a6c.1a2354"
      ]
    ]
  },
  {
    "id": "6f980a6c.1a2354",
    "type": "OPCUA-IIoT-Response",
    "z": "b56de45f.f8861",
    "name": "",
    "showStatusActivities": false,
    "showErrors": false,
    "x": 830,
    "y": 120,
    "wires": [
      [
        "943c9910.84cc88"
      ]
    ]
  },
  {
    "id": "943c9910.84cc88",
    "type": "debug",
    "z": "b56de45f.f8861",
    "name": "",
    "active": false,
    "console": "false",
    "complete": "true",
    "x": 980,
    "y": 120,
    "wires": []
  },
  {
    "id": "7da2a478.40fadc",
    "type": "debug",
    "z": "b56de45f.f8861",
    "name": "",
    "active": false,
    "console": "false",
    "complete": "true",
    "x": 690,
    "y": 80,
    "wires": []
  },
  {
    "id": "603f6331.cdeb6c",
    "type": "debug",
    "z": "b56de45f.f8861",
    "name": "",
    "active": false,
    "console": "false",
    "complete": "true",
    "x": 370,
    "y": 80,
    "wires": []
  },
  {
    "id": "1ecd1738.a25991",
    "type": "OPCUA-IIoT-Inject",
    "z": "b56de45f.f8861",
    "injectType": "listen",
    "payload": "1000",
    "payloadType": "num",
    "topic": "",
    "repeat": "",
    "crontab": "",
    "once": true,
    "startDelay": "28",
    "name": "Listen every sec",
    "addressSpaceItems": [
      {
        "name": "frequency",
        "nodeId": "ns=1;s=frequency",
        "datatypeName": "Float"
      },
      {
        "name": "ampHourSinceLastReset",
        "nodeId": "ns=1;s=ampHourSinceLastReset",
        "datatypeName": "Float"
      },
      {
        "name": "totalSystemPowerDemand",
        "nodeId": "ns=1;s=totalSystemPowerDemand",
        "datatypeName": "Float"
      },
      {
        "name": "maxTotalSystemPowerDemand",
        "nodeId": "ns=1;s=maxTotalSystemPowerDemand",
        "datatypeName": "Float"
      }
    ],
    "x": 340,
    "y": 220,
    "wires": [
      [
        "3882e014.74f05"
      ]
    ]
  },
  {
    "id": "e0b65302.f11b2",
    "type": "catch",
    "z": "92c9cabb.72c3",
    "name": "",
    "scope": null,
    "x": 140,
    "y": 630,
    "wires": [
      [
        "244734d8.9c8744",
        "e6bdb23.b62415",
        "bd77e8fd.99542"
      ]
    ]
  },
  {
    "id": "244734d8.9c8744",
    "type": "debug",
    "z": "92c9cabb.72c3",
    "name": "",
    "active": true,
    "console": "false",
    "complete": "true",
    "x": 320,
    "y": 670,
    "wires": []
  },
  {
    "id": "e6bdb23.b62415",
    "type": "function",
    "z": "92c9cabb.72c3",
    "name": "reset on High",
    "func": "if(\"high level reached\" === msg.state) {\n    msg.resetQueue = true;\n}\nreturn msg;",
    "outputs": 1,
    "noerr": 0,
    "x": 350,
    "y": 590,
    "wires": [
      [
        "c4891d06.03ff88"
      ]
    ]
  },
  {
    "id": "bd77e8fd.99542",
    "type": "function",
    "z": "92c9cabb.72c3",
    "name": "reset on HighHigh",
    "func": "if(\"high high level reached\" === msg.state) {\n    msg.resetQueue = true;\n}\nreturn msg;",
    "outputs": 1,
    "noerr": 0,
    "x": 360,
    "y": 630,
    "wires": [
      [
        "c4891d06.03ff88"
      ]
    ]
  },
  {
    "id": "2149215b.656bae",
    "type": "debug",
    "z": "92c9cabb.72c3",
    "name": "",
    "active": true,
    "console": "false",
    "complete": "false",
    "x": 810,
    "y": 600,
    "wires": []
  },
  {
    "id": "e7f8f825.d9ade8",
    "type": "OPCUA-IIoT-Server-ASO",
    "z": "d8dd83e7.2d5f98",
    "nodeId": "ns=1;s=SDM630",
    "browsename": "SDM630",
    "displayname": "SDM 630",
    "objecttype": "FolderType",
    "datatype": "",
    "value": "",
    "referenceNodeId": "ns=0;i=85",
    "referencetype": "Organizes",
    "name": "SDM630",
    "x": 390,
    "y": 40,
    "wires": [
      []
    ]
  },
  {
    "id": "be0bfc2.9259b",
    "type": "OPCUA-IIoT-Inject",
    "z": "d8dd83e7.2d5f98",
    "injectType": "inject",
    "payload": "0",
    "payloadType": "num",
    "topic": "",
    "repeat": "",
    "crontab": "",
    "once": true,
    "startDelay": "",
    "name": "Inject after 10s",
    "addressSpaceItems": [],
    "x": 140,
    "y": 40,
    "wires": [
      [
        "e7f8f825.d9ade8"
      ]
    ]
  },
  {
    "id": "f8232b11.c51bc8",
    "type": "OPCUA-IIoT-Server-ASO",
    "z": "d8dd83e7.2d5f98",
    "nodeId": "ns=1;s=L1",
    "browsename": "L1",
    "displayname": "L1",
    "objecttype": "FolderType",
    "datatype": "",
    "value": "",
    "referenceNodeId": "ns=1;s=SDM630",
    "referencetype": "Organizes",
    "name": "L1",
    "x": 400,
    "y": 90,
    "wires": [
      []
    ]
  },
  {
    "id": "c2b3053.5c4c278",
    "type": "OPCUA-IIoT-Server-ASO",
    "z": "d8dd83e7.2d5f98",
    "nodeId": "ns=1;s=L3",
    "browsename": "L3",
    "displayname": "L3",
    "objecttype": "FolderType",
    "datatype": "",
    "value": "",
    "referenceNodeId": "ns=1;s=SDM630",
    "referencetype": "Organizes",
    "name": "L3",
    "x": 400,
    "y": 170,
    "wires": [
      []
    ]
  },
  {
    "id": "9edf10da.3a47b",
    "type": "OPCUA-IIoT-Server-ASO",
    "z": "d8dd83e7.2d5f98",
    "nodeId": "ns=1;s=L2",
    "browsename": "L2",
    "displayname": "L2",
    "objecttype": "FolderType",
    "datatype": "",
    "value": "",
    "referenceNodeId": "ns=1;s=SDM630",
    "referencetype": "Organizes",
    "name": "L2",
    "x": 400,
    "y": 130,
    "wires": [
      []
    ]
  },
  {
    "id": "9b989c54.d3151",
    "type": "OPCUA-IIoT-Inject",
    "z": "d8dd83e7.2d5f98",
    "injectType": "inject",
    "payload": "0",
    "payloadType": "num",
    "topic": "",
    "repeat": "",
    "crontab": "",
    "once": true,
    "startDelay": "13",
    "name": "Inject after 13s",
    "addressSpaceItems": [],
    "x": 140,
    "y": 240,
    "wires": [
      [
        "f8232b11.c51bc8",
        "9edf10da.3a47b",
        "c2b3053.5c4c278",
        "29410f9b.053928",
        "837a8aed.befcc",
        "84f5ed8d.c9c588",
        "79d04a44.09951c",
        "2c8e91fa.0847b6",
        "4f65c288.11ea74"
      ]
    ]
  },
  {
    "id": "4e1488bd.803378",
    "type": "OPCUA-IIoT-Server-ASO",
    "z": "d8dd83e7.2d5f98",
    "nodeId": "ns=1;s=L1Demand",
    "browsename": "L1Demand",
    "displayname": "L1 demand",
    "objecttype": "BaseVariableType",
    "datatype": "Float",
    "value": "",
    "referenceNodeId": "ns=1;s=L1",
    "referencetype": "Organizes",
    "name": "L1 demand",
    "x": 380,
    "y": 510,
    "wires": [
      []
    ]
  },
  {
    "id": "69262ee4.f2b4e8",
    "type": "OPCUA-IIoT-Inject",
    "z": "d8dd83e7.2d5f98",
    "injectType": "inject",
    "payload": "0",
    "payloadType": "num",
    "topic": "",
    "repeat": "",
    "crontab": "",
    "once": true,
    "startDelay": "16",
    "name": "Inject after 16s",
    "addressSpaceItems": [],
    "x": 140,
    "y": 680,
    "wires": [
      [
        "4e1488bd.803378",
        "79fb8a18.976f6c",
        "7ce1e8d5.d29d68",
        "115b7b7.75b3505",
        "1c0f75c1.99bb7a",
        "348011f5.f6759e",
        "f88e90ab.8cb848",
        "c6bf3d0e.e38538",
        "a7cefbfd.53b2"
      ]
    ]
  },
  {
    "id": "79fb8a18.976f6c",
    "type": "OPCUA-IIoT-Server-ASO",
    "z": "d8dd83e7.2d5f98",
    "nodeId": "ns=1;s=L2Demand",
    "browsename": "L2Demand",
    "displayname": "L2 demand",
    "objecttype": "BaseVariableType",
    "datatype": "Float",
    "value": "0.0",
    "referenceNodeId": "ns=1;s=L2",
    "referencetype": "Organizes",
    "name": "L2 demand",
    "x": 380,
    "y": 550,
    "wires": [
      []
    ]
  },
  {
    "id": "7ce1e8d5.d29d68",
    "type": "OPCUA-IIoT-Server-ASO",
    "z": "d8dd83e7.2d5f98",
    "nodeId": "ns=1;s=L3Demand",
    "browsename": "L3Demand",
    "displayname": "L3 demand",
    "objecttype": "BaseVariableType",
    "datatype": "Float",
    "value": "0.0",
    "referenceNodeId": "ns=1;s=L3",
    "referencetype": "Organizes",
    "name": "L3 demand",
    "x": 380,
    "y": 590,
    "wires": [
      []
    ]
  },
  {
    "id": "115b7b7.75b3505",
    "type": "OPCUA-IIoT-Server-ASO",
    "z": "d8dd83e7.2d5f98",
    "nodeId": "ns=1;s=L1Power",
    "browsename": "L1Power",
    "displayname": "L1 power",
    "objecttype": "BaseVariableType",
    "datatype": "Float",
    "value": "0.0",
    "referenceNodeId": "ns=1;s=L1",
    "referencetype": "Organizes",
    "name": "L1 power",
    "x": 390,
    "y": 640,
    "wires": [
      []
    ]
  },
  {
    "id": "1c0f75c1.99bb7a",
    "type": "OPCUA-IIoT-Server-ASO",
    "z": "d8dd83e7.2d5f98",
    "nodeId": "ns=1;s=L2Power",
    "browsename": "L2Power",
    "displayname": "L2 power",
    "objecttype": "BaseVariableType",
    "datatype": "Float",
    "value": "0.0",
    "referenceNodeId": "ns=1;s=L2",
    "referencetype": "Organizes",
    "name": "L2 power",
    "x": 390,
    "y": 680,
    "wires": [
      []
    ]
  },
  {
    "id": "348011f5.f6759e",
    "type": "OPCUA-IIoT-Server-ASO",
    "z": "d8dd83e7.2d5f98",
    "nodeId": "ns=1;s=L3Power",
    "browsename": "L3Power",
    "displayname": "L3 power",
    "objecttype": "BaseVariableType",
    "datatype": "Float",
    "value": "0.0",
    "referenceNodeId": "ns=1;s=L3",
    "referencetype": "Organizes",
    "name": "L3 power",
    "x": 390,
    "y": 720,
    "wires": [
      []
    ]
  },
  {
    "id": "f88e90ab.8cb848",
    "type": "OPCUA-IIoT-Server-ASO",
    "z": "d8dd83e7.2d5f98",
    "nodeId": "ns=1;s=L1Voltage",
    "browsename": "L1Voltage",
    "displayname": "L1 voltage",
    "objecttype": "BaseVariableType",
    "datatype": "Float",
    "value": "0.0",
    "referenceNodeId": "ns=1;s=L1",
    "referencetype": "Organizes",
    "name": "L1 voltage",
    "x": 380,
    "y": 770,
    "wires": [
      []
    ]
  },
  {
    "id": "c6bf3d0e.e38538",
    "type": "OPCUA-IIoT-Server-ASO",
    "z": "d8dd83e7.2d5f98",
    "nodeId": "ns=1;s=L2Voltage",
    "browsename": "L2Voltage",
    "displayname": "L2 voltage",
    "objecttype": "BaseVariableType",
    "datatype": "Float",
    "value": "0.0",
    "referenceNodeId": "ns=1;s=L2",
    "referencetype": "Organizes",
    "name": "L2 voltage",
    "x": 380,
    "y": 810,
    "wires": [
      []
    ]
  },
  {
    "id": "a7cefbfd.53b2",
    "type": "OPCUA-IIoT-Server-ASO",
    "z": "d8dd83e7.2d5f98",
    "nodeId": "ns=1;s=L3Voltage",
    "browsename": "L3Voltage",
    "displayname": "L3 voltage",
    "objecttype": "BaseVariableType",
    "datatype": "Float",
    "value": "0.0",
    "referenceNodeId": "ns=1;s=L3",
    "referencetype": "Organizes",
    "name": "L3 voltage",
    "x": 380,
    "y": 850,
    "wires": [
      []
    ]
  },
  {
    "id": "29410f9b.053928",
    "type": "OPCUA-IIoT-Server-ASO",
    "z": "d8dd83e7.2d5f98",
    "nodeId": "ns=1;s=DemandSum",
    "browsename": "DemandSum",
    "displayname": "Demand Sum",
    "objecttype": "BaseVariableType",
    "datatype": "Float",
    "value": "",
    "referenceNodeId": "ns=1;s=SDM630",
    "referencetype": "Organizes",
    "name": "DemandSum",
    "x": 380,
    "y": 240,
    "wires": [
      []
    ]
  },
  {
    "id": "837a8aed.befcc",
    "type": "OPCUA-IIoT-Server-ASO",
    "z": "d8dd83e7.2d5f98",
    "nodeId": "ns=1;s=PowerSum",
    "browsename": "PowerSum",
    "displayname": "Power Sum",
    "objecttype": "BaseVariableType",
    "datatype": "Float",
    "value": "",
    "referenceNodeId": "ns=1;s=SDM630",
    "referencetype": "Organizes",
    "name": "PowerSum",
    "x": 380,
    "y": 280,
    "wires": [
      []
    ]
  },
  {
    "id": "84f5ed8d.c9c588",
    "type": "OPCUA-IIoT-Server-ASO",
    "z": "d8dd83e7.2d5f98",
    "nodeId": "ns=1;s=frequency",
    "browsename": "frequency",
    "displayname": "frequency",
    "objecttype": "BaseVariableType",
    "datatype": "Float",
    "value": "",
    "referenceNodeId": "ns=1;s=SDM630",
    "referencetype": "Organizes",
    "name": "frequency",
    "x": 390,
    "y": 320,
    "wires": [
      []
    ]
  },
  {
    "id": "79d04a44.09951c",
    "type": "OPCUA-IIoT-Server-ASO",
    "z": "d8dd83e7.2d5f98",
    "nodeId": "ns=1;s=ampHourSinceLastReset",
    "browsename": "ampHourSinceLastReset",
    "displayname": "ampere-hours since last reset",
    "objecttype": "BaseVariableType",
    "datatype": "Float",
    "value": "",
    "referenceNodeId": "ns=1;s=SDM630",
    "referencetype": "Organizes",
    "name": "ampHourSinceLastReset",
    "x": 340,
    "y": 360,
    "wires": [
      []
    ]
  },
  {
    "id": "2c8e91fa.0847b6",
    "type": "OPCUA-IIoT-Server-ASO",
    "z": "d8dd83e7.2d5f98",
    "nodeId": "ns=1;s=totalSystemPowerDemand",
    "browsename": "totalSystemPowerDemand",
    "displayname": "total system power demand",
    "objecttype": "BaseVariableType",
    "datatype": "Float",
    "value": "",
    "referenceNodeId": "ns=1;s=SDM630",
    "referencetype": "Organizes",
    "name": "totalSystemPowerDemand",
    "x": 330,
    "y": 400,
    "wires": [
      []
    ]
  },
  {
    "id": "4f65c288.11ea74",
    "type": "OPCUA-IIoT-Server-ASO",
    "z": "d8dd83e7.2d5f98",
    "nodeId": "ns=1;s=maxTotalSystemPowerDemand",
    "browsename": "maxTotalSystemPowerDemand",
    "displayname": "max total system power demand",
    "objecttype": "BaseVariableType",
    "datatype": "Float",
    "value": "",
    "referenceNodeId": "ns=1;s=SDM630",
    "referencetype": "Organizes",
    "name": "maxTotalSystemPowerDemand",
    "x": 320,
    "y": 440,
    "wires": [
      []
    ]
  },
  {
    "id": "34410925.7ad29e",
    "type": "debug",
    "z": "1bf9637b.fcaa35",
    "name": "",
    "active": false,
    "console": "false",
    "complete": "true",
    "x": 410,
    "y": 80,
    "wires": []
  },
  {
    "id": "16f95961.f11f8f",
    "type": "subflow:1bf9637b.fcaa35",
    "z": "92c9cabb.72c3",
    "name": "",
    "x": 360,
    "y": 60,
    "wires": []
  },
  {
    "id": "908de5d3.9c7d28",
    "type": "subflow:d8dd83e7.2d5f98",
    "z": "92c9cabb.72c3",
    "name": "SDM630 Model",
    "x": 160,
    "y": 60,
    "wires": [
      [
        "16f95961.f11f8f"
      ]
    ]
  },
  {
    "id": "a4cc4701.4a9a1",
    "type": "ui_chart",
    "z": "8cae93d.3604d7",
    "name": "",
    "group": "82a80892.06eb38",
    "order": 2,
    "width": 0,
    "height": 0,
    "label": "power",
    "chartType": "line",
    "legend": "true",
    "xformat": "dd HH:mm",
    "interpolate": "linear",
    "nodata": "",
    "dot": false,
    "ymin": "",
    "ymax": "",
    "removeOlder": 1,
    "removeOlderPoints": "",
    "removeOlderUnit": "86400",
    "cutout": 0,
    "useOneColor": false,
    "colors": [
      "#1f77b4",
      "#aec7e8",
      "#ff7f0e",
      "#2ca02c",
      "#98df8a",
      "#d62728",
      "#ff9896",
      "#9467bd",
      "#c5b0d5"
    ],
    "useOldStyle": false,
    "x": 710,
    "y": 220,
    "wires": [
      [],
      []
    ]
  },
  {
    "id": "1e05f797.7fba38",
    "type": "ui_chart",
    "z": "8cae93d.3604d7",
    "name": "",
    "group": "82a80892.06eb38",
    "order": 3,
    "width": 0,
    "height": 0,
    "label": "voltage",
    "chartType": "line",
    "legend": "true",
    "xformat": "dd HH:mm",
    "interpolate": "linear",
    "nodata": "",
    "dot": false,
    "ymin": "",
    "ymax": "",
    "removeOlder": 1,
    "removeOlderPoints": "",
    "removeOlderUnit": "86400",
    "cutout": 0,
    "colors": [
      "#1f77b4",
      "#aec7e8",
      "#ff7f0e",
      "#2ca02c",
      "#98df8a",
      "#d62728",
      "#ff9896",
      "#9467bd",
      "#c5b0d5"
    ],
    "useOldStyle": false,
    "x": 720,
    "y": 400,
    "wires": [
      [],
      []
    ]
  },
  {
    "id": "f944377f.b28b9",
    "type": "ui_chart",
    "z": "8cae93d.3604d7",
    "name": "",
    "group": "82a80892.06eb38",
    "order": 1,
    "width": 0,
    "height": 0,
    "label": "demand",
    "chartType": "line",
    "legend": "true",
    "xformat": "dd HH:mm",
    "interpolate": "linear",
    "nodata": "",
    "dot": false,
    "ymin": "",
    "ymax": "",
    "removeOlder": 1,
    "removeOlderPoints": "",
    "removeOlderUnit": "86400",
    "cutout": 0,
    "colors": [
      "#1f77b4",
      "#aec7e8",
      "#ff7f0e",
      "#2ca02c",
      "#98df8a",
      "#d62728",
      "#ff9896",
      "#9467bd",
      "#c5b0d5"
    ],
    "useOldStyle": false,
    "x": 720,
    "y": 600,
    "wires": [
      [],
      []
    ]
  },
  {
    "id": "725d6644.34b1f",
    "type": "subflow:8cae93d.3604d7",
    "z": "e9b3f9a0.9c6d5",
    "name": "dynamic charts",
    "x": 740,
    "y": 260,
    "wires": [
      [
        "7b2b53f4.832a5c"
      ],
      [
        "9ac7513c.468eb"
      ],
      [
        "b90f9b31.1d2a18"
      ]
    ]
  },
  {
    "id": "356dea7e.059ff6",
    "type": "ui_gauge",
    "z": "8321718e.e9d488",
    "name": "",
    "group": "ede6d7ce.0d092",
    "order": 1,
    "width": 0,
    "height": 0,
    "gtype": "gage",
    "title": "Frequency",
    "label": "Hz",
    "format": "{{value | number:2}}",
    "min": 0,
    "max": "100",
    "colors": [
      "#e2e310",
      "#28cd22",
      "#d93d3f"
    ],
    "seg1": "",
    "seg2": "",
    "x": 830,
    "y": 140,
    "wires": []
  },
  {
    "id": "e2910c0f.4c4f78",
    "type": "ui_gauge",
    "z": "8321718e.e9d488",
    "name": "",
    "group": "3bb47cc7.2bd524",
    "order": 2,
    "width": 0,
    "height": 0,
    "gtype": "gage",
    "title": "Sum demand ",
    "label": "kW",
    "format": "{{value | number:3}}",
    "min": 0,
    "max": "5",
    "colors": [
      "#e2e310",
      "#28cd22",
      "#d93d3f"
    ],
    "seg1": "",
    "seg2": "",
    "x": 840,
    "y": 260,
    "wires": []
  },
  {
    "id": "78b16821.7f26a8",
    "type": "ui_gauge",
    "z": "8321718e.e9d488",
    "name": "",
    "group": "3bb47cc7.2bd524",
    "order": 1,
    "width": 0,
    "height": 0,
    "gtype": "gage",
    "title": "Max. demand ",
    "label": "kW",
    "format": "{{value | number:3}}",
    "min": 0,
    "max": "20",
    "colors": [
      "#e2e310",
      "#28cd22",
      "#d93d3f"
    ],
    "seg1": "",
    "seg2": "",
    "x": 840,
    "y": 320,
    "wires": []
  },
  {
    "id": "a045a5da.18c668",
    "type": "ui_gauge",
    "z": "8321718e.e9d488",
    "name": "",
    "group": "f4f863e1.12067",
    "order": 2,
    "width": 0,
    "height": 0,
    "gtype": "gage",
    "title": "Ampere hour",
    "label": "kAh",
    "format": "{{value | number:2}}",
    "min": 0,
    "max": "2000",
    "colors": [
      "#e2e310",
      "#28cd22",
      "#d93d3f"
    ],
    "seg1": "",
    "seg2": "",
    "x": 830,
    "y": 200,
    "wires": []
  },
  {
    "id": "afda85bb.69fc8",
    "type": "subflow:8321718e.e9d488",
    "z": "b56de45f.f8861",
    "name": "",
    "x": 710,
    "y": 220,
    "wires": [
      [
        "7fc50933.b48ee8"
      ]
    ]
  },
  {
    "id": "bd6e431b.145a88",
    "type": "http in",
    "z": "92c9cabb.72c3",
    "name": "",
    "url": "/modbus/read/lines",
    "method": "get",
    "upload": false,
    "swaggerDoc": "",
    "x": 170,
    "y": 790,
    "wires": [
      [
        "e8051fe5.c7b658"
      ]
    ]
  },
  {
    "id": "14ddb5bf.ee4f8a",
    "type": "http response",
    "z": "92c9cabb.72c3",
    "name": "",
    "statusCode": "",
    "headers": {},
    "x": 890,
    "y": 750,
    "wires": []
  },
  {
    "id": "a68b6b9e.1fe4f8",
    "type": "function",
    "z": "92c9cabb.72c3",
    "name": "extract buffer data L1-L3",
    "func": "let voltageL1 = msg.payload.buffer.readFloatBE(0,4) // 1,2\nlet voltageL2 = msg.payload.buffer.readFloatBE(4,4) // 3,4\nlet voltageL3 = msg.payload.buffer.readFloatBE(8,4) // 5,6\n\nlet powerL1 = msg.payload.buffer.readFloatBE(12,4) // 7,8\nlet powerL2 = msg.payload.buffer.readFloatBE(16,4) // 9,10\nlet powerL3 = msg.payload.buffer.readFloatBE(20,4) // 11,12\n\nlet demandL1 = msg.payload.buffer.readFloatBE(24,4) // 13,14\nlet demandL2 = msg.payload.buffer.readFloatBE(28,4) // 15,16\nlet demandL3 = msg.payload.buffer.readFloatBE(32,4) // 17,18\n\nlet voltageAVG = msg.payload.buffer.readFloatBE(84,8) // 43-46\nlet powerAVG = msg.payload.buffer.readFloatBE(92,4) // 47,48\n\nmsg.payload = {\n    L1: {\n        voltage: voltageL1,\n        power: powerL1,\n        demand: demandL1\n    },\n    L2: {\n        voltage: voltageL2,\n        power: powerL2,\n        demand: demandL2\n    },\n    L3: {\n        voltage: voltageL3,\n        power: powerL3,\n        demand: demandL3\n    },\n    voltageAVG: voltageAVG,\n    powerAVG: powerAVG,            \n};\n\nreturn msg;",
    "outputs": "1",
    "noerr": 0,
    "x": 680,
    "y": 750,
    "wires": [
      [
        "14ddb5bf.ee4f8a"
      ]
    ]
  },
  {
    "id": "7249e653.408cc",
    "type": "status",
    "z": "92c9cabb.72c3",
    "name": "",
    "scope": [
      "e8051fe5.c7b658",
      "df70ef8d.ffc068",
      "99dc6459.a19bb8",
      "7d31416a.6e9308"
    ],
    "x": 340,
    "y": 530,
    "wires": [
      [
        "54457c84.4b164c",
        "b99e18ea.fd0088"
      ]
    ]
  },
  {
    "id": "1a9eeeff.a724b1",
    "type": "debug",
    "z": "92c9cabb.72c3",
    "name": "",
    "active": true,
    "console": "false",
    "complete": "true",
    "x": 670,
    "y": 530,
    "wires": []
  },
  {
    "id": "54457c84.4b164c",
    "type": "function",
    "z": "92c9cabb.72c3",
    "name": "timeout filter",
    "func": "if(msg.status.text === 'timeout') {\n  return msg;  \n}\n",
    "outputs": 1,
    "noerr": 0,
    "x": 520,
    "y": 530,
    "wires": [
      [
        "1a9eeeff.a724b1"
      ]
    ]
  },
  {
    "id": "b99e18ea.fd0088",
    "type": "debug",
    "z": "92c9cabb.72c3",
    "name": "",
    "active": false,
    "console": "false",
    "complete": "true",
    "x": 500,
    "y": 490,
    "wires": []
  },
  {
    "id": "739e1044.7b7248",
    "type": "modbus-response",
    "z": "92c9cabb.72c3",
    "name": "",
    "registerShowMax": "1",
    "x": 370,
    "y": 120,
    "wires": []
  },
  {
    "id": "6556fd6.8ebbf84",
    "type": "modbus-response",
    "z": "92c9cabb.72c3",
    "name": "",
    "registerShowMax": "1",
    "x": 370,
    "y": 230,
    "wires": []
  },
  {
    "id": "d14d8eb7.1d8d7",
    "type": "modbus-response",
    "z": "92c9cabb.72c3",
    "name": "",
    "registerShowMax": "1",
    "x": 370,
    "y": 350,
    "wires": []
  },
  {
    "id": "985ac81c.ff2248",
    "type": "modbus-response",
    "z": "92c9cabb.72c3",
    "name": "",
    "registerShowMax": 20,
    "x": 660,
    "y": 790,
    "wires": []
  },
  {
    "id": "df70ef8d.ffc068",
    "type": "modbus-read",
    "z": "92c9cabb.72c3",
    "name": "",
    "topic": "",
    "showStatusActivities": false,
    "showErrors": true,
    "unitid": "",
    "dataType": "InputRegister",
    "adr": "0",
    "quantity": "50",
    "rate": "30",
    "rateUnit": "s",
    "delayOnStart": true,
    "startDelayTime": "",
    "server": "c6cb2fc5.8d8718",
    "useIOFile": false,
    "ioFile": "",
    "useIOForPayload": false,
    "x": 150,
    "y": 170,
    "wires": [
      [
        "46b1d83a.f64f18"
      ],
      [
        "739e1044.7b7248",
        "dd4b34ea.9a3888"
      ]
    ]
  },
  {
    "id": "7d31416a.6e9308",
    "type": "modbus-read",
    "z": "92c9cabb.72c3",
    "name": "",
    "topic": "",
    "showStatusActivities": false,
    "showErrors": true,
    "unitid": "",
    "dataType": "InputRegister",
    "adr": "48",
    "quantity": "8",
    "rate": "2",
    "rateUnit": "m",
    "delayOnStart": true,
    "startDelayTime": "",
    "server": "c6cb2fc5.8d8718",
    "useIOFile": false,
    "ioFile": "",
    "useIOForPayload": false,
    "x": 150,
    "y": 270,
    "wires": [
      [
        "46b1d83a.f64f18"
      ],
      [
        "2a2ba7f5.87ce5",
        "6556fd6.8ebbf84"
      ]
    ]
  },
  {
    "id": "99dc6459.a19bb8",
    "type": "modbus-read",
    "z": "92c9cabb.72c3",
    "name": "",
    "topic": "",
    "showStatusActivities": false,
    "showErrors": true,
    "unitid": "",
    "dataType": "InputRegister",
    "adr": "70",
    "quantity": "42",
    "rate": "1",
    "rateUnit": "m",
    "delayOnStart": true,
    "startDelayTime": "",
    "server": "c6cb2fc5.8d8718",
    "useIOFile": false,
    "ioFile": "",
    "useIOForPayload": false,
    "x": 150,
    "y": 390,
    "wires": [
      [
        "46b1d83a.f64f18"
      ],
      [
        "69dd5984.e47ed",
        "d14d8eb7.1d8d7"
      ]
    ]
  },
  {
    "id": "e8051fe5.c7b658",
    "type": "modbus-getter",
    "z": "92c9cabb.72c3",
    "name": "",
    "showStatusActivities": false,
    "showErrors": false,
    "unitid": "",
    "dataType": "InputRegister",
    "adr": "0",
    "quantity": "50",
    "server": "c6cb2fc5.8d8718",
    "useIOFile": false,
    "ioFile": "",
    "useIOForPayload": false,
    "x": 400,
    "y": 790,
    "wires": [
      [],
      [
        "985ac81c.ff2248",
        "a68b6b9e.1fe4f8"
      ]
    ]
  },
  {
    "id": "c4891d06.03ff88",
    "type": "modbus-queue-info",
    "z": "92c9cabb.72c3",
    "name": "",
    "topic": "",
    "unitid": "",
    "lowLowLevel": 25,
    "lowLevel": 75,
    "highLevel": 150,
    "highHighLevel": 300,
    "server": "c6cb2fc5.8d8718",
    "errorOnHighLevel": false,
    "x": 600,
    "y": 600,
    "wires": [
      [
        "2149215b.656bae"
      ]
    ]
  },
  {
    "id": "3882e014.74f05",
    "type": "OPCUA-IIoT-Listener",
    "z": "b56de45f.f8861",
    "connector": "27cb7a6b.f6dd86",
    "action": "subscribe",
    "queueSize": 10,
    "name": "",
    "justValue": true,
    "showStatusActivities": false,
    "showErrors": false,
    "x": 530,
    "y": 220,
    "wires": [
      [
        "afda85bb.69fc8",
        "3824bbe8.b90a94"
      ]
    ]
  },
  {
    "id": "5c4c6075.5747a",
    "type": "OPCUA-IIoT-Listener",
    "z": "e9b3f9a0.9c6d5",
    "connector": "1707cb53.3e54ad",
    "action": "subscribe",
    "queueSize": 10,
    "name": "",
    "justValue": true,
    "showStatusActivities": false,
    "showErrors": false,
    "x": 540,
    "y": 260,
    "wires": [
      [
        "725d6644.34b1f",
        "a3003ca6.64e8e"
      ]
    ]
  },
  {
    "id": "96a05c7.bfd24a",
    "type": "OPCUA-IIoT-Result-Filter",
    "z": "8cae93d.3604d7",
    "nodeId": "ns=1;s=PowerSum",
    "datatype": "Float",
    "fixedValue": true,
    "fixPoint": 2,
    "withPrecision": false,
    "precision": 2,
    "entry": 1,
    "justValue": true,
    "withValueCheck": false,
    "minvalue": "",
    "maxvalue": "",
    "defaultvalue": "",
    "topic": "Sum",
    "name": "",
    "showErrors": false,
    "x": 450,
    "y": 100,
    "wires": [
      [
        "a4cc4701.4a9a1"
      ]
    ]
  },
  {
    "id": "307d37f1.a25678",
    "type": "OPCUA-IIoT-Result-Filter",
    "z": "8cae93d.3604d7",
    "nodeId": "ns=1;s=L1Power",
    "datatype": "Float",
    "fixedValue": true,
    "fixPoint": 2,
    "withPrecision": false,
    "precision": 2,
    "entry": 1,
    "justValue": true,
    "withValueCheck": false,
    "minvalue": "",
    "maxvalue": "",
    "defaultvalue": "",
    "topic": "L1",
    "name": "",
    "showErrors": false,
    "x": 450,
    "y": 140,
    "wires": [
      [
        "a4cc4701.4a9a1"
      ]
    ]
  },
  {
    "id": "18da947e.d6390c",
    "type": "OPCUA-IIoT-Result-Filter",
    "z": "8cae93d.3604d7",
    "nodeId": "ns=1;s=L2Power",
    "datatype": "Float",
    "fixedValue": true,
    "fixPoint": 2,
    "withPrecision": false,
    "precision": 2,
    "entry": 1,
    "justValue": true,
    "withValueCheck": false,
    "minvalue": "",
    "maxvalue": "",
    "defaultvalue": "",
    "topic": "L2",
    "name": "",
    "showErrors": false,
    "x": 450,
    "y": 180,
    "wires": [
      [
        "a4cc4701.4a9a1"
      ]
    ]
  },
  {
    "id": "3f35ad83.d9b902",
    "type": "OPCUA-IIoT-Result-Filter",
    "z": "8cae93d.3604d7",
    "nodeId": "ns=1;s=L3Power",
    "datatype": "Float",
    "fixedValue": true,
    "fixPoint": 2,
    "withPrecision": false,
    "precision": 2,
    "entry": 1,
    "justValue": true,
    "withValueCheck": false,
    "minvalue": "",
    "maxvalue": "",
    "defaultvalue": "",
    "topic": "L3",
    "name": "",
    "showErrors": false,
    "x": 450,
    "y": 220,
    "wires": [
      [
        "a4cc4701.4a9a1"
      ]
    ]
  },
  {
    "id": "5fbc5bf0.76f724",
    "type": "OPCUA-IIoT-Result-Filter",
    "z": "8cae93d.3604d7",
    "nodeId": "ns=1;s=L1Voltage",
    "datatype": "Float",
    "fixedValue": false,
    "fixPoint": "1",
    "withPrecision": true,
    "precision": "3",
    "entry": 1,
    "justValue": true,
    "withValueCheck": false,
    "minvalue": "",
    "maxvalue": "",
    "defaultvalue": "",
    "topic": "L1",
    "name": "",
    "showErrors": false,
    "x": 450,
    "y": 320,
    "wires": [
      [
        "1e05f797.7fba38"
      ]
    ]
  },
  {
    "id": "7c75c56a.88d7ec",
    "type": "OPCUA-IIoT-Result-Filter",
    "z": "8cae93d.3604d7",
    "nodeId": "ns=1;s=L2Voltage",
    "datatype": "Float",
    "fixedValue": false,
    "fixPoint": "1",
    "withPrecision": true,
    "precision": "3",
    "entry": 1,
    "justValue": true,
    "withValueCheck": false,
    "minvalue": "",
    "maxvalue": "",
    "defaultvalue": "",
    "topic": "L2",
    "name": "",
    "showErrors": false,
    "x": 450,
    "y": 360,
    "wires": [
      [
        "1e05f797.7fba38"
      ]
    ]
  },
  {
    "id": "961ac2c1.169ce",
    "type": "OPCUA-IIoT-Result-Filter",
    "z": "8cae93d.3604d7",
    "nodeId": "ns=1;s=L3Voltage",
    "datatype": "Float",
    "fixedValue": false,
    "fixPoint": "1",
    "withPrecision": true,
    "precision": "3",
    "entry": 1,
    "justValue": true,
    "withValueCheck": false,
    "minvalue": "",
    "maxvalue": "",
    "defaultvalue": "",
    "topic": "L3",
    "name": "",
    "showErrors": false,
    "x": 450,
    "y": 400,
    "wires": [
      [
        "1e05f797.7fba38"
      ]
    ]
  },
  {
    "id": "94f79c36.9194e",
    "type": "OPCUA-IIoT-Result-Filter",
    "z": "8cae93d.3604d7",
    "nodeId": "ns=1;s=L1Demand",
    "datatype": "Float",
    "fixedValue": true,
    "fixPoint": 2,
    "withPrecision": false,
    "precision": 2,
    "entry": 1,
    "justValue": true,
    "withValueCheck": false,
    "minvalue": "",
    "maxvalue": "",
    "defaultvalue": "",
    "topic": "L1",
    "name": "",
    "showErrors": false,
    "x": 450,
    "y": 480,
    "wires": [
      [
        "f944377f.b28b9"
      ]
    ]
  },
  {
    "id": "d5f99c3e.1a0ea",
    "type": "OPCUA-IIoT-Result-Filter",
    "z": "8cae93d.3604d7",
    "nodeId": "ns=1;s=L2Demand",
    "datatype": "Float",
    "fixedValue": true,
    "fixPoint": 2,
    "withPrecision": false,
    "precision": 2,
    "entry": 1,
    "justValue": true,
    "withValueCheck": false,
    "minvalue": "",
    "maxvalue": "",
    "defaultvalue": "",
    "topic": "L2",
    "name": "",
    "showErrors": false,
    "x": 450,
    "y": 520,
    "wires": [
      [
        "f944377f.b28b9"
      ]
    ]
  },
  {
    "id": "69b05811.286528",
    "type": "OPCUA-IIoT-Result-Filter",
    "z": "8cae93d.3604d7",
    "nodeId": "ns=1;s=L3Demand",
    "datatype": "Float",
    "fixedValue": true,
    "fixPoint": 2,
    "withPrecision": false,
    "precision": 2,
    "entry": 1,
    "justValue": true,
    "withValueCheck": false,
    "minvalue": "",
    "maxvalue": "",
    "defaultvalue": "",
    "topic": "L3",
    "name": "",
    "showErrors": false,
    "x": 450,
    "y": 560,
    "wires": [
      [
        "f944377f.b28b9"
      ]
    ]
  },
  {
    "id": "5634635c.5d136c",
    "type": "OPCUA-IIoT-Result-Filter",
    "z": "8cae93d.3604d7",
    "nodeId": "ns=1;s=DemandSum",
    "datatype": "Float",
    "fixedValue": true,
    "fixPoint": 2,
    "withPrecision": false,
    "precision": 2,
    "entry": 1,
    "justValue": true,
    "withValueCheck": false,
    "minvalue": "",
    "maxvalue": "",
    "defaultvalue": "",
    "topic": "Sum",
    "name": "",
    "showErrors": false,
    "x": 460,
    "y": 600,
    "wires": [
      [
        "f944377f.b28b9"
      ]
    ]
  },
  {
    "id": "e4e75ba4.092028",
    "type": "OPCUA-IIoT-Server",
    "z": "1bf9637b.fcaa35",
    "port": "55388",
    "endpoint": "",
    "acceptExternalCommands": true,
    "maxAllowedSessionNumber": "",
    "maxConnectionsPerEndpoint": "",
    "maxAllowedSubscriptionNumber": "100",
    "alternateHostname": "",
    "name": "",
    "showStatusActivities": false,
    "showErrors": true,
    "asoDemo": false,
    "allowAnonymous": true,
    "isAuditing": false,
    "serverDiscovery": true,
    "users": [
      {
        "name": "test",
        "password": "test"
      },
      {
        "name": "peter",
        "password": "peter"
      }
    ],
    "xmlsets": [],
    "publicCertificateFile": "",
    "privateCertificateFile": "",
    "x": 230,
    "y": 80,
    "wires": [
      [
        "34410925.7ad29e"
      ]
    ]
  },
  {
    "id": "11e8206f.21eb3",
    "type": "OPCUA-IIoT-Result-Filter",
    "z": "8321718e.e9d488",
    "nodeId": "ns=1;s=frequency",
    "datatype": "Float",
    "fixedValue": true,
    "fixPoint": 2,
    "withPrecision": false,
    "precision": 2,
    "entry": 1,
    "justValue": true,
    "withValueCheck": false,
    "minvalue": "",
    "maxvalue": "",
    "defaultvalue": "",
    "topic": "frequency",
    "name": "",
    "showErrors": false,
    "x": 490,
    "y": 140,
    "wires": [
      [
        "356dea7e.059ff6"
      ]
    ]
  },
  {
    "id": "435f152c.3cd86c",
    "type": "OPCUA-IIoT-Result-Filter",
    "z": "8321718e.e9d488",
    "nodeId": "ns=1;s=ampHourSinceLastReset",
    "datatype": "Float",
    "fixedValue": true,
    "fixPoint": 2,
    "withPrecision": false,
    "precision": 2,
    "entry": 1,
    "justValue": true,
    "withValueCheck": false,
    "minvalue": "",
    "maxvalue": "",
    "defaultvalue": "",
    "topic": "ampHourSinceLastReset",
    "name": "",
    "showErrors": false,
    "x": 540,
    "y": 200,
    "wires": [
      [
        "a045a5da.18c668"
      ]
    ]
  },
  {
    "id": "b2db30fd.35c41",
    "type": "OPCUA-IIoT-Result-Filter",
    "z": "8321718e.e9d488",
    "nodeId": "ns=1;s=totalSystemPowerDemand",
    "datatype": "Float",
    "fixedValue": true,
    "fixPoint": 2,
    "withPrecision": false,
    "precision": 2,
    "entry": 1,
    "justValue": true,
    "withValueCheck": false,
    "minvalue": "",
    "maxvalue": "",
    "defaultvalue": "",
    "topic": "totalSystemPowerDemand",
    "name": "",
    "showErrors": false,
    "x": 530,
    "y": 260,
    "wires": [
      [
        "e2910c0f.4c4f78"
      ]
    ]
  },
  {
    "id": "d228a3a.44ff56",
    "type": "OPCUA-IIoT-Result-Filter",
    "z": "8321718e.e9d488",
    "nodeId": "ns=1;s=maxTotalSystemPowerDemand",
    "datatype": "Float",
    "fixedValue": true,
    "fixPoint": 2,
    "withPrecision": false,
    "precision": 2,
    "entry": 1,
    "justValue": true,
    "withValueCheck": false,
    "minvalue": "",
    "maxvalue": "",
    "defaultvalue": "",
    "topic": "maxTotalSystemPowerDemand",
    "name": "",
    "showErrors": false,
    "x": 530,
    "y": 320,
    "wires": [
      [
        "78b16821.7f26a8"
      ]
    ]
  },
  {
    "id": "3824bbe8.b90a94",
    "type": "debug",
    "z": "b56de45f.f8861",
    "name": "",
    "active": false,
    "tosidebar": true,
    "console": false,
    "tostatus": false,
    "complete": "true",
    "x": 690,
    "y": 260,
    "wires": []
  },
  {
    "id": "a3003ca6.64e8e",
    "type": "debug",
    "z": "e9b3f9a0.9c6d5",
    "name": "",
    "active": false,
    "tosidebar": true,
    "console": false,
    "tostatus": false,
    "complete": "true",
    "x": 710,
    "y": 320,
    "wires": []
  },
  {
    "id": "f2380658.ab4cf8",
    "type": "debug",
    "z": "92c9cabb.72c3",
    "name": "",
    "active": false,
    "tosidebar": true,
    "console": false,
    "tostatus": false,
    "complete": "true",
    "x": 610,
    "y": 360,
    "wires": []
  },
  {
    "id": "7b2b53f4.832a5c",
    "type": "debug",
    "z": "e9b3f9a0.9c6d5",
    "name": "",
    "active": false,
    "tosidebar": true,
    "console": false,
    "tostatus": false,
    "complete": "true",
    "x": 930,
    "y": 220,
    "wires": []
  },
  {
    "id": "9ac7513c.468eb",
    "type": "debug",
    "z": "e9b3f9a0.9c6d5",
    "name": "",
    "active": false,
    "tosidebar": true,
    "console": false,
    "tostatus": false,
    "complete": "true",
    "x": 930,
    "y": 260,
    "wires": []
  },
  {
    "id": "b90f9b31.1d2a18",
    "type": "debug",
    "z": "e9b3f9a0.9c6d5",
    "name": "",
    "active": false,
    "tosidebar": true,
    "console": false,
    "tostatus": false,
    "complete": "true",
    "x": 930,
    "y": 300,
    "wires": []
  },
  {
    "id": "7fc50933.b48ee8",
    "type": "debug",
    "z": "b56de45f.f8861",
    "name": "",
    "active": false,
    "tosidebar": true,
    "console": false,
    "tostatus": false,
    "complete": "true",
    "x": 850,
    "y": 220,
    "wires": []
  }
]
