[ { "type": "tab", "id": "6099285d.9f66d8", "label": "Tutorial1" }, { "type": "tab", "id": "ebe7946c.141868", "label": "Tutorial2" }, { "type": "tab", "id": "206a4ad5.df95b6", "label": "Makerspace" }, { "type": "tab", "id": "17070e01.e8f8f2", "label": "Sheet 1" }, { "type": "tab", "id": "14b8e8e5.eb4717", "label": "prototyper" }, { "type": "tab", "id": "77e1c188.881e4", "label": "node1" }, { "id": "2cd412cc.d32bee", "type": "subflow", "name": "Subflow 1", "in": [ { "x": 70, "y": 70, "wires": [] } ], "out": [ { "x": 667, "y": 425, "wires": [] }, { "x": 559, "y": 172, "wires": [ { "id": "2cd412cc.d32bee", "port": 0 } ] } ] }, { "id": "a4462e69.5bb9d", "type": "mqtt-broker", "broker": "space.makerspaceleiden.nl", "port": "1883", "clientid": "node1.aiko.sh" }, { "id": "d7663aaf.47194", "type": "arduino-board", "device": "/dev/ttyUSB0" }, { "id": "ca3c92a0.35c37", "type": "mqtt-broker", "broker": "node1.aiko.sh", "port": "1883", "clientid": "" }, { "id": "13257eec.669069", "type": "websocket-listener", "path": "/ws/stations", "wholemsg": "false" }, { "id": "7b9bfb4b.846404", "type": "mqtt-broker", "broker": "node1.aiko.sh", "port": "1883", "clientid": "node-red" }, { "id": "933109d6.6ccef8", "type": "inject", "name": "", "topic": "", "payload": "", "payloadType": "date", "repeat": "", "crontab": "", "once": false, "x": 107, "y": 51, "z": "6099285d.9f66d8", "wires": [ [ "438ad32f.bc752c" ] ] }, { "id": "7db4644.f824b9c", "type": "debug", "name": "", "active": true, "console": "false", "complete": "false", "x": 646, "y": 25, "z": "6099285d.9f66d8", "wires": [] }, { "id": "4c240132.b3dc", "type": "function", "name": "", "func": "// Create a Date object from the payload\nvar date = new Date(msg.payload);\n// Change the payload to be a formatted Date string\nmsg.payload = date.toString();\n// Return the message so it can be sent on\nreturn msg;", "outputs": 1, "valid": true, "x": 362, "y": 214, "z": "6099285d.9f66d8", "wires": [ [ "7db4644.f824b9c" ] ] }, { "id": "258ec189.da713e", "type": "inject", "name": "", "topic": "", "payload": "", "payloadType": "date", "repeat": "", "crontab": "", "once": false, "x": 98, "y": 71, "z": "ebe7946c.141868", "wires": [ [ "7839bcb9.87c644" ] ] }, { "id": "7839bcb9.87c644", "type": "http request", "name": "", "method": "GET", "ret": "txt", "url": "http://realtimeweb-prod.nationalgrid.com/SystemData.aspx", "x": 255, "y": 334, "z": "ebe7946c.141868", "wires": [ [ "eba3cc1d.145c3" ] ] }, { "id": "eba3cc1d.145c3", "type": "function", "name": "", "func": "\n// does a simple text extract parse of the http output to provide an\n// object containing the uk power demand, frequency and time\n\nif (~msg.payload.indexOf('\")[1].split(\"<\")[0]);\n msg.payload.frequency = parseFloat(fre.split(\">\")[1].split(\"<\")[0]);\n\n msg2 = {};\n msg2.payload = (msg.payload.frequency >= 50) ? true : false;\n\n return [msg,msg2];\n}\nreturn null;", "outputs": "2", "valid": true, "x": 437, "y": 549, "z": "ebe7946c.141868", "wires": [ [ "e6ac0ba4.1953f8", "2022fb0a.dfdd04" ], [ "cdf1251.f320ed8" ] ] }, { "id": "e6ac0ba4.1953f8", "type": "debug", "name": "", "active": true, "console": "false", "complete": "false", "x": 664, "y": 148, "z": "ebe7946c.141868", "wires": [] }, { "id": "cdf1251.f320ed8", "type": "debug", "name": "", "active": true, "console": "false", "complete": "false", "x": 658, "y": 673, "z": "ebe7946c.141868", "wires": [] }, { "id": "5111ab58.aeee54", "type": "debug", "name": "", "active": true, "console": "false", "complete": "payload", "x": 881, "y": 88, "z": "206a4ad5.df95b6", "wires": [] }, { "id": "2022fb0a.dfdd04", "type": "freeboard", "name": "demand/frequency", "x": 814, "y": 337, "z": "ebe7946c.141868", "wires": [] }, { "id": "b38975fe.4c7688", "type": "debug", "name": "", "active": true, "console": "false", "complete": "false", "x": 650, "y": 196, "z": "17070e01.e8f8f2", "wires": [] }, { "id": "4c3e5d60.b3c1a4", "type": "http request", "name": "version", "method": "GET", "ret": "obj", "url": "https://uat-opscentre.informaat-cxp.com/version", "x": 397, "y": 221, "z": "17070e01.e8f8f2", "wires": [ [ "b38975fe.4c7688", "f5d1da8a.0a2e28" ] ] }, { "id": "7fde5375.8021ac", "type": "inject", "name": "", "topic": "", "payload": "", "payloadType": "date", "repeat": "", "crontab": "", "once": false, "x": 200, "y": 140, "z": "17070e01.e8f8f2", "wires": [ [ "4c3e5d60.b3c1a4" ] ] }, { "id": "f5d1da8a.0a2e28", "type": "freeboard", "name": "version", "x": 659, "y": 322, "z": "17070e01.e8f8f2", "wires": [] }, { "id": "438ad32f.bc752c", "type": "snmp", "host": "nas.aiko.sh", "community": "public", "version": "1", "oids": "1.3.6.1.4.1.2021.11.9.0, 1.3.6.1.4.1.2021.11.10.0, 1.3.6.1.2.1.31.1.1.1.1.1", "name": "", "x": 278, "y": 483, "z": "6099285d.9f66d8", "wires": [ [ "54010b41.abfef4" ] ] }, { "id": "54010b41.abfef4", "type": "debug", "name": "", "active": true, "console": "false", "complete": "false", "x": 628, "y": 422, "z": "6099285d.9f66d8", "wires": [] }, { "id": "ab6bee99.54941", "type": "debug", "name": "", "active": true, "console": "false", "complete": "true", "x": 600, "y": 598, "z": "6099285d.9f66d8", "wires": [] }, { "id": "959b1dd0.6a64e", "type": "discovery", "name": "AFP sources", "topic": "", "service": "_afpovertcp._tcp", "x": 184, "y": 771, "z": "6099285d.9f66d8", "wires": [ [ "ab6bee99.54941" ] ] }, { "id": "5a6d25d0.a592dc", "type": "comment", "name": "AVAHI notes", "info": "* https://github.com/agnat/node_mdns/issues/104\n* http://www.noah.org/wiki/Avahi_Notes", "x": 185, "y": 808, "z": "6099285d.9f66d8", "wires": [] }, { "id": "bcda1072.4325f", "type": "comment", "name": "NAS snmp", "info": "* http://ukdl.synology.com/download/Document/MIBGuide/Synology_DiskStation_MIB_Guide.pdf", "x": 267, "y": 519, "z": "6099285d.9f66d8", "wires": [] }, { "id": "890dc688.76f238", "type": "arduino out", "name": "", "pin": "13", "state": "OUTPUT", "arduino": "", "x": 732, "y": 318.0000047683716, "z": "2cd412cc.d32bee", "wires": [] }, { "id": "65fd2a77.9a02d4", "type": "inject", "name": "tick", "topic": "", "payload": "", "payloadType": "date", "repeat": "0.5", "once": false, "x": 339.00000762939453, "y": 218, "z": "2cd412cc.d32bee", "wires": [ [ "2fe931de.d016ce" ] ] }, { "id": "2fe931de.d016ce", "type": "function", "name": "Toggle output on input", "func": "\n// initialise level as a context variable if currently undefined \n// (context variables persist between calls to the function)\ncontext.level = context.level || false;\n\n// if it's a 0 make it a 1 else make it a 0...\ncontext.level = !context.level;\n\n// set the payload to the level and return\nmsg.payload = context.level;\nreturn msg;", "outputs": 1, "valid": true, "x": 521.0000038146973, "y": 268.9999895095825, "z": "2cd412cc.d32bee", "wires": [ [ "890dc688.76f238" ] ] }, { "id": "92dbc8f4.6d2438", "type": "http in", "name": "", "url": "/mapstations", "method": "get", "x": 272, "y": 547, "z": "17070e01.e8f8f2", "wires": [ [ "877b9488.788468" ] ] }, { "id": "58de8e7d.a7217", "type": "http response", "name": "", "x": 621, "y": 544, "z": "17070e01.e8f8f2", "wires": [] }, { "id": "7745e2fd.88ba1c", "type": "http request", "name": "", "method": "GET", "url": "http://api.bart.gov/api/stn.aspx?cmd=stns&key=MW9S-E7SL-26DU-VV8V", "x": 425, "y": 639, "z": "17070e01.e8f8f2", "wires": [ [ "430be461.bcf41c" ] ] }, { "id": "430be461.bcf41c", "type": "xml", "name": "", "x": 578, "y": 639, "z": "17070e01.e8f8f2", "wires": [ [ "573512a3.a8caec" ] ] }, { "id": "877b9488.788468", "type": "template", "name": "", "field": "payload", "format": "html", "template": "\n\n \n \n \n Bart Stations\n \n \n \n \n \n
\n \n", "x": 456, "y": 546, "z": "17070e01.e8f8f2", "wires": [ [ "58de8e7d.a7217" ] ] }, { "id": "bf1e6d80.40e19", "type": "websocket in", "name": "", "server": "13257eec.669069", "x": 252, "y": 640, "z": "17070e01.e8f8f2", "wires": [ [ "7745e2fd.88ba1c" ] ] }, { "id": "573512a3.a8caec", "type": "websocket out", "name": "", "server": "13257eec.669069", "x": 763, "y": 639, "z": "17070e01.e8f8f2", "wires": [] }, { "id": "dcb3b8c6.234c48", "type": "mqtt in", "name": "", "topic": "prototyper/sensors/temp/cpu", "broker": "7b9bfb4b.846404", "x": 132, "y": 131, "z": "14b8e8e5.eb4717", "wires": [ [ "9ec2b694.613d48" ] ] }, { "id": "89493987.76b6c8", "type": "debug", "name": "", "active": true, "console": "false", "complete": "false", "x": 498, "y": 79, "z": "14b8e8e5.eb4717", "wires": [] }, { "id": "93531fa4.6cace", "type": "mqtt in", "name": "", "topic": "prototyper/status/uptime", "broker": "7b9bfb4b.846404", "x": 129, "y": 252, "z": "14b8e8e5.eb4717", "wires": [ [ "2b5ccd67.d4a332" ] ] }, { "id": "cc34952.f33cb68", "type": "mqtt in", "name": "", "topic": "prototyper/status/pm2", "broker": "7b9bfb4b.846404", "x": 120, "y": 361, "z": "14b8e8e5.eb4717", "wires": [ [ "fe42d1ff.01bd3" ] ] }, { "id": "43340c14.bccbf4", "type": "freeboard", "name": "prototyper-cpu", "x": 543, "y": 124, "z": "14b8e8e5.eb4717", "wires": [] }, { "id": "492a4e99.b6d5b", "type": "freeboard", "name": "prototyper-uptime", "x": 540, "y": 245, "z": "14b8e8e5.eb4717", "wires": [] }, { "id": "d4d9a328.2b266", "type": "freeboard", "name": "prototyper-pm2", "x": 535, "y": 366, "z": "14b8e8e5.eb4717", "wires": [] }, { "id": "fe42d1ff.01bd3", "type": "json", "name": "", "x": 341, "y": 367, "z": "14b8e8e5.eb4717", "wires": [ [ "d4d9a328.2b266" ] ] }, { "id": "2b5ccd67.d4a332", "type": "json", "name": "", "x": 337, "y": 252, "z": "14b8e8e5.eb4717", "wires": [ [ "492a4e99.b6d5b" ] ] }, { "id": "9ec2b694.613d48", "type": "json", "name": "", "x": 367, "y": 130, "z": "14b8e8e5.eb4717", "wires": [ [ "43340c14.bccbf4" ] ] }, { "id": "6cfed323.93012c", "type": "mqtt in", "name": "", "topic": "prototyper/status/loadavg", "broker": "7b9bfb4b.846404", "x": 120, "y": 443, "z": "14b8e8e5.eb4717", "wires": [ [ "240754b3.dbf8ac" ] ] }, { "id": "b98b8413.467478", "type": "freeboard", "name": "prototyper-loadavg", "x": 543, "y": 447, "z": "14b8e8e5.eb4717", "wires": [] }, { "id": "240754b3.dbf8ac", "type": "json", "name": "", "x": 337, "y": 447, "z": "14b8e8e5.eb4717", "wires": [ [ "b98b8413.467478" ] ] }, { "id": "18ae13e2.e751ec", "type": "mqtt in", "name": "", "topic": "prototyper/status/meminfo", "broker": "7b9bfb4b.846404", "x": 133, "y": 527, "z": "14b8e8e5.eb4717", "wires": [ [ "e9a010b3.165ff" ] ] }, { "id": "f08b1c6b.0f74e", "type": "freeboard", "name": "prototyper-meminfo", "x": 556, "y": 531, "z": "14b8e8e5.eb4717", "wires": [] }, { "id": "e9a010b3.165ff", "type": "json", "name": "", "x": 350, "y": 531, "z": "14b8e8e5.eb4717", "wires": [ [ "f08b1c6b.0f74e" ] ] }, { "id": "2d3ece06.d2c132", "type": "inject", "name": "", "topic": "", "payload": "", "payloadType": "none", "repeat": "60", "crontab": "", "once": false, "x": 101, "y": 117, "z": "77e1c188.881e4", "wires": [ [ "6639f12.f99c61" ] ] }, { "id": "6639f12.f99c61", "type": "exec", "command": "pm2", "addpay": true, "append": "jlist", "useSpawn": "", "name": "", "x": 299, "y": 125, "z": "77e1c188.881e4", "wires": [ [ "bfc5505d.403ab" ], [], [] ] }, { "id": "bfc5505d.403ab", "type": "json", "name": "", "x": 503, "y": 130, "z": "77e1c188.881e4", "wires": [ [ "a3e540e6.5c1ac" ] ] }, { "id": "a3e540e6.5c1ac", "type": "mqtt out", "name": "", "topic": "node1/status/pm2", "qos": "", "retain": "true", "broker": "ca3c92a0.35c37", "x": 776, "y": 129, "z": "77e1c188.881e4", "wires": [] }, { "id": "7354ef5f.8cab1", "type": "mqtt in", "name": "", "topic": "node1/status/pm2", "broker": "ca3c92a0.35c37", "x": 145, "y": 254, "z": "77e1c188.881e4", "wires": [ [ "b4c616bc.4b39e8" ] ] }, { "id": "ea12cfff.15ed3", "type": "freeboard", "name": "node1-pm2", "x": 560, "y": 259, "z": "77e1c188.881e4", "wires": [] }, { "id": "b4c616bc.4b39e8", "type": "json", "name": "", "x": 366, "y": 260, "z": "77e1c188.881e4", "wires": [ [ "ea12cfff.15ed3" ] ] }, { "id": "1851ac03.e7ae54", "type": "ping", "name": "", "host": "prototyper.local", "timer": "20", "x": 112, "y": 628, "z": "14b8e8e5.eb4717", "wires": [ [ "c83ce68.f37c318" ] ] }, { "id": "c83ce68.f37c318", "type": "freeboard", "name": "node1-prototyper-ping", "x": 534, "y": 632, "z": "14b8e8e5.eb4717", "wires": [] }, { "id": "397350ed.c68cb", "type": "comment", "name": "", "info": "makerspace/temp/cpu/pub-pi\nmakerspace/temp/cpu/sensor1\n", "x": 129, "y": 171, "z": "206a4ad5.df95b6", "wires": [] }, { "id": "32d19fe1.cd2e6", "type": "mqtt in", "name": "", "topic": "makerspace/temp/sensor1", "broker": "a4462e69.5bb9d", "x": 154, "y": 280, "z": "206a4ad5.df95b6", "wires": [ [ "b4973920.4b68c8" ] ] }, { "id": "b4973920.4b68c8", "type": "json", "name": "", "x": 392, "y": 287, "z": "206a4ad5.df95b6", "wires": [ [ "bfc135e2.403ec8" ] ] }, { "id": "26df406.fd920c", "type": "freeboard", "name": "makerspace-temp", "x": 788, "y": 278, "z": "206a4ad5.df95b6", "wires": [] }, { "id": "bfc135e2.403ec8", "type": "function", "name": "to C", "func": "var cpuTemp0=msg.payload;\nvar cpuTemp1=cpuTemp0/1000;\n\nmsg.payload={ \n degrees: cpuTemp1,\n raw: cpuTemp0\n};\n\nreturn msg;", "outputs": 1, "valid": true, "x": 577, "y": 290, "z": "206a4ad5.df95b6", "wires": [ [ "26df406.fd920c" ] ] } ]