[
    {
        "id": "89bb04743b235af6",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "c5a21894455c5605",
        "type": "mqtt in",
        "z": "89bb04743b235af6",
        "name": "",
        "topic": "temperatureChallenge",
        "qos": "2",
        "datatype": "auto-detect",
        "broker": "9a8d770e1bd80456",
        "nl": false,
        "rap": true,
        "rh": 0,
        "inputs": 0,
        "x": 120,
        "y": 140,
        "wires": [
            [
                "0f6faef9453f357d",
                "5292942bc5efe380"
            ]
        ]
    },
    {
        "id": "0f6faef9453f357d",
        "type": "ui_gauge",
        "z": "89bb04743b235af6",
        "name": "",
        "group": "86035c55cf8da564",
        "order": 1,
        "width": 0,
        "height": 0,
        "gtype": "gage",
        "title": "Temperature",
        "label": "C",
        "format": "{{value}}",
        "min": 0,
        "max": "32",
        "colors": [
            "#5dd0ce",
            "#e6b400",
            "#c11010"
        ],
        "seg1": "28",
        "seg2": "30",
        "x": 390,
        "y": 140,
        "wires": []
    },
    {
        "id": "aad46d7185eb38a2",
        "type": "inject",
        "z": "89bb04743b235af6",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "3600",
        "crontab": "",
        "once": true,
        "onceDelay": "60",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 130,
        "y": 60,
        "wires": [
            [
                "89a89891f78bbdbc"
            ]
        ]
    },
    {
        "id": "eba627a8c3c397fe",
        "type": "mqtt out",
        "z": "89bb04743b235af6",
        "name": "",
        "topic": "wakeUp",
        "qos": "2",
        "retain": "",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "9a8d770e1bd80456",
        "x": 600,
        "y": 80,
        "wires": []
    },
    {
        "id": "89a89891f78bbdbc",
        "type": "function",
        "z": "89bb04743b235af6",
        "name": "wakeUpOrSleep",
        "func": "let thisHour = new Date(msg.payload).getHours();\nif (thisHour === 13) {\n    msg.payload = \"WAKE UP!!!\";\n}\nelse {\n    msg.payload = \"sleep...\";\n}\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 340,
        "y": 40,
        "wires": [
            [
                "eba627a8c3c397fe",
                "0cac13dea94b2ebe",
                "16eb1feb581ac825"
            ]
        ]
    },
    {
        "id": "3c74bd4e41f061b2",
        "type": "ui_text",
        "z": "89bb04743b235af6",
        "group": "86035c55cf8da564",
        "order": 2,
        "width": "6",
        "height": "3",
        "name": "Temperature text",
        "label": "",
        "format": "{{msg.payload}}",
        "layout": "col-center",
        "x": 790,
        "y": 100,
        "wires": []
    },
    {
        "id": "5292942bc5efe380",
        "type": "function",
        "z": "89bb04743b235af6",
        "name": "manageTempMsg",
        "func": "if (msg.payload >= 30) {  \n    msg.payload = \"Well Done!\";\n    return msg;\n}\nif (msg.payload === 0) {\n    msg.payload = \"Get to 30!\";\n    return msg;\n}\n\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 510,
        "y": 200,
        "wires": [
            [
                "3c74bd4e41f061b2",
                "b57588b1efef6d63",
                "09797d5482261bcf"
            ]
        ]
    },
    {
        "id": "0cac13dea94b2ebe",
        "type": "ui_text",
        "z": "89bb04743b235af6",
        "group": "cf3d0cc08cde37ba",
        "order": 3,
        "width": "6",
        "height": "3",
        "name": "its time to text",
        "label": "",
        "format": "{{msg.payload}}",
        "layout": "row-center",
        "x": 840,
        "y": 220,
        "wires": []
    },
    {
        "id": "b57588b1efef6d63",
        "type": "function",
        "z": "89bb04743b235af6",
        "name": "sendPressBothButtons",
        "func": "if (msg.payload === \"Well Done!\") {\n    msg.payload = \"Press both buttons if you are ready for next challenge!\";\n    return msg;\n}\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 710,
        "y": 300,
        "wires": [
            [
                "0cac13dea94b2ebe",
                "1b7ef46e5dac9e1f"
            ]
        ]
    },
    {
        "id": "09797d5482261bcf",
        "type": "ui_audio",
        "z": "89bb04743b235af6",
        "name": "",
        "group": "6ed6723188b8ce6c",
        "voice": "Google US English",
        "always": false,
        "x": 1480,
        "y": 40,
        "wires": []
    },
    {
        "id": "16eb1feb581ac825",
        "type": "function",
        "z": "89bb04743b235af6",
        "name": "sendWakeUp",
        "func": "if (msg.payload === \"WAKE UP!!!\") {\n    return msg;\n}\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 720,
        "y": 40,
        "wires": [
            [
                "09797d5482261bcf"
            ]
        ]
    },
    {
        "id": "b3e405096da8a199",
        "type": "mqtt in",
        "z": "89bb04743b235af6",
        "name": "",
        "topic": "lightChallenge",
        "qos": "2",
        "datatype": "auto-detect",
        "broker": "9a8d770e1bd80456",
        "nl": false,
        "rap": true,
        "rh": 0,
        "inputs": 0,
        "x": 110,
        "y": 240,
        "wires": [
            [
                "0cac13dea94b2ebe",
                "09797d5482261bcf",
                "438b56da17f773c0",
                "b57588b1efef6d63"
            ]
        ]
    },
    {
        "id": "fd6efbc698e22a22",
        "type": "ui_colour_picker",
        "z": "89bb04743b235af6",
        "name": "",
        "label": "Choose Colors",
        "group": "d839b8e5afdb1055",
        "format": "rgb",
        "outformat": "object",
        "showSwatch": true,
        "showPicker": true,
        "showValue": false,
        "showHue": false,
        "showAlpha": false,
        "showLightness": true,
        "square": "false",
        "dynOutput": "false",
        "order": 1,
        "width": "6",
        "height": "2",
        "passthru": false,
        "topic": "topic",
        "topicType": "msg",
        "x": 560,
        "y": 380,
        "wires": [
            [
                "9b43906320e854e2"
            ]
        ]
    },
    {
        "id": "08c78d9f81c5e696",
        "type": "ui_text",
        "z": "89bb04743b235af6",
        "group": "d839b8e5afdb1055",
        "order": 2,
        "width": "6",
        "height": "3",
        "name": "light challange text",
        "label": "",
        "format": "{{msg.payload}}",
        "layout": "col-center",
        "x": 270,
        "y": 380,
        "wires": []
    },
    {
        "id": "438b56da17f773c0",
        "type": "function",
        "z": "89bb04743b235af6",
        "name": "sendChooseColors",
        "func": "if (msg.payload !== \"Well Done!\") {\n    msg.payload = \"For the next challenge choose 4 colors from the dashboard !\";\n    return msg;\n} else {\n    msg.payload = \"Look in the wordrobe in the left and change your clothes!\";\n    return msg;\n}\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 170,
        "y": 320,
        "wires": [
            [
                "08c78d9f81c5e696",
                "09797d5482261bcf"
            ]
        ]
    },
    {
        "id": "0c331f53da722217",
        "type": "mqtt out",
        "z": "89bb04743b235af6",
        "name": "",
        "topic": "chooseColors",
        "qos": "2",
        "retain": "",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "9a8d770e1bd80456",
        "x": 1000,
        "y": 360,
        "wires": []
    },
    {
        "id": "9b43906320e854e2",
        "type": "function",
        "z": "89bb04743b235af6",
        "name": "sendColorRGB",
        "func": "let red = msg.payload.r;\nlet blue = msg.payload.b;\nlet green = msg.payload.g;\nmsg.payload = red + \":\" + green + \";\" + blue\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 760,
        "y": 360,
        "wires": [
            [
                "0c331f53da722217"
            ]
        ]
    },
    {
        "id": "707bb33de954684e",
        "type": "mqtt in",
        "z": "89bb04743b235af6",
        "name": "",
        "topic": "soundChallenge",
        "qos": "2",
        "datatype": "auto-detect",
        "broker": "9a8d770e1bd80456",
        "nl": false,
        "rap": true,
        "rh": 0,
        "inputs": 0,
        "x": 180,
        "y": 440,
        "wires": [
            [
                "d36576191836de02",
                "b57588b1efef6d63",
                "f4c98cd428b33add"
            ]
        ]
    },
    {
        "id": "9b2476a55fd895be",
        "type": "ui_text",
        "z": "89bb04743b235af6",
        "group": "52c1c11b22d3e255",
        "order": 2,
        "width": "6",
        "height": "3",
        "name": "sound challange text",
        "label": "",
        "format": "{{msg.payload}}",
        "layout": "col-center",
        "x": 1180,
        "y": 480,
        "wires": []
    },
    {
        "id": "17bbccdf5e192646",
        "type": "ui_gauge",
        "z": "89bb04743b235af6",
        "name": "",
        "group": "52c1c11b22d3e255",
        "order": 1,
        "width": 0,
        "height": 0,
        "gtype": "wave",
        "title": "Scream Level",
        "label": "",
        "format": "{{value}}",
        "min": 0,
        "max": "100",
        "colors": [
            "#00b500",
            "#e6e600",
            "#ca3838"
        ],
        "seg1": "",
        "seg2": "",
        "x": 760,
        "y": 440,
        "wires": []
    },
    {
        "id": "d36576191836de02",
        "type": "function",
        "z": "89bb04743b235af6",
        "name": "sendSoundData",
        "func": "if (msg.payload >= 100) {\n    msg.payload = \"Well Done! Put your shoes on\";\n    return msg;\n}\nif (msg.payload === 0) {\n    msg.payload = \"Go to the living room, stand behind the line and scream! You need to reach 100!\";\n    return msg;\n}\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 500,
        "y": 500,
        "wires": [
            [
                "9b2476a55fd895be",
                "09797d5482261bcf",
                "5292942bc5efe380"
            ]
        ]
    },
    {
        "id": "43df1a14cc854c50",
        "type": "mqtt in",
        "z": "89bb04743b235af6",
        "name": "",
        "topic": "jumpChallenge",
        "qos": "2",
        "datatype": "auto-detect",
        "broker": "9a8d770e1bd80456",
        "nl": false,
        "rap": true,
        "rh": 0,
        "inputs": 0,
        "x": 140,
        "y": 600,
        "wires": [
            [
                "b57588b1efef6d63",
                "86d13da7b1621507",
                "ddf8b80c8269e965"
            ]
        ]
    },
    {
        "id": "de114569db1b2502",
        "type": "ui_audio",
        "z": "89bb04743b235af6",
        "name": "",
        "group": "6ed6723188b8ce6c",
        "voice": "Google US English",
        "always": true,
        "x": 560,
        "y": 540,
        "wires": []
    },
    {
        "id": "92f9e3235288950c",
        "type": "ui_text",
        "z": "89bb04743b235af6",
        "group": "6ed6723188b8ce6c",
        "order": 1,
        "width": "4",
        "height": "4",
        "name": "star jumps text",
        "label": "",
        "format": "{{msg.payload}}",
        "layout": "row-spread",
        "x": 760,
        "y": 580,
        "wires": []
    },
    {
        "id": "220c7564ef855fca",
        "type": "telegram sender",
        "z": "89bb04743b235af6",
        "name": "Add to log",
        "bot": "2117b972f2963287",
        "haserroroutput": false,
        "outputs": 1,
        "x": 890,
        "y": 660,
        "wires": [
            []
        ]
    },
    {
        "id": "86d13da7b1621507",
        "type": "function",
        "z": "89bb04743b235af6",
        "name": "msgForTelegram",
        "func": "if (msg.payload === 0) {\n    let today = new Date();\n    let date = today.getDate() + '/' + (today.getMonth() + 1) + '/' + today.getFullYear();\n    let time = today.getHours() + \":\" + today.getMinutes() + \":\" + today.getSeconds();\n    let content = \"Went for a run on: \" + date + \", in time: \" + time + \". Good for me!\";\n    msg.payload = {};\n    msg.payload.chatId = \"1639033713\";\n    msg.payload.type = \"message\";\n    msg.payload.content = content;\n    return msg;\n}\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 570,
        "y": 660,
        "wires": [
            [
                "220c7564ef855fca",
                "ffc9ba50338181cd"
            ]
        ]
    },
    {
        "id": "ffc9ba50338181cd",
        "type": "function",
        "z": "89bb04743b235af6",
        "name": "sendRunLogged",
        "func": "if (msg.payload) {\n    msg.payload = \"Run was logged in telegram, check it out!\";\n    return msg;\n}",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1220,
        "y": 580,
        "wires": [
            [
                "09797d5482261bcf",
                "92f9e3235288950c"
            ]
        ]
    },
    {
        "id": "1b7ef46e5dac9e1f",
        "type": "function",
        "z": "89bb04743b235af6",
        "name": "delayOnMsg",
        "func": "setTimeout(() => {}, 2000)\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1070,
        "y": 220,
        "wires": [
            [
                "09797d5482261bcf"
            ]
        ]
    },
    {
        "id": "ddf8b80c8269e965",
        "type": "function",
        "z": "89bb04743b235af6",
        "name": "sendJumpData",
        "func": "if (msg.payload === 20) {\n    msg.payload = \"Do 20 Star Jumps!\";\n    return msg;\n}\nif (msg.payload === 0) {\n    msg.payload = \"Well Done!\";\n    return msg;\n}\nif (msg.payload % 5 === 0){\n    msg.payload = String(msg.payload);\n    return msg;\n} else {\n    return msg;\n}",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 480,
        "y": 600,
        "wires": [
            [
                "92f9e3235288950c",
                "de114569db1b2502"
            ]
        ]
    },
    {
        "id": "f4c98cd428b33add",
        "type": "function",
        "z": "89bb04743b235af6",
        "name": "SoundLevels",
        "func": "if (msg.payload !== \"Well Done!\") {\n    return msg;\n}\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 490,
        "y": 440,
        "wires": [
            [
                "17bbccdf5e192646"
            ]
        ]
    },
    {
        "id": "4e4d93fa343f2b8b",
        "type": "ui_spacer",
        "z": "89bb04743b235af6",
        "name": "spacer",
        "group": "86035c55cf8da564",
        "order": 1,
        "width": 1,
        "height": 1
    },
    {
        "id": "9a8d770e1bd80456",
        "type": "mqtt-broker",
        "name": "Mosquitto Broker",
        "broker": "localhost",
        "port": "1883",
        "clientid": "",
        "autoConnect": true,
        "usetls": false,
        "protocolVersion": "4",
        "keepalive": "1000",
        "cleansession": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willPayload": "",
        "willMsg": {},
        "userProps": "",
        "sessionExpiry": ""
    },
    {
        "id": "86035c55cf8da564",
        "type": "ui_group",
        "name": "Temperature Challenge",
        "tab": "7af9be6135655669",
        "order": 2,
        "disp": true,
        "width": "6",
        "collapse": false
    },
    {
        "id": "cf3d0cc08cde37ba",
        "type": "ui_group",
        "name": "it's time to...",
        "tab": "7af9be6135655669",
        "order": 1,
        "disp": true,
        "width": "6",
        "collapse": false
    },
    {
        "id": "6ed6723188b8ce6c",
        "type": "ui_group",
        "name": "Star Jumps",
        "tab": "7af9be6135655669",
        "order": 5,
        "disp": true,
        "width": "6",
        "collapse": false
    },
    {
        "id": "d839b8e5afdb1055",
        "type": "ui_group",
        "name": "Lights Challenge",
        "tab": "7af9be6135655669",
        "order": 3,
        "disp": true,
        "width": "6",
        "collapse": false
    },
    {
        "id": "52c1c11b22d3e255",
        "type": "ui_group",
        "name": "Sound Challenge",
        "tab": "7af9be6135655669",
        "order": 4,
        "disp": true,
        "width": "6",
        "collapse": false
    },
    {
        "id": "2117b972f2963287",
        "type": "telegram bot",
        "botname": "RunningLog_bot",
        "usernames": "",
        "chatids": "",
        "baseapiurl": "",
        "updatemode": "polling",
        "pollinterval": "300",
        "usesocks": false,
        "sockshost": "",
        "socksprotocol": "socks5",
        "socksport": "6667",
        "socksusername": "anonymous",
        "sockspassword": "",
        "bothost": "",
        "botpath": "",
        "localbotport": "8443",
        "publicbotport": "8443",
        "privatekey": "",
        "certificate": "",
        "useselfsignedcertificate": false,
        "sslterminated": false,
        "verboselogging": false
    },
    {
        "id": "7af9be6135655669",
        "type": "ui_tab",
        "name": "Main Page",
        "icon": "dashboard",
        "order": 1,
        "disabled": false,
        "hidden": false
    }
]