[
    {
        "id": "2bfb0b07.a27cac",
        "type": "tab",
        "label": "S7-Data Example",
        "disabled": false,
        "info": ""
    },
    {
        "id": "dbe3114d.46c788",
        "type": "file",
        "z": "2bfb0b07.a27cac",
        "name": "delete mydata",
        "filename": "mydata",
        "appendNewline": true,
        "createDir": false,
        "overwriteFile": "delete",
        "x": 720,
        "y": 1100,
        "wires": [
            [
                "ac5666b9.691908"
            ]
        ]
    },
    {
        "id": "fc7d54de.65435",
        "type": "file in",
        "z": "2bfb0b07.a27cac",
        "name": "read mydata",
        "filename": "mydata",
        "format": "utf8",
        "chunk": false,
        "sendError": false,
        "x": 330,
        "y": 540,
        "wires": [
            [
                "613fbad0.f2e524"
            ]
        ]
    },
    {
        "id": "2e3c4c22.b4f27c",
        "type": "file",
        "z": "2bfb0b07.a27cac",
        "name": "store S7 data to csv file",
        "filename": "mydata",
        "appendNewline": false,
        "createDir": false,
        "overwriteFile": "false",
        "x": 930,
        "y": 420,
        "wires": [
            []
        ]
    },
    {
        "id": "4c82b85b.546fb",
        "type": "s7 in",
        "z": "2bfb0b07.a27cac",
        "endpoint": "54c8a30d.9cafcc",
        "mode": "all",
        "variable": "",
        "diff": true,
        "name": "",
        "x": 140,
        "y": 120,
        "wires": [
            [
                "81bc0b03.998c08",
                "19c8dc08.9de024",
                "c6951d77.dfa5",
                "fa555a48.856928"
            ]
        ]
    },
    {
        "id": "ba708acf.57001",
        "type": "ui_button",
        "z": "2bfb0b07.a27cac",
        "name": "",
        "group": "5f5535ce.5a5c04",
        "order": 0,
        "width": 0,
        "height": 0,
        "passthru": false,
        "label": "Delete History File",
        "color": "",
        "bgcolor": "",
        "icon": "",
        "payload": "Delete History File",
        "payloadType": "str",
        "topic": "",
        "x": 130,
        "y": 1100,
        "wires": [
            [
                "b7617d37.e36eb"
            ]
        ]
    },
    {
        "id": "c6b4acf1.8774f8",
        "type": "ui_gauge",
        "z": "2bfb0b07.a27cac",
        "name": "",
        "group": "4b3079d8.988468",
        "order": 0,
        "width": 0,
        "height": 0,
        "gtype": "wave",
        "title": "Power",
        "label": "kwh",
        "format": "{{value}}",
        "min": 0,
        "max": "1500",
        "colors": [
            "#00b500",
            "#e6e600",
            "#ca3838"
        ],
        "seg1": "",
        "seg2": "",
        "x": 710,
        "y": 220,
        "wires": []
    },
    {
        "id": "1f58fe77.7b46c2",
        "type": "ui_gauge",
        "z": "2bfb0b07.a27cac",
        "name": "",
        "group": "fb791044.d1f55",
        "order": 0,
        "width": 0,
        "height": 0,
        "gtype": "gage",
        "title": "Speed",
        "label": "1/min",
        "format": "{{value}}",
        "min": 0,
        "max": "1100",
        "colors": [
            "#00b500",
            "#e6e600",
            "#ca3838"
        ],
        "seg1": "",
        "seg2": "",
        "x": 710,
        "y": 100,
        "wires": []
    },
    {
        "id": "159bed32.5a98a3",
        "type": "csv",
        "z": "2bfb0b07.a27cac",
        "name": "",
        "sep": ";",
        "hdrin": true,
        "hdrout": false,
        "multi": "one",
        "ret": "\\r\\n",
        "temp": "Time,Speed,Power,Temperature",
        "skip": "0",
        "x": 670,
        "y": 420,
        "wires": [
            [
                "2e3c4c22.b4f27c"
            ]
        ]
    },
    {
        "id": "715004ba.3b2084",
        "type": "ui_button",
        "z": "2bfb0b07.a27cac",
        "name": "Send History File",
        "group": "5f5535ce.5a5c04",
        "order": 0,
        "width": 0,
        "height": 0,
        "passthru": false,
        "label": "Send History File",
        "color": "",
        "bgcolor": "",
        "icon": "",
        "payload": "true",
        "payloadType": "bool",
        "topic": "",
        "x": 130,
        "y": 540,
        "wires": [
            [
                "fc7d54de.65435"
            ]
        ]
    },
    {
        "id": "a4ef96bc.b30938",
        "type": "file",
        "z": "2bfb0b07.a27cac",
        "name": "Init csv file",
        "filename": "mydata",
        "appendNewline": false,
        "createDir": false,
        "overwriteFile": "true",
        "x": 1130,
        "y": 1100,
        "wires": [
            []
        ]
    },
    {
        "id": "ac5666b9.691908",
        "type": "function",
        "z": "2bfb0b07.a27cac",
        "name": "Init Columns",
        "func": "msg.payload = \"Time; Speed; Power; Temperature\\r\\n\";\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 930,
        "y": 1100,
        "wires": [
            [
                "a4ef96bc.b30938"
            ]
        ]
    },
    {
        "id": "19c8dc08.9de024",
        "type": "function",
        "z": "2bfb0b07.a27cac",
        "name": "Speed",
        "func": "//we will store the valua in a flow-varaible, that every node can access it.\nflow.set('Speed',msg.payload.Speed);\nmsg.payload = msg.payload.Speed;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 430,
        "y": 120,
        "wires": [
            [
                "1f58fe77.7b46c2",
                "981be26e.c62a3"
            ]
        ]
    },
    {
        "id": "c6951d77.dfa5",
        "type": "function",
        "z": "2bfb0b07.a27cac",
        "name": "Power",
        "func": "//we will store the valua in a flow-varaible, that every node can access it.\nflow.set('Power',msg.payload.Power);\nmsg.payload = msg.payload.Power;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 430,
        "y": 240,
        "wires": [
            [
                "c6b4acf1.8774f8",
                "dc8c7156.6d72"
            ]
        ]
    },
    {
        "id": "fa555a48.856928",
        "type": "function",
        "z": "2bfb0b07.a27cac",
        "name": "Temperature",
        "func": "//we will store the valua in a flow-varaible, that every node can access it.\nflow.set('Temperature',msg.payload.Temperature);\nmsg.payload = msg.payload.Temperature;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 450,
        "y": 340,
        "wires": [
            [
                "8b905269.1c63b",
                "d2600548.8952b"
            ]
        ]
    },
    {
        "id": "8b905269.1c63b",
        "type": "ui_gauge",
        "z": "2bfb0b07.a27cac",
        "name": "",
        "group": "4364edb4.2faf04",
        "order": 0,
        "width": 0,
        "height": 0,
        "gtype": "donut",
        "title": "Temperature",
        "label": "°C",
        "format": "{{value}}",
        "min": "-100",
        "max": "500",
        "colors": [
            "#00b500",
            "#e6e600",
            "#ca3838"
        ],
        "seg1": "",
        "seg2": "",
        "x": 730,
        "y": 320,
        "wires": []
    },
    {
        "id": "b9629723.7c1098",
        "type": "ui_chart",
        "z": "2bfb0b07.a27cac",
        "name": "",
        "group": "fb791044.d1f55",
        "order": 0,
        "width": 0,
        "height": 0,
        "label": "Chart Speed",
        "chartType": "line",
        "legend": "true",
        "xformat": "HH:mm:ss",
        "interpolate": "step",
        "nodata": "",
        "dot": false,
        "ymin": "-100",
        "ymax": "1000",
        "removeOlder": 1,
        "removeOlderPoints": "500",
        "removeOlderUnit": "3600",
        "cutout": 0,
        "useOneColor": false,
        "colors": [
            "#1f77b4",
            "#aec7e8",
            "#ff7f0e",
            "#2ca02c",
            "#98df8a",
            "#d62728",
            "#ff9896",
            "#9467bd",
            "#c5b0d5"
        ],
        "useOldStyle": false,
        "x": 890,
        "y": 160,
        "wires": [
            [],
            []
        ]
    },
    {
        "id": "eb039701.db5678",
        "type": "ui_chart",
        "z": "2bfb0b07.a27cac",
        "name": "",
        "group": "4b3079d8.988468",
        "order": 0,
        "width": 0,
        "height": 0,
        "label": "Chart Power",
        "chartType": "line",
        "legend": "true",
        "xformat": "HH:mm:ss",
        "interpolate": "step",
        "nodata": "",
        "dot": false,
        "ymin": "-100",
        "ymax": "1000",
        "removeOlder": 1,
        "removeOlderPoints": "500",
        "removeOlderUnit": "3600",
        "cutout": 0,
        "useOneColor": false,
        "colors": [
            "#1f77b4",
            "#aec7e8",
            "#ff7f0e",
            "#2ca02c",
            "#98df8a",
            "#d62728",
            "#ff9896",
            "#9467bd",
            "#c5b0d5"
        ],
        "useOldStyle": false,
        "x": 890,
        "y": 260,
        "wires": [
            [],
            []
        ]
    },
    {
        "id": "6c3f1485.0b430c",
        "type": "ui_chart",
        "z": "2bfb0b07.a27cac",
        "name": "",
        "group": "4364edb4.2faf04",
        "order": 0,
        "width": 0,
        "height": 0,
        "label": "Chart Temperature",
        "chartType": "line",
        "legend": "true",
        "xformat": "HH:mm:ss",
        "interpolate": "step",
        "nodata": "",
        "dot": false,
        "ymin": "-100",
        "ymax": "200",
        "removeOlder": 1,
        "removeOlderPoints": "500",
        "removeOlderUnit": "3600",
        "cutout": 0,
        "useOneColor": false,
        "colors": [
            "#1f77b4",
            "#aec7e8",
            "#ff7f0e",
            "#2ca02c",
            "#98df8a",
            "#d62728",
            "#ff9896",
            "#9467bd",
            "#c5b0d5"
        ],
        "useOldStyle": false,
        "x": 910,
        "y": 360,
        "wires": [
            [],
            []
        ]
    },
    {
        "id": "80865381.b05168",
        "type": "sftp in",
        "z": "2bfb0b07.a27cac",
        "sftp": "66f330f2.9c4f48",
        "operation": "put",
        "filename": "",
        "localFilename": "",
        "fileContents": "",
        "fileExtension": "",
        "workdir": "",
        "savedir": "",
        "name": "Transfer via SFTP",
        "x": 770,
        "y": 540,
        "wires": [
            [
                "d02858d4.3be2b",
                "74372826.9b2d98"
            ]
        ]
    },
    {
        "id": "81bc0b03.998c08",
        "type": "delay",
        "z": "2bfb0b07.a27cac",
        "name": "",
        "pauseType": "rate",
        "timeout": "5",
        "timeoutUnits": "seconds",
        "rate": "1",
        "nbRateUnits": "5",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": true,
        "x": 180,
        "y": 420,
        "wires": [
            [
                "1347bae5.f15dc5"
            ]
        ]
    },
    {
        "id": "981be26e.c62a3",
        "type": "delay",
        "z": "2bfb0b07.a27cac",
        "name": "",
        "pauseType": "rate",
        "timeout": "5",
        "timeoutUnits": "seconds",
        "rate": "1",
        "nbRateUnits": "5",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": true,
        "x": 700,
        "y": 160,
        "wires": [
            [
                "b9629723.7c1098"
            ]
        ]
    },
    {
        "id": "dc8c7156.6d72",
        "type": "delay",
        "z": "2bfb0b07.a27cac",
        "name": "",
        "pauseType": "rate",
        "timeout": "5",
        "timeoutUnits": "seconds",
        "rate": "1",
        "nbRateUnits": "5",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": true,
        "x": 700,
        "y": 260,
        "wires": [
            [
                "eb039701.db5678"
            ]
        ]
    },
    {
        "id": "d2600548.8952b",
        "type": "delay",
        "z": "2bfb0b07.a27cac",
        "name": "",
        "pauseType": "rate",
        "timeout": "5",
        "timeoutUnits": "seconds",
        "rate": "1",
        "nbRateUnits": "5",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": true,
        "x": 700,
        "y": 360,
        "wires": [
            [
                "6c3f1485.0b430c"
            ]
        ]
    },
    {
        "id": "613fbad0.f2e524",
        "type": "function",
        "z": "2bfb0b07.a27cac",
        "name": "Generate File to send",
        "func": "var msg1 = msg.payload;\nvar date;\ndate = new Date();\ndate = (date.getFullYear() + '' + ('00' + (date.getMonth()+1)).slice(-2) + '' + ('00' + date.getDate()).slice(-2) + '_' + ('00' + date.getHours()).slice(-2) + '' + ('00' + date.getMinutes()).slice(-2) + '' + ('00' + date.getSeconds()).slice(-2));\nmsg.payload = {};\n//msg.host = \"192.168.0.92\";\nmsg.payload.filename=\"./\"+date+\"data.csv\"; // Full Path\nmsg.payload.filedata=msg1; // Needs to be a string\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 540,
        "y": 540,
        "wires": [
            [
                "80865381.b05168",
                "9a63339.051045"
            ]
        ]
    },
    {
        "id": "1347bae5.f15dc5",
        "type": "function",
        "z": "2bfb0b07.a27cac",
        "name": "Add Date/Time",
        "func": "var date;\ndate = new Date();\ndate = (date.getFullYear() + '-' + ('00' + (date.getMonth()+1)).slice(-2) + '-' + ('00' + date.getDate()).slice(-2) + ' ' + ('00' + date.getHours()).slice(-2) + ':' + ('00' + date.getMinutes()).slice(-2) + ':' + ('00' + date.getSeconds()).slice(-2));\nmsg.payload.Time=date;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 460,
        "y": 420,
        "wires": [
            [
                "159bed32.5a98a3"
            ]
        ]
    },
    {
        "id": "246bad0.ac3e654",
        "type": "ui_toast",
        "z": "2bfb0b07.a27cac",
        "position": "top left",
        "displayTime": "5",
        "highlight": "",
        "outputs": 0,
        "ok": "OK",
        "cancel": "",
        "topic": "",
        "name": "Message File transfer",
        "x": 1100,
        "y": 700,
        "wires": []
    },
    {
        "id": "d02858d4.3be2b",
        "type": "change",
        "z": "2bfb0b07.a27cac",
        "name": "Set Success Message",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "File has been transferred",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1080,
        "y": 540,
        "wires": [
            [
                "246bad0.ac3e654"
            ]
        ]
    },
    {
        "id": "74372826.9b2d98",
        "type": "function",
        "z": "2bfb0b07.a27cac",
        "name": "Reset Timeout",
        "func": "msg.reset = 1;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 820,
        "y": 600,
        "wires": [
            [
                "9a63339.051045"
            ]
        ]
    },
    {
        "id": "9a63339.051045",
        "type": "trigger",
        "z": "2bfb0b07.a27cac",
        "op1": "",
        "op2": "Error while sending File",
        "op1type": "nul",
        "op2type": "str",
        "duration": "10",
        "extend": false,
        "units": "s",
        "reset": "",
        "bytopic": "all",
        "name": "Timeout 5s",
        "x": 810,
        "y": 660,
        "wires": [
            [
                "246bad0.ac3e654"
            ]
        ]
    },
    {
        "id": "40df677d.e6083",
        "type": "comment",
        "z": "2bfb0b07.a27cac",
        "name": "Read Data from S7, display on Dashboard and write into CSV File",
        "info": "",
        "x": 280,
        "y": 60,
        "wires": []
    },
    {
        "id": "149f54af.b659f3",
        "type": "comment",
        "z": "2bfb0b07.a27cac",
        "name": "Delete CSV File",
        "info": "",
        "x": 120,
        "y": 1060,
        "wires": []
    },
    {
        "id": "b7617d37.e36eb",
        "type": "ui_toast",
        "z": "2bfb0b07.a27cac",
        "position": "dialog",
        "displayTime": "3",
        "highlight": "",
        "outputs": 1,
        "ok": "Yes",
        "cancel": "No",
        "topic": "Confirmation",
        "name": "",
        "x": 350,
        "y": 1100,
        "wires": [
            [
                "a7e93c4a.4e35a8"
            ]
        ]
    },
    {
        "id": "a7e93c4a.4e35a8",
        "type": "switch",
        "z": "2bfb0b07.a27cac",
        "name": "",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "Yes",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 530,
        "y": 1100,
        "wires": [
            [
                "dbe3114d.46c788"
            ]
        ]
    },
    {
        "id": "af9eced5.6c1b38",
        "type": "e-mail",
        "z": "2bfb0b07.a27cac",
        "server": "mail.gmx.net",
        "port": "465",
        "secure": true,
        "name": "mbedge@gmx.de",
        "dname": "",
        "x": 1110,
        "y": 760,
        "wires": []
    },
    {
        "id": "f791a35d.66e538",
        "type": "file in",
        "z": "2bfb0b07.a27cac",
        "name": "read mydata",
        "filename": "mydata",
        "format": "",
        "chunk": false,
        "sendError": false,
        "x": 650,
        "y": 760,
        "wires": [
            [
                "cf86390b.ebb8e"
            ]
        ]
    },
    {
        "id": "cf86390b.ebb8e",
        "type": "function",
        "z": "2bfb0b07.a27cac",
        "name": "Generate File to send",
        "func": "var msg1 = msg.payload;\nvar date;\ndate = new Date();\ndate = (date.getFullYear() + '' + ('00' + (date.getMonth()+1)).slice(-2) + '' + ('00' + date.getDate()).slice(-2) + '_' + ('00' + date.getHours()).slice(-2) + '' + ('00' + date.getMinutes()).slice(-2) + '' + ('00' + date.getSeconds()).slice(-2));\n\nmsg.payload = {};\nmsg.payload = msg1;\n\n//Subject\nmsg.topic= \"your Data from S7-Example of \"+date;\n//Attachement\nmsg.filename=\"./\"+date+\"data.csv\"; // Full Path\n//Body\nmsg.description=\"This your data\";\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 860,
        "y": 760,
        "wires": [
            [
                "af9eced5.6c1b38",
                "d9854fae.b5dcc"
            ]
        ]
    },
    {
        "id": "17d7011f.98fd37",
        "type": "ui_button",
        "z": "2bfb0b07.a27cac",
        "name": "Email History File",
        "group": "5f5535ce.5a5c04",
        "order": 0,
        "width": 0,
        "height": 0,
        "passthru": false,
        "label": "Email History File",
        "color": "",
        "bgcolor": "",
        "icon": "",
        "payload": "true",
        "payloadType": "bool",
        "topic": "",
        "x": 130,
        "y": 760,
        "wires": [
            [
                "f791a35d.66e538"
            ]
        ]
    },
    {
        "id": "4b518d35.5bc6f4",
        "type": "catch",
        "z": "2bfb0b07.a27cac",
        "name": "Errormessages",
        "scope": [
            "af9eced5.6c1b38",
            "ac47dac.57700a8"
        ],
        "x": 120,
        "y": 920,
        "wires": [
            [
                "5de0c04a.738a18"
            ]
        ]
    },
    {
        "id": "9a7b661.e00c018",
        "type": "ui_toast",
        "z": "2bfb0b07.a27cac",
        "position": "top left",
        "displayTime": "5",
        "highlight": "",
        "outputs": 0,
        "ok": "OK",
        "cancel": "",
        "topic": "",
        "name": "Error",
        "x": 770,
        "y": 940,
        "wires": []
    },
    {
        "id": "5de0c04a.738a18",
        "type": "function",
        "z": "2bfb0b07.a27cac",
        "name": "Filter Error Message",
        "func": "msg.topic = \"Error\";\nmsg.payload = \"Could not send your Email\\r\\n\"+\"Error:\\r\\n\"+msg.error.message;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 440,
        "y": 920,
        "wires": [
            [
                "9a7b661.e00c018",
                "73f44b6d.dfea14"
            ]
        ]
    },
    {
        "id": "58dc3f9b.840ac8",
        "type": "comment",
        "z": "2bfb0b07.a27cac",
        "name": "Send CSV File via Email",
        "info": "",
        "x": 150,
        "y": 720,
        "wires": []
    },
    {
        "id": "5ce2aacb.941d8c",
        "type": "ui_button",
        "z": "2bfb0b07.a27cac",
        "name": "Email actual Data",
        "group": "5f5535ce.5a5c04",
        "order": 0,
        "width": 0,
        "height": 0,
        "passthru": false,
        "label": "Email actual Data",
        "color": "",
        "bgcolor": "",
        "icon": "",
        "payload": "true",
        "payloadType": "bool",
        "topic": "",
        "x": 130,
        "y": 1360,
        "wires": [
            [
                "9034cd82.ba5638"
            ]
        ]
    },
    {
        "id": "9034cd82.ba5638",
        "type": "function",
        "z": "2bfb0b07.a27cac",
        "name": "Generate Context to send",
        "func": "//read the flow values we stored before\nvar Speed=flow.get('Speed') || 0;\nvar Power=flow.get('Power') || 0;\nvar Temperature=flow.get('Temperature') || 0;\n\n//Email Subject\nmsg.topic= \"Actual values from S7 (\"+Speed+\",\"+Power+\",\"+Temperature+\")\";\n//Email Body\nmsg.payload=\"The actual Speed = \"+Speed+\"\\r\\n\"+\n\"The actual Power = \"+Power+\"\\r\\n\"+\n\"The actual Temperature = \"+Temperature+\"\\r\\n\";\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 390,
        "y": 1360,
        "wires": [
            [
                "ac47dac.57700a8"
            ]
        ]
    },
    {
        "id": "ac47dac.57700a8",
        "type": "e-mail",
        "z": "2bfb0b07.a27cac",
        "server": "mail.gmx.net",
        "port": "465",
        "secure": true,
        "name": "mbedge@gmx.de",
        "dname": "",
        "x": 1110,
        "y": 1360,
        "wires": []
    },
    {
        "id": "6174177a.6f011",
        "type": "inject",
        "z": "2bfb0b07.a27cac",
        "name": "",
        "topic": "",
        "payload": "Send every Day at 23:30",
        "payloadType": "str",
        "repeat": "",
        "crontab": "30 23 * * *",
        "once": false,
        "onceDelay": 0.1,
        "x": 160,
        "y": 840,
        "wires": [
            [
                "4b6a7689.13826"
            ]
        ]
    },
    {
        "id": "8a6157d9.b684a8",
        "type": "ui_switch",
        "z": "2bfb0b07.a27cac",
        "name": "",
        "label": "Send History File every Day at 23:30",
        "group": "5f5535ce.5a5c04",
        "order": 0,
        "width": 0,
        "height": 0,
        "passthru": true,
        "decouple": "false",
        "topic": "",
        "style": "",
        "onvalue": "true",
        "onvalueType": "bool",
        "onicon": "",
        "oncolor": "",
        "offvalue": "false",
        "offvalueType": "bool",
        "officon": "",
        "offcolor": "",
        "x": 190,
        "y": 1220,
        "wires": [
            [
                "a2e22760.71f7"
            ]
        ]
    },
    {
        "id": "a2e22760.71f7",
        "type": "function",
        "z": "2bfb0b07.a27cac",
        "name": "Set/Reset Flag",
        "func": "//we will store the valua in a flow-varaible, that every node can access it.\nflow.set('SendEveryDay',msg.payload);\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 480,
        "y": 1220,
        "wires": [
            []
        ]
    },
    {
        "id": "4b6a7689.13826",
        "type": "switch",
        "z": "2bfb0b07.a27cac",
        "name": "Is Flag \"Send every Day \"?",
        "property": "SendEveryDay",
        "propertyType": "flow",
        "rules": [
            {
                "t": "true"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 520,
        "y": 840,
        "wires": [
            [
                "f791a35d.66e538"
            ]
        ]
    },
    {
        "id": "d9854fae.b5dcc",
        "type": "trigger",
        "z": "2bfb0b07.a27cac",
        "op1": "",
        "op2": "Error while emailing",
        "op1type": "nul",
        "op2type": "str",
        "duration": "10",
        "extend": false,
        "units": "s",
        "reset": "",
        "bytopic": "all",
        "name": "Wait till delete file",
        "x": 1110,
        "y": 860,
        "wires": [
            [
                "dbe3114d.46c788"
            ]
        ]
    },
    {
        "id": "73f44b6d.dfea14",
        "type": "function",
        "z": "2bfb0b07.a27cac",
        "name": "Reset Wait because of Error",
        "func": "msg.reset = 1;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 840,
        "y": 860,
        "wires": [
            [
                "d9854fae.b5dcc"
            ]
        ]
    },
    {
        "id": "faedcc2d.735ac8",
        "type": "comment",
        "z": "2bfb0b07.a27cac",
        "name": "Set/Reset Flag for sending Historical Data via Email daily",
        "info": "",
        "x": 250,
        "y": 1180,
        "wires": []
    },
    {
        "id": "38834a35.ea249e",
        "type": "comment",
        "z": "2bfb0b07.a27cac",
        "name": "Email actual Data ",
        "info": "",
        "x": 120,
        "y": 1320,
        "wires": []
    },
    {
        "id": "f3870a1f.620d58",
        "type": "comment",
        "z": "2bfb0b07.a27cac",
        "name": "Send CSV File via SFTP",
        "info": "",
        "x": 150,
        "y": 500,
        "wires": []
    },
    {
        "id": "54c8a30d.9cafcc",
        "type": "s7 endpoint",
        "z": "",
        "address": "192.168.0.110",
        "port": "102",
        "rack": "0",
        "slot": "1",
        "localtsaphi": "01",
        "localtsaplo": "00",
        "remotetsaphi": "01",
        "remotetsaplo": "00",
        "connmode": "rack-slot",
        "cycletime": "500",
        "timeout": "1500",
        "verbose": "default",
        "name": "",
        "vartable": [
            {
                "addr": "MW20",
                "name": "Speed"
            },
            {
                "addr": "MR22",
                "name": "Power"
            },
            {
                "addr": "MR30",
                "name": "Temperature"
            },
            {
                "addr": "M200.0",
                "name": "TriggerMessage"
            }
        ]
    },
    {
        "id": "5f5535ce.5a5c04",
        "type": "ui_group",
        "z": "",
        "name": "Control",
        "tab": "874d4274.1c554",
        "disp": true,
        "width": "6",
        "collapse": false
    },
    {
        "id": "4b3079d8.988468",
        "type": "ui_group",
        "z": "",
        "name": "Power",
        "tab": "874d4274.1c554",
        "disp": true,
        "width": "8",
        "collapse": false
    },
    {
        "id": "fb791044.d1f55",
        "type": "ui_group",
        "z": "",
        "name": "Speed",
        "tab": "874d4274.1c554",
        "disp": true,
        "width": "8",
        "collapse": false
    },
    {
        "id": "4364edb4.2faf04",
        "type": "ui_group",
        "z": "",
        "name": "Temperature",
        "tab": "874d4274.1c554",
        "disp": true,
        "width": "8",
        "collapse": false
    },
    {
        "id": "66f330f2.9c4f48",
        "type": "sftp",
        "z": "",
        "host": "192.168.0.90",
        "port": "22",
        "username": "tester",
        "password": "password",
        "hmac": "hmac-sha2-256,hmac-sha2-512,hmac-sha1",
        "cipher": "aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm"
    },
    {
        "id": "874d4274.1c554",
        "type": "ui_tab",
        "z": "",
        "name": "S7 Example",
        "icon": "dashboard",
        "order": 3
    }
]