[
    {
        "id": "84317f5a.da3c9",
        "type": "tab",
        "label": "S7 Trigger Message",
        "disabled": false,
        "info": ""
    },
    {
        "id": "61d933e7.b8f344",
        "type": "s7 in",
        "z": "84317f5a.da3c9",
        "endpoint": "84d95fd4.23782",
        "mode": "all",
        "variable": "",
        "diff": true,
        "name": "",
        "x": 140,
        "y": 120,
        "wires": [
            [
                "2747b657.671902",
                "513ad07c.80a9d8",
                "c0ceb6b2.5b4ac8"
            ]
        ]
    },
    {
        "id": "5a7edaf4.c1337c",
        "type": "ui_gauge",
        "z": "84317f5a.da3c9",
        "name": "",
        "group": "c3b2c580.b0934",
        "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": 690,
        "y": 180,
        "wires": []
    },
    {
        "id": "e6b3d5db.0956c8",
        "type": "ui_gauge",
        "z": "84317f5a.da3c9",
        "name": "",
        "group": "ae8b4634.9a6d3",
        "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": 670,
        "y": 120,
        "wires": []
    },
    {
        "id": "2747b657.671902",
        "type": "function",
        "z": "84317f5a.da3c9",
        "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": [
            [
                "e6b3d5db.0956c8"
            ]
        ]
    },
    {
        "id": "513ad07c.80a9d8",
        "type": "function",
        "z": "84317f5a.da3c9",
        "name": "Power",
        "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": 430,
        "y": 180,
        "wires": [
            [
                "5a7edaf4.c1337c"
            ]
        ]
    },
    {
        "id": "5529a514.ea6334",
        "type": "comment",
        "z": "84317f5a.da3c9",
        "name": "Read Data from S7, display on Dashboard",
        "info": "",
        "x": 200,
        "y": 60,
        "wires": []
    },
    {
        "id": "c6cf6a83.111b58",
        "type": "catch",
        "z": "84317f5a.da3c9",
        "name": "Errormessages",
        "scope": [
            "a425239e.eb3d2"
        ],
        "x": 120,
        "y": 480,
        "wires": [
            [
                "f0c71b65.755b98"
            ]
        ]
    },
    {
        "id": "f94eb74b.bf781",
        "type": "ui_toast",
        "z": "84317f5a.da3c9",
        "position": "top left",
        "displayTime": "5",
        "highlight": "",
        "outputs": 0,
        "ok": "OK",
        "cancel": "",
        "topic": "",
        "name": "Error",
        "x": 870,
        "y": 480,
        "wires": []
    },
    {
        "id": "f0c71b65.755b98",
        "type": "function",
        "z": "84317f5a.da3c9",
        "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": 480,
        "wires": [
            [
                "f94eb74b.bf781"
            ]
        ]
    },
    {
        "id": "9611d3cc.048678",
        "type": "ui_button",
        "z": "84317f5a.da3c9",
        "name": "Email actual Data",
        "group": "7099f0f3.71ad1",
        "order": 0,
        "width": 0,
        "height": 0,
        "passthru": false,
        "label": "Email actual Data",
        "color": "",
        "bgcolor": "",
        "icon": "",
        "payload": "true",
        "payloadType": "bool",
        "topic": "",
        "x": 530,
        "y": 400,
        "wires": [
            [
                "16661920.f0233f"
            ]
        ]
    },
    {
        "id": "16661920.f0233f",
        "type": "function",
        "z": "84317f5a.da3c9",
        "name": "Generate Context to send",
        "func": "var Speed=flow.get('Speed') || 0;\nvar Power=flow.get('Power') || 0;\nvar Temperature=flow.get('Temperature') || 0;\n\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\n//Subject\nmsg.topic= \"Actual values from S7 (\"+Speed+\",\"+Power+\",\"+Temperature+\")\";\n//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": 930,
        "y": 240,
        "wires": [
            [
                "3560eb7c.859fac",
                "a425239e.eb3d2"
            ]
        ]
    },
    {
        "id": "a425239e.eb3d2",
        "type": "e-mail",
        "z": "84317f5a.da3c9",
        "server": "mail.gmx.net",
        "port": "465",
        "secure": true,
        "name": "mbedge@gmx.de",
        "dname": "",
        "x": 1230,
        "y": 240,
        "wires": []
    },
    {
        "id": "c0ceb6b2.5b4ac8",
        "type": "function",
        "z": "84317f5a.da3c9",
        "name": "TriggerMessage",
        "func": "//we will store the valua in a flow-varaible, that every node can access it.\nflow.set('TriggerMessage',msg.payload.TriggerMessage);\nmsg.payload = msg.payload.TriggerMessage;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 460,
        "y": 240,
        "wires": [
            [
                "85b22392.c6cde8"
            ]
        ]
    },
    {
        "id": "4ca03a98.bfe524",
        "type": "ui_button",
        "z": "84317f5a.da3c9",
        "name": "",
        "group": "7099f0f3.71ad1",
        "order": 0,
        "width": 0,
        "height": 0,
        "passthru": false,
        "label": "Simulate Trigger Message",
        "color": "",
        "bgcolor": "",
        "icon": "",
        "payload": "true",
        "payloadType": "bool",
        "topic": "TriggerMessage",
        "x": 940,
        "y": 400,
        "wires": [
            [
                "14b3760a.62ea92"
            ]
        ]
    },
    {
        "id": "14b3760a.62ea92",
        "type": "s7 out",
        "z": "84317f5a.da3c9",
        "endpoint": "84d95fd4.23782",
        "variable": "TriggerMessage",
        "name": "Reset TriggerMessage",
        "x": 1240,
        "y": 320,
        "wires": []
    },
    {
        "id": "3560eb7c.859fac",
        "type": "function",
        "z": "84317f5a.da3c9",
        "name": "Reset TriggerMessage",
        "func": "msg.payload = false;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 920,
        "y": 320,
        "wires": [
            [
                "14b3760a.62ea92"
            ]
        ]
    },
    {
        "id": "85b22392.c6cde8",
        "type": "switch",
        "z": "84317f5a.da3c9",
        "name": "Send Email?",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "true"
            },
            {
                "t": "false"
            }
        ],
        "checkall": "false",
        "repair": false,
        "outputs": 2,
        "x": 690,
        "y": 240,
        "wires": [
            [
                "16661920.f0233f"
            ],
            []
        ]
    },
    {
        "id": "84d95fd4.23782",
        "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": "c3b2c580.b0934",
        "type": "ui_group",
        "z": "",
        "name": "Temperature",
        "tab": "e72c432c.6233e",
        "order": 3,
        "disp": true,
        "width": "6",
        "collapse": false
    },
    {
        "id": "ae8b4634.9a6d3",
        "type": "ui_group",
        "z": "",
        "name": "Speed",
        "tab": "e72c432c.6233e",
        "order": 2,
        "disp": true,
        "width": "6",
        "collapse": false
    },
    {
        "id": "7099f0f3.71ad1",
        "type": "ui_group",
        "z": "",
        "name": "Control",
        "tab": "e72c432c.6233e",
        "order": 1,
        "disp": true,
        "width": "6",
        "collapse": false
    },
    {
        "id": "e72c432c.6233e",
        "type": "ui_tab",
        "z": "",
        "name": "S7 Trigger",
        "icon": "dashboard",
        "order": 6
    }
]