-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflows_example.json
1 lines (1 loc) · 18.2 KB
/
flows_example.json
1
[{"id":"779c4728.e8a998","type":"tab","label":"Flow 2"},{"id":"eca319ef.c10158","type":"ui_tab","z":"","name":"Home","icon":"dashboard"},{"id":"af72de92.3d218","type":"ui_group","z":"","name":"Default","tab":"eca319ef.c10158","order":1,"disp":true,"width":"6"},{"id":"b9083c13.68cd7","type":"ui_group","z":"","name":"Temperature","tab":"eca319ef.c10158","order":2,"disp":true,"width":"6"},{"id":"c5351b22.29b438","type":"ui_group","z":"","name":"Light","tab":"eca319ef.c10158","order":4,"disp":true,"width":"6"},{"id":"d9cf0605.297548","type":"ui_group","z":"","name":"Accelerometer","tab":"eca319ef.c10158","order":5,"disp":true,"width":"6"},{"id":"a09f8bf5.08c808","type":"ui_base","theme":{"name":"theme-light","lightTheme":{"default":"#0094CE","baseColor":"#0094CE","baseFont":"Helvetica Neue","edited":true,"reset":false},"darkTheme":{"default":"#097479","baseColor":"#097479","baseFont":"Helvetica Neue","edited":false},"customTheme":{"name":"Untitled Theme 1","default":"#4B7930","baseColor":"#4B7930","baseFont":"Helvetica Neue"},"themeState":{"base-color":{"default":"#0094CE","value":"#0094CE","edited":false},"page-titlebar-backgroundColor":{"value":"#0094CE","edited":false},"page-backgroundColor":{"value":"#fafafa","edited":false},"page-sidebar-backgroundColor":{"value":"#ffffff","edited":false},"group-textColor":{"value":"#000000","edited":false},"group-borderColor":{"value":"#ffffff","edited":false},"group-backgroundColor":{"value":"#ffffff","edited":false},"widget-textColor":{"value":"#111111","edited":false},"widget-backgroundColor":{"value":"#0094ce","edited":false},"widget-borderColor":{"value":"#ffffff","edited":false}}},"site":{"name":"Node-RED Dashboard","hideToolbar":"false","allowSwipe":"false","dateFormat":"DD/MM/YYYY","sizes":{"sx":48,"sy":48,"gx":6,"gy":6,"cx":6,"cy":6,"px":0,"py":0}}},{"id":"b682daba.c46d58","type":"ui_group","z":"","name":"Humidity","tab":"eca319ef.c10158","order":3,"disp":true,"width":"6"},{"id":"2109da7d.3c9be6","type":"ui_text","z":"779c4728.e8a998","group":"af72de92.3d218","order":2,"width":0,"height":0,"name":"infoStackName","label":"Stack Name","format":"{{msg.payload}}","layout":"row-spread","x":866,"y":106,"wires":[]},{"id":"d708784.5660088","type":"coap request","z":"779c4728.e8a998","method":"GET","observe":false,"url":"coap://[bbbb:0:0:0:12:4b00:60d:97cb]:5683/i","content-format":"text/plain","raw-buffer":false,"name":"info_GET","x":327,"y":156,"wires":[["fc068de3.6e01b","94184352.32e7e"]]},{"id":"fc068de3.6e01b","type":"debug","z":"779c4728.e8a998","name":"info_output","active":true,"console":"false","complete":"true","x":558,"y":70,"wires":[]},{"id":"bbd5a2e.67e466","type":"ui_text","z":"779c4728.e8a998","group":"af72de92.3d218","order":3,"width":0,"height":0,"name":"boardname","label":"board","format":"{{msg.payload}}","layout":"row-spread","x":857,"y":142,"wires":[]},{"id":"f7f9b64a.df9438","type":"ui_text","z":"779c4728.e8a998","group":"af72de92.3d218","order":4,"width":0,"height":0,"name":"cpuName","label":"uC","format":"{{msg.payload}}","layout":"row-spread","x":847,"y":179,"wires":[]},{"id":"94184352.32e7e","type":"function","z":"779c4728.e8a998","name":"split info","func":"var infoArray = msg.payload.split('\\n')\n\nvar newMsg1 = { payload: infoArray[0] };\nvar newMsg2 = { payload: infoArray[1] };\nvar newMsg3 = { payload: infoArray[2] };\nvar newMsg4 = { payload: infoArray[3] };\nvar audioMsg1 = {payload: \"stack name \"+infoArray[0]};\nvar audioMsg2 = {payload: \"board name \"+infoArray[1]};\n\n\nreturn [audioMsg1, newMsg1, newMsg2,newMsg3, newMsg4,audioMsg2]","outputs":"6","noerr":0,"x":543,"y":155,"wires":[["725f938b.8afdac"],["2109da7d.3c9be6"],["bbd5a2e.67e466"],["f7f9b64a.df9438"],["1f9b72fd.71e0cd"],["8539ed26.94e26"]]},{"id":"1f9b72fd.71e0cd","type":"ui_text","z":"779c4728.e8a998","group":"af72de92.3d218","order":5,"width":0,"height":0,"name":"radioName","label":"radio","format":"{{msg.payload}}","layout":"row-spread","x":857,"y":216,"wires":[]},{"id":"5d372449.4c6cdc","type":"coap request","z":"779c4728.e8a998","method":"GET","observe":false,"url":"coap://[bbbb:0:0:0:12:4b00:60d:97cb]:5683/l","content-format":"text/plain","raw-buffer":false,"name":"led_GET","x":330,"y":329,"wires":[["641fa3bc.45f91c","1814883d.fc5dd8","bbedec86.e0e47"]]},{"id":"39ddea68.383376","type":"inject","z":"779c4728.e8a998","name":"","topic":"","payload":"","payloadType":"date","repeat":"10","crontab":"","once":false,"x":130,"y":329,"wires":[["5d372449.4c6cdc"]]},{"id":"641fa3bc.45f91c","type":"debug","z":"779c4728.e8a998","name":"led_GET","active":true,"console":"false","complete":"payload","x":523,"y":399,"wires":[]},{"id":"1814883d.fc5dd8","type":"ui_gauge","z":"779c4728.e8a998","name":"led status","group":"af72de92.3d218","order":9,"width":0,"height":0,"gtype":"donut","title":"led(red) status","label":"bool","format":"{{msg.payload}}","min":0,"max":"1","colors":["#00b500","#e6e600","#ca3838"],"x":850,"y":379,"wires":[]},{"id":"8ac3a5cd.a96f68","type":"coap request","z":"779c4728.e8a998","method":"GET","observe":false,"url":"coap://[bbbb:0:0:0:12:4b00:60d:97cb]:5683/s/x","content-format":"text/plain","raw-buffer":true,"name":"sensor_x_GET","x":328,"y":596,"wires":[["293e4e1f.17c482","3731a1e1.00142e"]]},{"id":"96e0cb31.ac5da8","type":"inject","z":"779c4728.e8a998","name":"","topic":"","payload":"","payloadType":"date","repeat":"20","crontab":"","once":false,"x":108,"y":596,"wires":[["8ac3a5cd.a96f68"]]},{"id":"3731a1e1.00142e","type":"debug","z":"779c4728.e8a998","name":"sensor_x_GET","active":true,"console":"false","complete":"true","x":632,"y":670,"wires":[]},{"id":"293e4e1f.17c482","type":"function","z":"779c4728.e8a998","name":"read data","func":"var acceleration = msg.payload[0]*256+msg.payload[1];\n\nif (acceleration > Math.pow(2,15)){\n acceleration = acceleration - Math.pow(2,16);\n \n}\n\nmsg.payload = acceleration;\nmsg.topic = \"x\";\nreturn msg;","outputs":"1","noerr":0,"x":610,"y":596,"wires":[["2372d4f6.3824bc","d0e10145.bf5a8"]]},{"id":"befe2dcf.436b1","type":"coap request","z":"779c4728.e8a998","method":"GET","observe":false,"url":"coap://[bbbb:0:0:0:12:4b00:60d:97cb]:5683/s/y","content-format":"text/plain","raw-buffer":true,"name":"sensor_y_GET","x":324,"y":744,"wires":[["90e77ad4.2d41b8","58cea027.67b9e"]]},{"id":"bbf49bb6.c307e8","type":"inject","z":"779c4728.e8a998","name":"","topic":"","payload":"","payloadType":"date","repeat":"20","crontab":"","once":false,"x":112,"y":743,"wires":[["befe2dcf.436b1"]]},{"id":"90e77ad4.2d41b8","type":"debug","z":"779c4728.e8a998","name":"sensor_y_GET","active":true,"console":"false","complete":"true","x":628,"y":818,"wires":[]},{"id":"ca5814f.d659ae8","type":"coap request","z":"779c4728.e8a998","method":"GET","observe":false,"url":"coap://[bbbb:0:0:0:12:4b00:60d:97cb]:5683/s/z","content-format":"text/plain","raw-buffer":true,"name":"sensor_z_GET","x":319,"y":890,"wires":[["69b637de.a900e8","65c3e659.949028"]]},{"id":"220cf7e5.250aa8","type":"inject","z":"779c4728.e8a998","name":"","topic":"","payload":"","payloadType":"date","repeat":"20","crontab":"","once":false,"x":106,"y":890,"wires":[["ca5814f.d659ae8"]]},{"id":"69b637de.a900e8","type":"debug","z":"779c4728.e8a998","name":"sensor_z_GET","active":true,"console":"false","complete":"true","x":623,"y":964,"wires":[]},{"id":"65c3e659.949028","type":"function","z":"779c4728.e8a998","name":"read data","func":"var acceleration = msg.payload[0]*256+msg.payload[1];\n\nif (acceleration > Math.pow(2,15)){\n acceleration = acceleration - Math.pow(2,16);\n \n}\n\nmsg.payload = acceleration;\nmsg.topic = \"z\";\nreturn msg;","outputs":1,"noerr":0,"x":601,"y":890,"wires":[["2372d4f6.3824bc"]]},{"id":"58cea027.67b9e","type":"function","z":"779c4728.e8a998","name":"read data","func":"var acceleration = msg.payload[0]*256+msg.payload[1];\n\nif (acceleration > Math.pow(2,15)){\n acceleration = acceleration - Math.pow(2,16);\n \n}\n\nmsg.payload = acceleration;\nmsg.topic = \"y\";\nreturn msg;","outputs":1,"noerr":0,"x":606,"y":744,"wires":[["2372d4f6.3824bc"]]},{"id":"2372d4f6.3824bc","type":"ui_chart","z":"779c4728.e8a998","name":"accelerometer","group":"d9cf0605.297548","order":0,"width":0,"height":0,"label":"3-axis output","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","ymin":"","ymax":"","removeOlder":"5","removeOlderPoints":"","removeOlderUnit":"60","cutout":0,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9665be","#c5b0d5"],"x":979,"y":747,"wires":[[],[]]},{"id":"725f938b.8afdac","type":"ui_audio","z":"779c4728.e8a998","name":"speaker","group":"af72de92.3d218","voice":"2","always":true,"x":1087,"y":33,"wires":[]},{"id":"bbedec86.e0e47","type":"ui_chart","z":"779c4728.e8a998","name":"led staus","group":"af72de92.3d218","order":7,"width":0,"height":0,"label":"led staus","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","ymin":"0","ymax":"1","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"x":847,"y":326,"wires":[[],[]]},{"id":"d0e10145.bf5a8","type":"debug","z":"779c4728.e8a998","name":"","active":true,"console":"false","complete":"false","x":957,"y":597,"wires":[]},{"id":"67e5b8f6.9a88b8","type":"coap request","z":"779c4728.e8a998","method":"GET","observe":false,"url":"coap://[bbbb:0:0:0:12:4b00:60d:97cb]:5683/s/l","content-format":"text/plain","raw-buffer":true,"name":"sensor_light_GET","x":334,"y":1081,"wires":[["3de50e2a.f0e0f2","c922b6bb.2b8a68"]]},{"id":"cd8963bb.14d5e","type":"inject","z":"779c4728.e8a998","name":"","topic":"","payload":"","payloadType":"date","repeat":"30","crontab":"","once":false,"x":104,"y":1081,"wires":[["67e5b8f6.9a88b8"]]},{"id":"c922b6bb.2b8a68","type":"debug","z":"779c4728.e8a998","name":"sensor_light_GET","active":true,"console":"false","complete":"true","x":638,"y":1155,"wires":[]},{"id":"e0a48406.9d0268","type":"ui_gauge","z":"779c4728.e8a998","name":"Light","group":"c5351b22.29b438","order":0,"width":0,"height":0,"gtype":"donut","title":"Sensor Light","label":"lux","format":"{{value}}","min":0,"max":"600","colors":["#00b500","#e6e600","#ca3838"],"x":842,"y":1080,"wires":[]},{"id":"3de50e2a.f0e0f2","type":"function","z":"779c4728.e8a998","name":"read sensor light","func":"var lux = msg.payload[0]*256+msg.payload[1];\n \nvar exponent, mantissa;\nvar result = 0.045;\n\nexponent = (lux >> 8) & 0xFF; \nexponent = (exponent == 0x0F ? exponent & 0x0E : exponent);\n\nmantissa = (lux >> 0) & 0xFF;\n \nresult *= Math.pow(2,exponent) * mantissa;\n \nmsg.payload = result.toFixed(2)\nreturn msg;","outputs":1,"noerr":0,"x":636,"y":1081,"wires":[["e0a48406.9d0268","d290c10a.acc06"]]},{"id":"d290c10a.acc06","type":"ui_chart","z":"779c4728.e8a998","name":"Light","group":"c5351b22.29b438","order":0,"width":0,"height":0,"label":"Light","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"step","nodata":"Waiting for first data","ymin":"0","ymax":"600","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"x":842,"y":1126,"wires":[[],[]]},{"id":"8539ed26.94e26","type":"delay","z":"779c4728.e8a998","name":"","pauseType":"delay","timeout":"4","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":850,"y":254,"wires":[["725f938b.8afdac"]]},{"id":"54adf2ed.7aef7c","type":"coap request","z":"779c4728.e8a998","method":"GET","observe":false,"url":"coap://[bbbb:0:0:0:12:4b00:60d:97cb]:5683/s/c","content-format":"text/plain","raw-buffer":true,"name":"cpu_temperature_GET","x":358,"y":1309,"wires":[["57589c70.e98714","bd8ddc88.805c7"]]},{"id":"6078d32d.13f5dc","type":"inject","z":"779c4728.e8a998","name":"","topic":"","payload":"","payloadType":"date","repeat":"30","crontab":"","once":false,"x":108,"y":1309,"wires":[["54adf2ed.7aef7c"]]},{"id":"bd8ddc88.805c7","type":"debug","z":"779c4728.e8a998","name":"cpu_temperature_GET","active":true,"console":"false","complete":"true","x":664,"y":1398,"wires":[]},{"id":"c8f3bf17.ad5b2","type":"ui_gauge","z":"779c4728.e8a998","name":"","group":"b9083c13.68cd7","order":1,"width":0,"height":0,"gtype":"gage","title":"CPU Temperature","label":"degree","format":"{{value}}","min":"0","max":"100","colors":["#00b500","#e6e600","#ca3838"],"x":878,"y":1273,"wires":[]},{"id":"57589c70.e98714","type":"function","z":"779c4728.e8a998","name":"read cpu temperature","func":"var CONST = 0.58134 //(VREF / 2047) = (1190 / 2047), VREF from Datasheet\nvar OFFSET_DATASHEET_25C = 827 // 1422*CONST, from Datasheet\nvar TEMP_COEFF = (CONST * 4.2) // From Datasheet\nvar OFFSET_0C = (OFFSET_DATASHEET_25C - (25 * TEMP_COEFF))\n\nvar cputemp= msg.payload[0]*256+msg.payload[1];\nvar dOutputVoltage = cputemp * CONST;\ndOutputVoltage = ((dOutputVoltage - OFFSET_0C) / TEMP_COEFF);\nmsg.payload = dOutputVoltage.toFixed(2)\nreturn msg;","outputs":"1","noerr":0,"x":645,"y":1308,"wires":[["c8f3bf17.ad5b2","d49d58c5.c8b9c8"]]},{"id":"9b266020.ea8e7","type":"coap request","z":"779c4728.e8a998","method":"GET","observe":false,"url":"coap://[bbbb:0:0:0:12:4b00:60d:97cb]:5683/s/t","content-format":"text/plain","raw-buffer":true,"name":"sensor_temperature_GET","x":369,"y":1452,"wires":[["56502cc4.2de754","d11beec6.f1297"]]},{"id":"ef2bb45e.1d75f8","type":"inject","z":"779c4728.e8a998","name":"","topic":"","payload":"","payloadType":"date","repeat":"30","crontab":"","once":false,"x":109,"y":1452,"wires":[["9b266020.ea8e7"]]},{"id":"d11beec6.f1297","type":"debug","z":"779c4728.e8a998","name":"sensor_temperature_GET","active":true,"console":"false","complete":"true","x":673,"y":1526,"wires":[]},{"id":"56502cc4.2de754","type":"function","z":"779c4728.e8a998","name":"read sensor temperature","func":"var temperature = msg.payload[0]*256+msg.payload[1];\nvar result = -46.85;\nresult += 175.72 * temperature / 65536;\n\nmsg.payload = result.toFixed(2)\nreturn msg;","outputs":1,"noerr":0,"x":661,"y":1452,"wires":[["fe0e66cf.4e2678"]]},{"id":"26edb642.0d89ca","type":"coap request","z":"779c4728.e8a998","method":"GET","observe":false,"url":"coap://[bbbb:0:0:0:12:4b00:60d:97cb]:5683/s/h","content-format":"text/plain","raw-buffer":true,"name":"sensor_humidity_GET","x":344,"y":1598,"wires":[["c833f5e1.407b68","9e404a07.507048"]]},{"id":"bd8cc9ce.499ba8","type":"inject","z":"779c4728.e8a998","name":"","topic":"","payload":"","payloadType":"date","repeat":"30","crontab":"","once":false,"x":104,"y":1598,"wires":[["26edb642.0d89ca"]]},{"id":"9e404a07.507048","type":"debug","z":"779c4728.e8a998","name":"sensor_humidity_GET","active":true,"console":"false","complete":"true","x":648,"y":1672,"wires":[]},{"id":"73934723.4fc9f8","type":"ui_gauge","z":"779c4728.e8a998","name":"Humidity","group":"b682daba.c46d58","order":0,"width":0,"height":0,"gtype":"wave","title":"Humidity","label":"%","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"x":852,"y":1597,"wires":[]},{"id":"c833f5e1.407b68","type":"function","z":"779c4728.e8a998","name":"read sensor humidity","func":"var humidity = msg.payload[0]*256+msg.payload[1];\nresult = -6.0;\nresult += 125.0 * humidity / 65536;\n\nmsg.payload = result.toFixed(2)\nreturn msg;","outputs":1,"noerr":0,"x":646,"y":1598,"wires":[["73934723.4fc9f8","b73d27c9.03c848"]]},{"id":"fe0e66cf.4e2678","type":"ui_gauge","z":"779c4728.e8a998","name":"Sensor Temperature","group":"b9083c13.68cd7","order":3,"width":0,"height":0,"gtype":"compass","title":"Sensor Temperature","label":"degree","format":"{{value}}","min":0,"max":"256","colors":["#00b500","#e6e600","#ca3838"],"x":891,"y":1452,"wires":[]},{"id":"d49d58c5.c8b9c8","type":"ui_chart","z":"779c4728.e8a998","name":"CPU Temperature","group":"b9083c13.68cd7","order":2,"width":0,"height":0,"label":"CPU Temperature","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","ymin":"0","ymax":"100","removeOlder":"10","removeOlderPoints":"","removeOlderUnit":"60","cutout":0,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"x":876,"y":1331,"wires":[[],[]]},{"id":"b73d27c9.03c848","type":"ui_chart","z":"779c4728.e8a998","name":"Humidity","group":"b682daba.c46d58","order":0,"width":0,"height":0,"label":"Humidity","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"step","nodata":"Waiting for first data","ymin":"0","ymax":"100","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"x":852,"y":1643,"wires":[[],[]]},{"id":"b86c28f6.ca1f78","type":"coap request","z":"779c4728.e8a998","method":"PUT","observe":false,"url":"coap://[bbbb:0:0:0:12:4b00:60d:97cb]:5683/l","content-format":"application/json","raw-buffer":false,"name":"set led status","x":539,"y":455,"wires":[[]]},{"id":"19b5b34a.977c6d","type":"delay","z":"779c4728.e8a998","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":332,"y":398,"wires":[["5d372449.4c6cdc"]]},{"id":"d9bc7d1d.70332","type":"debug","z":"779c4728.e8a998","name":"led_PUT","active":true,"console":"false","complete":"true","x":520,"y":507,"wires":[]},{"id":"56f982bb.b28bcc","type":"function","z":"779c4728.e8a998","name":"add header","func":"msg.headers = {\"content-type\" : \"application/json\"}\n\nif (msg.payload == true){\n msg.payload=1;\n} else {\n msg.payload=0;\n}\n\nreturn msg;","outputs":1,"noerr":0,"x":342,"y":455,"wires":[["b86c28f6.ca1f78","d9bc7d1d.70332"]]},{"id":"d30026d1.8f3a28","type":"ui_button","z":"779c4728.e8a998","name":"Get Board Info","group":"af72de92.3d218","order":1,"width":0,"height":0,"label":"Get Board Info","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":123,"y":156,"wires":[["d708784.5660088"]]},{"id":"806e5863.40ce78","type":"ui_switch","z":"779c4728.e8a998","name":"Set Led Status","label":"Led Switch","group":"af72de92.3d218","order":8,"width":0,"height":0,"passthru":true,"topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":123,"y":397,"wires":[["56f982bb.b28bcc","19b5b34a.977c6d"]]}]