[
{
"id": "60cf67e173ed3e74",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": ""
},
{
"id": "4f56b568bc65e2cd",
"type": "serial-port",
"serialport": "/dev/ttyACM0",
"serialbaud": "9600",
"databits": "8",
"parity": "none",
"stopbits": "1",
"waitfor": "",
"dtr": "none",
"rts": "none",
"cts": "none",
"dsr": "none",
"newline": "\\n",
"bin": "false",
"out": "char",
"addchar": "",
"responsetimeout": "10000"
},
{
"id": "9fc033063aefec68",
"type": "function",
"z": "60cf67e173ed3e74",
"name": "CONDITION",
"func": "//var newMsg = {payload:msg.payload.toString()};\nif (msg.payload === \"Distance: 20cm\") {\n msg.payload = \"Distance: 20cm\"\n return msg;\n}\n\n\n//Make a delimiter that splits the string into just the number then turn the numver into a variable which then acquires the variable data as the distance\n\n\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 470,
"y": 340,
"wires": [
[
"a327079557ed0ecf"
]
]
},
{
"id": "880192a506a1f490",
"type": "debug",
"z": "60cf67e173ed3e74",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 350,
"y": 160,
"wires": []
},
{
"id": "6fb6e8da868a6199",
"type": "exec",
"z": "60cf67e173ed3e74",
"command": "youtube-dl --extract-audio --audio-format mp3 https://www.youtube.com/watch?v=guf9R6qLpo4",
"addpay": "",
"append": "",
"useSpawn": "false",
"timer": "",
"winHide": false,
"oldrc": false,
"name": "Download video",
"x": 820,
"y": 640,
"wires": [
[],
[],
[]
]
},
{
"id": "4f762555f2e0498b",
"type": "exec",
"z": "60cf67e173ed3e74",
"command": "cd discord-bot-one",
"addpay": "",
"append": "",
"useSpawn": "false",
"timer": "",
"winHide": false,
"oldrc": false,
"name": "",
"x": 510,
"y": 500,
"wires": [
[],
[
"e603bb071891dc24"
],
[]
]
},
{
"id": "e603bb071891dc24",
"type": "exec",
"z": "60cf67e173ed3e74",
"command": "python3 musicPlayer.py",
"addpay": "",
"append": "",
"useSpawn": "false",
"timer": "",
"winHide": false,
"oldrc": false,
"name": "",
"x": 750,
"y": 500,
"wires": [
[],
[],
[]
]
},
{
"id": "169422d2.3157e5",
"type": "inject",
"z": "60cf67e173ed3e74",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "\"Distance: 69cm\\n\"",
"payloadType": "json",
"x": 350,
"y": 720,
"wires": [
[
"9a611463.ab80c8"
]
]
},
{
"id": "33cb67c6.2c46e8",
"type": "switch",
"z": "60cf67e173ed3e74",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "20",
"vt": "num"
},
{
"t": "gt",
"v": "60",
"vt": "num"
},
{
"t": "gt",
"v": "100",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 3,
"x": 790,
"y": 720,
"wires": [
[
"56c76e80.e86208"
],
[
"c242e13a.006e58"
],
[
"2c28dfc2.5636d"
]
]
},
{
"id": "9a611463.ab80c8",
"type": "change",
"z": "60cf67e173ed3e74",
"name": "convertToNumber",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "$match(payload, /\\d+/).match ~> $number",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 570,
"y": 720,
"wires": [
[
"33cb67c6.2c46e8"
]
]
},
{
"id": "4ab23ba8.f66c1c",
"type": "inject",
"z": "60cf67e173ed3e74",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "\"Distance: 144cm\\n\"",
"payloadType": "json",
"x": 350,
"y": 760,
"wires": [
[
"9a611463.ab80c8"
]
]
},
{
"id": "56c76e80.e86208",
"type": "debug",
"z": "60cf67e173ed3e74",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 950,
"y": 700,
"wires": []
},
{
"id": "c242e13a.006e58",
"type": "debug",
"z": "60cf67e173ed3e74",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 950,
"y": 740,
"wires": []
},
{
"id": "2c28dfc2.5636d",
"type": "debug",
"z": "60cf67e173ed3e74",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 950,
"y": 780,
"wires": []
},
{
"id": "e2f048968c3d7a0b",
"type": "inject",
"z": "60cf67e173ed3e74",
"name": "Shutdown",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "Distance: 20cm",
"payloadType": "str",
"x": 160,
"y": 1000,
"wires": [
[
"35a58c1abb9ccdc9"
]
]
},
{
"id": "35a58c1abb9ccdc9",
"type": "switch",
"z": "60cf67e173ed3e74",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "Distance: 20cm",
"vt": "str"
},
{
"t": "else"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 290,
"y": 1000,
"wires": [
[
"5ced84db8af8c5b7"
],
[]
]
},
{
"id": "1808531aabcb9fc2",
"type": "exec",
"z": "60cf67e173ed3e74",
"command": "mkdir ayoo",
"addpay": "",
"append": "",
"useSpawn": "false",
"timer": "",
"winHide": false,
"oldrc": false,
"name": "",
"x": 590,
"y": 1180,
"wires": [
[],
[],
[]
]
},
{
"id": "5ced84db8af8c5b7",
"type": "exec",
"z": "60cf67e173ed3e74",
"command": "sudo shutdown now",
"addpay": "",
"append": " ",
"useSpawn": "false",
"timer": "",
"winHide": false,
"oldrc": false,
"name": "",
"x": 460,
"y": 980,
"wires": [
[],
[],
[]
]
},
{
"id": "830ee7b453faecee",
"type": "serial in",
"z": "60cf67e173ed3e74",
"name": "Arduino Uno",
"serial": "4f56b568bc65e2cd",
"x": 290,
"y": 340,
"wires": [
[
"9fc033063aefec68"
]
]
},
{
"id": "327d4cdc2343bd8b",
"type": "inject",
"z": "60cf67e173ed3e74",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "Distance: 20cm",
"payloadType": "str",
"x": 680,
"y": 140,
"wires": [
[
"a327079557ed0ecf"
]
]
},
{
"id": "a327079557ed0ecf",
"type": "switch",
"z": "60cf67e173ed3e74",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "Distance: 20cm",
"vt": "str"
},
{
"t": "else"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 920,
"y": 200,
"wires": [
[
"55930c3cd6880ad0"
],
[
"a9084ac8e452b4cc"
]
]
},
{
"id": "a9084ac8e452b4cc",
"type": "debug",
"z": "60cf67e173ed3e74",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1170,
"y": 260,
"wires": []
},
{
"id": "490d9ee71c4b326f",
"type": "inject",
"z": "60cf67e173ed3e74",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "Distance: 99cm",
"payloadType": "str",
"x": 700,
"y": 260,
"wires": [
[
"a327079557ed0ecf"
]
]
},
{
"id": "f5a24019efb82879",
"type": "debug",
"z": "60cf67e173ed3e74",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1310,
"y": 140,
"wires": []
},
{
"id": "43aa5375e45afe7f",
"type": "debug",
"z": "60cf67e173ed3e74",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1310,
"y": 180,
"wires": []
},
{
"id": "8eaeac2f8fa14fbb",
"type": "debug",
"z": "60cf67e173ed3e74",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1310,
"y": 220,
"wires": []
},
{
"id": "55930c3cd6880ad0",
"type": "exec",
"z": "60cf67e173ed3e74",
"command": "mkdir helloworld",
"addpay": "",
"append": "",
"useSpawn": "false",
"timer": "",
"winHide": false,
"oldrc": false,
"name": "",
"x": 1000,
"y": 80,
"wires": [
[],
[
"8175d9847bf2ee44"
],
[]
]
},
{
"id": "8175d9847bf2ee44",
"type": "switch",
"z": "60cf67e173ed3e74",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "cd discord-bot-one",
"vt": "str"
},
{
"t": "else"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 1190,
"y": 80,
"wires": [
[
"f20226285ae307ed"
],
[]
]
},
{
"id": "f20226285ae307ed",
"type": "exec",
"z": "60cf67e173ed3e74",
"command": "mkdir helloworld",
"addpay": "",
"append": "",
"useSpawn": "false",
"timer": "",
"winHide": false,
"oldrc": false,
"name": "",
"x": 1360,
"y": 80,
"wires": [
[],
[],
[ ]
]
}
]