Skip to content

Instantly share code, notes, and snippets.

@jadonk
Last active October 27, 2020 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jadonk/f6440b4bf3f13e3142597c6f805ce6d8 to your computer and use it in GitHub Desktop.
Save jadonk/f6440b4bf3f13e3142597c6f805ce6d8 to your computer and use it in GitHub Desktop.
[
{
"id": "582e31fd.66c078",
"type": "tab",
"label": "Sensor Node #1",
"disabled": false,
"info": ""
},
{
"id": "5d6c92b.0dba3ec",
"type": "tab",
"label": "Live Dashboard",
"disabled": false,
"info": ""
},
{
"id": "4ebfde5f.7bc1d",
"type": "tab",
"label": "AWS Database Connection",
"disabled": false,
"info": ""
},
{
"id": "5ade3c3.22b27c4",
"type": "ui_tab",
"z": "",
"name": "Home",
"icon": "dashboard",
"disabled": false,
"hidden": true
},
{
"id": "5059cf4f.bd53b8",
"type": "ui_group",
"z": "",
"name": "Sensor Node #1",
"tab": "5ade3c3.22b27c4",
"order": 1,
"disp": true,
"width": "20",
"collapse": false
},
{
"id": "a26de4c7.caef8",
"type": "ui_base",
"theme": {
"name": "theme-light",
"lightTheme": {
"default": "#0094CE",
"baseColor": "#0094CE",
"baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif",
"edited": true,
"reset": false
},
"darkTheme": {
"default": "#097479",
"baseColor": "#097479",
"baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif",
"edited": false
},
"customTheme": {
"name": "Untitled Theme 1",
"default": "#4B7930",
"baseColor": "#4B7930",
"baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"
},
"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": "#1bbfff",
"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
},
"base-font": {
"value": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"
}
},
"angularTheme": {
"primary": "indigo",
"accents": "blue",
"warn": "red",
"background": "grey"
}
},
"site": {
"name": "Node-RED Dashboard",
"hideToolbar": "false",
"allowSwipe": "false",
"lockMenu": "false",
"allowTempTheme": "true",
"dateFormat": "DD/MM/YYYY",
"sizes": {
"sx": 48,
"sy": 48,
"gx": 6,
"gy": 6,
"cx": 6,
"cy": 6,
"px": 0,
"py": 0
}
}
},
{
"id": "69b52f7c.d550a8",
"type": "amazon config",
"z": "",
"name": "AWS air-quality-demo",
"region": "us-west-2",
"proxyRequired": false,
"proxy": ""
},
{
"id": "7d4d73f3.5726bc",
"type": "inject",
"z": "582e31fd.66c078",
"name": "",
"props": [
{
"p": "timestamp",
"v": "",
"vt": "date"
},
{
"p": "project",
"v": "bluenano1",
"vt": "str"
},
{
"p": "sensor",
"v": "node #1",
"vt": "str"
}
],
"repeat": "600",
"crontab": "",
"once": true,
"onceDelay": "2",
"topic": "",
"x": 120,
"y": 160,
"wires": [
[
"9f2d4f25.e52918",
"148c8396.d931dc"
]
]
},
{
"id": "9f2d4f25.e52918",
"type": "file in",
"z": "582e31fd.66c078",
"name": "Pressure",
"filename": "/sys/bus/iio/devices/iio:device0/in_pressure_input",
"format": "utf8",
"chunk": false,
"sendError": false,
"encoding": "none",
"x": 300,
"y": 160,
"wires": [
[
"dbe6ee8b.9a07"
]
]
},
{
"id": "9224baa0.2495e8",
"type": "file in",
"z": "582e31fd.66c078",
"name": "Humidity",
"filename": "/sys/bus/iio/devices/iio:device0/in_humidityrelative_input",
"format": "utf8",
"chunk": false,
"sendError": false,
"encoding": "none",
"x": 310,
"y": 280,
"wires": [
[
"a1692d94.37f7"
]
]
},
{
"id": "6df5dc80.e15154",
"type": "file in",
"z": "582e31fd.66c078",
"name": "Temperature",
"filename": "/sys/bus/iio/devices/iio:device0/in_temp_input",
"format": "utf8",
"chunk": false,
"sendError": false,
"encoding": "none",
"x": 310,
"y": 400,
"wires": [
[
"5530bf18.f38a38"
]
]
},
{
"id": "92b7376d.42ca78",
"type": "file in",
"z": "582e31fd.66c078",
"name": "Gas Resistance",
"filename": "/sys/bus/iio/devices/iio:device0/in_resistance_input",
"format": "utf8",
"chunk": false,
"sendError": false,
"encoding": "none",
"x": 330,
"y": 520,
"wires": [
[
"4e390bda.20aa9c"
]
]
},
{
"id": "6292b9c4.9c7c68",
"type": "file in",
"z": "582e31fd.66c078",
"name": "CO2 Concentration",
"filename": "/sys/bus/iio/devices/iio:device1/in_concentration_co2_input",
"format": "utf8",
"chunk": false,
"sendError": false,
"encoding": "none",
"x": 350,
"y": 640,
"wires": [
[
"62cb3c22.f16094"
]
]
},
{
"id": "af8a8e07.52c568",
"type": "file in",
"z": "582e31fd.66c078",
"name": "VOC Concentration",
"filename": "/sys/bus/iio/devices/iio:device1/in_concentration_voc_input",
"format": "utf8",
"chunk": false,
"sendError": false,
"encoding": "none",
"x": 350,
"y": 760,
"wires": [
[
"28a1edfd.124e0a"
]
]
},
{
"id": "1d8b3ca7.f32e5b",
"type": "file in",
"z": "582e31fd.66c078",
"name": "H2 Concentration",
"filename": "/sys/bus/iio/devices/iio:device1/in_concentration_h2_raw",
"format": "utf8",
"chunk": false,
"sendError": false,
"encoding": "none",
"x": 350,
"y": 880,
"wires": [
[
"cc50fb8e.3c68e8"
]
]
},
{
"id": "a5755b8.5038a28",
"type": "file in",
"z": "582e31fd.66c078",
"name": "Ethanol Concentration",
"filename": "/sys/bus/iio/devices/iio:device1/in_concentration_ethanol_raw",
"format": "utf8",
"chunk": false,
"sendError": false,
"encoding": "none",
"x": 360,
"y": 1000,
"wires": [
[
"d46639ae.66783"
]
]
},
{
"id": "148c8396.d931dc",
"type": "debug",
"z": "582e31fd.66c078",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 320,
"y": 80,
"wires": []
},
{
"id": "dbe6ee8b.9a07",
"type": "change",
"z": "582e31fd.66c078",
"name": "pressure",
"rules": [
{
"t": "set",
"p": "pressure",
"pt": "msg",
"to": "$number($trim(msg.payload))",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 480,
"y": 160,
"wires": [
[
"9224baa0.2495e8"
]
]
},
{
"id": "faa55462.10e71",
"type": "ui_chart",
"z": "5d6c92b.0dba3ec",
"name": "Pressure",
"group": "5059cf4f.bd53b8",
"order": 0,
"width": "5",
"height": "4",
"label": "Pressure",
"chartType": "line",
"legend": "false",
"xformat": "HH:mm:ss",
"interpolate": "linear",
"nodata": "",
"dot": false,
"ymin": "",
"ymax": "",
"removeOlder": "24",
"removeOlderPoints": "",
"removeOlderUnit": "3600",
"cutout": 0,
"useOneColor": false,
"useUTC": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"useOldStyle": false,
"outputs": 1,
"x": 420,
"y": 140,
"wires": [
[]
]
},
{
"id": "af8ddfc6.4013a8",
"type": "ui_chart",
"z": "5d6c92b.0dba3ec",
"name": "Humidity",
"group": "5059cf4f.bd53b8",
"order": 0,
"width": "5",
"height": "4",
"label": "Humidity",
"chartType": "line",
"legend": "false",
"xformat": "HH:mm:ss",
"interpolate": "linear",
"nodata": "",
"dot": false,
"ymin": "0",
"ymax": "100",
"removeOlder": "24",
"removeOlderPoints": "",
"removeOlderUnit": "3600",
"cutout": 0,
"useOneColor": false,
"useUTC": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"useOldStyle": false,
"outputs": 1,
"x": 420,
"y": 200,
"wires": [
[]
]
},
{
"id": "a1692d94.37f7",
"type": "change",
"z": "582e31fd.66c078",
"name": "humidity",
"rules": [
{
"t": "set",
"p": "humidity",
"pt": "msg",
"to": "$number($trim(msg.payload))",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 480,
"y": 280,
"wires": [
[
"6df5dc80.e15154"
]
]
},
{
"id": "693781b.8f0bd8",
"type": "ui_chart",
"z": "5d6c92b.0dba3ec",
"name": "Temperature",
"group": "5059cf4f.bd53b8",
"order": 0,
"width": "5",
"height": "4",
"label": "Temperature",
"chartType": "line",
"legend": "false",
"xformat": "HH:mm:ss",
"interpolate": "linear",
"nodata": "",
"dot": false,
"ymin": "18000",
"ymax": "28000",
"removeOlder": "24",
"removeOlderPoints": "",
"removeOlderUnit": "3600",
"cutout": 0,
"useOneColor": false,
"useUTC": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"useOldStyle": false,
"outputs": 1,
"x": 430,
"y": 260,
"wires": [
[]
]
},
{
"id": "a3230dd9.5bb07",
"type": "ui_chart",
"z": "5d6c92b.0dba3ec",
"name": "Gas Resistance",
"group": "5059cf4f.bd53b8",
"order": 0,
"width": "5",
"height": "4",
"label": "Gas Resistance",
"chartType": "line",
"legend": "false",
"xformat": "HH:mm:ss",
"interpolate": "linear",
"nodata": "",
"dot": false,
"ymin": "",
"ymax": "",
"removeOlder": "24",
"removeOlderPoints": "",
"removeOlderUnit": "3600",
"cutout": 0,
"useOneColor": false,
"useUTC": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"useOldStyle": false,
"outputs": 1,
"x": 440,
"y": 320,
"wires": [
[]
]
},
{
"id": "a688ef8a.c563b8",
"type": "ui_chart",
"z": "5d6c92b.0dba3ec",
"name": "CO2 Concentration",
"group": "5059cf4f.bd53b8",
"order": 0,
"width": "5",
"height": "4",
"label": "CO2 Concentration",
"chartType": "line",
"legend": "false",
"xformat": "HH:mm:ss",
"interpolate": "linear",
"nodata": "",
"dot": false,
"ymin": ".000300",
"ymax": ".001000",
"removeOlder": "24",
"removeOlderPoints": "",
"removeOlderUnit": "3600",
"cutout": 0,
"useOneColor": false,
"useUTC": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"useOldStyle": false,
"outputs": 1,
"x": 450,
"y": 380,
"wires": [
[]
]
},
{
"id": "64d21a19.47cbcc",
"type": "ui_chart",
"z": "5d6c92b.0dba3ec",
"name": "VOC Concentration",
"group": "5059cf4f.bd53b8",
"order": 0,
"width": "5",
"height": "4",
"label": "VOC Concentration",
"chartType": "line",
"legend": "false",
"xformat": "HH:mm:ss",
"interpolate": "linear",
"nodata": "",
"dot": false,
"ymin": "0",
"ymax": "",
"removeOlder": "24",
"removeOlderPoints": "",
"removeOlderUnit": "3600",
"cutout": 0,
"useOneColor": false,
"useUTC": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"useOldStyle": false,
"outputs": 1,
"x": 450,
"y": 440,
"wires": [
[]
]
},
{
"id": "5192aa9b.177364",
"type": "ui_chart",
"z": "5d6c92b.0dba3ec",
"name": "H2 Concentration",
"group": "5059cf4f.bd53b8",
"order": 0,
"width": "5",
"height": "4",
"label": "H2 Concentration",
"chartType": "line",
"legend": "false",
"xformat": "HH:mm:ss",
"interpolate": "linear",
"nodata": "",
"dot": false,
"ymin": "0",
"ymax": "",
"removeOlder": "24",
"removeOlderPoints": "",
"removeOlderUnit": "3600",
"cutout": 0,
"useOneColor": false,
"useUTC": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"useOldStyle": false,
"outputs": 1,
"x": 450,
"y": 500,
"wires": [
[]
]
},
{
"id": "624c16d8.7a3c98",
"type": "ui_chart",
"z": "5d6c92b.0dba3ec",
"name": "Ethanol Concentration",
"group": "5059cf4f.bd53b8",
"order": 0,
"width": "5",
"height": "4",
"label": "Ethanol Concentration",
"chartType": "line",
"legend": "false",
"xformat": "HH:mm:ss",
"interpolate": "linear",
"nodata": "",
"dot": false,
"ymin": "0",
"ymax": "",
"removeOlder": "24",
"removeOlderPoints": "",
"removeOlderUnit": "3600",
"cutout": 0,
"useOneColor": false,
"useUTC": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"useOldStyle": false,
"outputs": 1,
"x": 460,
"y": 560,
"wires": [
[]
]
},
{
"id": "5530bf18.f38a38",
"type": "change",
"z": "582e31fd.66c078",
"name": "temperature",
"rules": [
{
"t": "set",
"p": "temperature",
"pt": "msg",
"to": "$number($trim(msg.payload))",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 490,
"y": 400,
"wires": [
[
"92b7376d.42ca78",
"6292b9c4.9c7c68"
]
]
},
{
"id": "4e390bda.20aa9c",
"type": "change",
"z": "582e31fd.66c078",
"name": "gas",
"rules": [
{
"t": "set",
"p": "gas",
"pt": "msg",
"to": "$number($trim(msg.payload))",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 490,
"y": 520,
"wires": [
[]
]
},
{
"id": "62cb3c22.f16094",
"type": "change",
"z": "582e31fd.66c078",
"name": "carbon",
"rules": [
{
"t": "set",
"p": "carbon",
"pt": "msg",
"to": "$number($trim(msg.payload))",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 540,
"y": 640,
"wires": [
[
"af8a8e07.52c568"
]
]
},
{
"id": "28a1edfd.124e0a",
"type": "change",
"z": "582e31fd.66c078",
"name": "voc",
"rules": [
{
"t": "set",
"p": "voc",
"pt": "msg",
"to": "$number($trim(msg.payload))",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 530,
"y": 760,
"wires": [
[
"1d8b3ca7.f32e5b"
]
]
},
{
"id": "cc50fb8e.3c68e8",
"type": "change",
"z": "582e31fd.66c078",
"name": "hydrogen",
"rules": [
{
"t": "set",
"p": "hydrogen",
"pt": "msg",
"to": "$number($trim(msg.payload))",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 540,
"y": 880,
"wires": [
[
"a5755b8.5038a28"
]
]
},
{
"id": "d46639ae.66783",
"type": "change",
"z": "582e31fd.66c078",
"name": "ethanol",
"rules": [
{
"t": "set",
"p": "ethanol",
"pt": "msg",
"to": "$number($trim(msg.payload))",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 560,
"y": 1000,
"wires": [
[
"4d4d7b28.a0df3c"
]
]
},
{
"id": "60ff3a94.504e04",
"type": "link out",
"z": "582e31fd.66c078",
"name": "Node 1",
"links": [
"9015e8a9.a69608",
"b60d4537.a3297",
"25523e98.318392"
],
"x": 555,
"y": 1700,
"wires": []
},
{
"id": "e1f8c9e7.f7c148",
"type": "debug",
"z": "582e31fd.66c078",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 550,
"y": 1760,
"wires": []
},
{
"id": "b60d4537.a3297",
"type": "link in",
"z": "5d6c92b.0dba3ec",
"name": "",
"links": [
"60ff3a94.504e04"
],
"x": 295,
"y": 60,
"wires": [
[
"48412bfb.2d0734"
]
]
},
{
"id": "48412bfb.2d0734",
"type": "split",
"z": "5d6c92b.0dba3ec",
"name": "",
"splt": "\\n",
"spltType": "str",
"arraySplt": 1,
"arraySpltType": "len",
"stream": false,
"addname": "key",
"x": 190,
"y": 200,
"wires": [
[
"e76c1fc4.0c627",
"bfa3f6a0.377788"
]
]
},
{
"id": "e76c1fc4.0c627",
"type": "switch",
"z": "5d6c92b.0dba3ec",
"name": "",
"property": "key",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "pressure",
"vt": "str"
},
{
"t": "eq",
"v": "humidity",
"vt": "str"
},
{
"t": "eq",
"v": "temperature",
"vt": "str"
},
{
"t": "eq",
"v": "gas",
"vt": "str"
},
{
"t": "eq",
"v": "carbon",
"vt": "str"
},
{
"t": "eq",
"v": "voc",
"vt": "str"
},
{
"t": "eq",
"v": "hydrogen",
"vt": "str"
},
{
"t": "eq",
"v": "ethanol",
"vt": "str"
},
{
"t": "eq",
"v": "pm1",
"vt": "str"
},
{
"t": "eq",
"v": "pm2p5",
"vt": "str"
},
{
"t": "eq",
"v": "pm10",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 11,
"x": 230,
"y": 320,
"wires": [
[
"faa55462.10e71"
],
[
"af8ddfc6.4013a8"
],
[
"693781b.8f0bd8"
],
[
"a3230dd9.5bb07"
],
[
"a688ef8a.c563b8"
],
[
"64d21a19.47cbcc"
],
[
"5192aa9b.177364"
],
[
"624c16d8.7a3c98"
],
[
"94948998.2bd78"
],
[
"cf54ede.c90131"
],
[
"ba6edbec.413078"
]
]
},
{
"id": "bfa3f6a0.377788",
"type": "debug",
"z": "5d6c92b.0dba3ec",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 470,
"y": 80,
"wires": []
},
{
"id": "9015e8a9.a69608",
"type": "link in",
"z": "4ebfde5f.7bc1d",
"name": "",
"links": [
"60ff3a94.504e04"
],
"x": 235,
"y": 120,
"wires": [
[
"8b3a633a.8d0f08"
]
]
},
{
"id": "af81ddf4.635b08",
"type": "debug",
"z": "4ebfde5f.7bc1d",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 560,
"y": 300,
"wires": []
},
{
"id": "b5991ce7.1ae028",
"type": "debug",
"z": "4ebfde5f.7bc1d",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 570,
"y": 160,
"wires": []
},
{
"id": "8148cf57.f399b",
"type": "json",
"z": "582e31fd.66c078",
"name": "to Obj",
"property": "payload",
"action": "obj",
"pretty": false,
"x": 410,
"y": 1720,
"wires": [
[
"60ff3a94.504e04",
"e1f8c9e7.f7c148"
]
]
},
{
"id": "a749d8ae.a05ed",
"type": "change",
"z": "582e31fd.66c078",
"name": "msg to payload",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "msg",
"tot": "jsonata"
},
{
"t": "delete",
"p": "filename",
"pt": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 330,
"y": 1660,
"wires": [
[
"6645abe6.d09234"
]
]
},
{
"id": "6645abe6.d09234",
"type": "function",
"z": "582e31fd.66c078",
"name": "to JSON",
"func": "function refReplacer() {\n let m = new Map(), v= new Map(), init = null;\n\n return function(field, value) {\n let p= m.get(this) + (Array.isArray(this) ? `[${field}]` : '.' + field); \n let isComplex= value===Object(value)\n \n if (isComplex) m.set(value, p); \n \n let pp = v.get(value)||'';\n let path = p.replace(/undefined\\.\\.?/,'');\n //let val = pp ? `#REF:${pp[0]=='[' ? '$':'$.'}${pp}` : value;\n let val = pp ? undefined : value;\n\n //!init ? (init=value) : (val===init ? val=\"#REF:$\" : 0);\n !init ? (init=value) : (val===init ? val=undefined : 0);\n if(!pp && isComplex) v.set(value, path);\n \n return val;\n }\n}\n\nmsg.payload = JSON.stringify(msg.payload, refReplacer());\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 190,
"y": 1720,
"wires": [
[
"8148cf57.f399b"
]
]
},
{
"id": "8b3a633a.8d0f08",
"type": "function",
"z": "4ebfde5f.7bc1d",
"name": "Format Item for DynamoDB",
"func": "msg.Item = {\n \"project\" : { \"S\": msg.project.toString() },\n \"timestamp\" : { \"N\": msg.timestamp.toString() },\n \"description\" : { \"S\": \"sensor node 1\" },\n \"pressure\" : { \"N\": msg.pressure.toString() },\n \"humidity\" : { \"N\": msg.humidity.toString() },\n \"temperature\" : { \"N\": msg.temperature.toString() },\n //\"gas\" : { \"N\": msg.gas.toString() },\n \"carbon\" : { \"N\": msg.carbon.toString() },\n \"voc\" : { \"N\": msg.voc.toString() },\n \"hydrogen\" : { \"N\": msg.hydrogen.toString() },\n \"ethanol\" : { \"N\": msg.ethanol.toString() },\n \"pm1\" : { \"N\": msg.pm1.toString() },\n \"pm2p5\" : { \"N\": msg.pm2p5.toString() },\n \"pm10\" : { \"N\": msg.pm10.toString() },\n};\nmsg.TableName = \"air-quality-demo\";\nmsg.ReturnValues = \"ALL_OLD\";\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 380,
"y": 220,
"wires": [
[
"b5991ce7.1ae028",
"f6533a85.b29928"
]
]
},
{
"id": "f6533a85.b29928",
"type": "AWS DynamoDB",
"z": "4ebfde5f.7bc1d",
"aws": "69b52f7c.d550a8",
"operation": "PutItem",
"RequestItems": "",
"TableName": "",
"BackupName": "",
"GlobalTableName": "",
"ReplicationGroup": "",
"AttributeDefinitions": "",
"KeySchema": "",
"ProvisionedThroughput": "",
"BackupArn": "",
"Key": "",
"ResourceArn": "",
"Item": "",
"TargetTableName": "",
"SourceTableName": "",
"Tags": "",
"TagKeys": "",
"PointInTimeRecoverySpecification": "",
"ReplicaUpdates": "",
"TimeToLiveSpecification": "",
"name": "PutItem air-quality-demo",
"x": 240,
"y": 380,
"wires": [
[
"af81ddf4.635b08"
],
[
"cebf7021.2ff9a"
]
]
},
{
"id": "cebf7021.2ff9a",
"type": "debug",
"z": "4ebfde5f.7bc1d",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 510,
"y": 400,
"wires": []
},
{
"id": "2a4d7e7a.3be1d2",
"type": "file",
"z": "582e31fd.66c078",
"name": "",
"filename": "/sys/bus/i2c/devices/i2c-3/new_device",
"appendNewline": true,
"createDir": false,
"overwriteFile": "true",
"encoding": "none",
"x": 910,
"y": 280,
"wires": [
[]
]
},
{
"id": "e906b932.f5a97",
"type": "inject",
"z": "582e31fd.66c078",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "bme680 0x76",
"payloadType": "str",
"x": 840,
"y": 220,
"wires": [
[
"2a4d7e7a.3be1d2"
]
]
},
{
"id": "b33552a4.a97328",
"type": "file",
"z": "582e31fd.66c078",
"name": "",
"filename": "/sys/bus/i2c/devices/i2c-3/new_device",
"appendNewline": true,
"createDir": false,
"overwriteFile": "true",
"encoding": "none",
"x": 890,
"y": 500,
"wires": [
[]
]
},
{
"id": "8818c590.a5d1d",
"type": "inject",
"z": "582e31fd.66c078",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": "0.2",
"topic": "",
"payload": "sgp30 0x58",
"payloadType": "str",
"x": 810,
"y": 440,
"wires": [
[
"b33552a4.a97328"
]
]
},
{
"id": "4d4d7b28.a0df3c",
"type": "file in",
"z": "582e31fd.66c078",
"name": "Mass Concentration PM1",
"filename": "/sys/bus/iio/devices/iio:device2/in_massconcentration_pm1_input",
"format": "utf8",
"chunk": false,
"sendError": false,
"encoding": "none",
"x": 370,
"y": 1080,
"wires": [
[
"1546e549.cd16e3"
]
]
},
{
"id": "1617c28.f121fbe",
"type": "file in",
"z": "582e31fd.66c078",
"name": "Mass Concentration PM2.5",
"filename": "/sys/bus/iio/devices/iio:device2/in_massconcentration_pm2p5_input",
"format": "utf8",
"chunk": false,
"sendError": false,
"encoding": "none",
"x": 380,
"y": 1180,
"wires": [
[
"4647a604.49732"
]
]
},
{
"id": "7bf09623.4fed08",
"type": "file in",
"z": "582e31fd.66c078",
"name": "Mass Concentration PM10",
"filename": "/sys/bus/iio/devices/iio:device2/in_massconcentration_pm10_input",
"format": "utf8",
"chunk": false,
"sendError": false,
"encoding": "none",
"x": 380,
"y": 1280,
"wires": [
[
"16a2c0c2.966b6f"
]
]
},
{
"id": "1546e549.cd16e3",
"type": "change",
"z": "582e31fd.66c078",
"name": "pm1",
"rules": [
{
"t": "set",
"p": "pm1",
"pt": "msg",
"to": "$number($trim(msg.payload))",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 590,
"y": 1080,
"wires": [
[
"1617c28.f121fbe"
]
]
},
{
"id": "4647a604.49732",
"type": "change",
"z": "582e31fd.66c078",
"name": "pm2p5",
"rules": [
{
"t": "set",
"p": "pm2p5",
"pt": "msg",
"to": "$number($trim(msg.payload))",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 590,
"y": 1180,
"wires": [
[
"7bf09623.4fed08"
]
]
},
{
"id": "16a2c0c2.966b6f",
"type": "change",
"z": "582e31fd.66c078",
"name": "pm10",
"rules": [
{
"t": "set",
"p": "pm10",
"pt": "msg",
"to": "$number($trim(msg.payload))",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 610,
"y": 1280,
"wires": [
[
"a749d8ae.a05ed"
]
]
},
{
"id": "94948998.2bd78",
"type": "ui_chart",
"z": "5d6c92b.0dba3ec",
"name": "PM1 Concentration",
"group": "5059cf4f.bd53b8",
"order": 0,
"width": "5",
"height": "4",
"label": "PM1 Concentration",
"chartType": "line",
"legend": "false",
"xformat": "HH:mm:ss",
"interpolate": "linear",
"nodata": "",
"dot": false,
"ymin": "0",
"ymax": "",
"removeOlder": "24",
"removeOlderPoints": "",
"removeOlderUnit": "3600",
"cutout": 0,
"useOneColor": false,
"useUTC": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"useOldStyle": false,
"outputs": 1,
"x": 450,
"y": 620,
"wires": [
[]
]
},
{
"id": "cf54ede.c90131",
"type": "ui_chart",
"z": "5d6c92b.0dba3ec",
"name": "PM2.5 Concentration",
"group": "5059cf4f.bd53b8",
"order": 0,
"width": "5",
"height": "4",
"label": "PM2.5 Concentration",
"chartType": "line",
"legend": "false",
"xformat": "HH:mm:ss",
"interpolate": "linear",
"nodata": "",
"dot": false,
"ymin": "0",
"ymax": "",
"removeOlder": "24",
"removeOlderPoints": "",
"removeOlderUnit": "3600",
"cutout": 0,
"useOneColor": false,
"useUTC": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"useOldStyle": false,
"outputs": 1,
"x": 460,
"y": 680,
"wires": [
[]
]
},
{
"id": "ba6edbec.413078",
"type": "ui_chart",
"z": "5d6c92b.0dba3ec",
"name": "PM10 Concentration",
"group": "5059cf4f.bd53b8",
"order": 0,
"width": "5",
"height": "4",
"label": "PM10 Concentration",
"chartType": "line",
"legend": "false",
"xformat": "HH:mm:ss",
"interpolate": "linear",
"nodata": "",
"dot": false,
"ymin": "0",
"ymax": "",
"removeOlder": "24",
"removeOlderPoints": "",
"removeOlderUnit": "3600",
"cutout": 0,
"useOneColor": false,
"useUTC": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"useOldStyle": false,
"outputs": 1,
"x": 460,
"y": 740,
"wires": [
[]
]
},
{
"id": "ffd99dd1.a2a748",
"type": "file",
"z": "582e31fd.66c078",
"name": "",
"filename": "/sys/bus/i2c/devices/i2c-3/new_device",
"appendNewline": true,
"createDir": false,
"overwriteFile": "true",
"encoding": "none",
"x": 870,
"y": 640,
"wires": [
[]
]
},
{
"id": "c74ef515.08b268",
"type": "inject",
"z": "582e31fd.66c078",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": "0.3",
"topic": "",
"payload": "hm3301 0x40",
"payloadType": "str",
"x": 790,
"y": 580,
"wires": [
[
"ffd99dd1.a2a748"
]
]
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment