[
{
"id": "eb90474bf03634f2",
"type": "tab",
"label": "Flow 4",
"disabled": false,
"info": "",
"env": []
},
{
"id": "6de91f63aebfaaa3",
"type": "function",
"z": "eb90474bf03634f2",
"name": "Convert to global",
"func": "global.set(\"tabletempG\", msg.payload);\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 450,
"y": 560,
"wires": [
[
"6dea5e38bd5f9cdf"
]
]
},
{
"id": "6fde2bdece836903",
"type": "function",
"z": "eb90474bf03634f2",
"name": "function 19",
"func": "var obtaindata0 = global.get(\"timestampG\");\nvar obtaindata1 = global.get(\"tabletempG\");\nvar obtaindata2 = global.get(\"tablehumiG\");\nvar obtaindata3 = global.get(\"tablewaterG\");\nvar obtaindata4 = global.get(\"tablerainfallG\");\nvar obtaindata5 = global.get(\"tableLEDG\");\n\n\nmsg.payload = [ \n {\n \"timestamp\": obtaindata0,\n \"temperature\": obtaindata1,\n \"humidity\": obtaindata2,\n \"waterlevel\": obtaindata3,\n \"rainfall\": obtaindata4,\n \"LED\": obtaindata5,\n }\n];\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 950,
"y": 840,
"wires": [
[
"db5af3dcfeacd63c",
"2068320627081e1e"
]
]
},
{
"id": "8383fb95606f8823",
"type": "function",
"z": "eb90474bf03634f2",
"name": "Convert to global",
"func": "global.set(\"tablehumiG\", msg.payload);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 450,
"y": 640,
"wires": [
[
"6dea5e38bd5f9cdf"
]
]
},
{
"id": "e3795e248eb51de9",
"type": "ui_table",
"z": "eb90474bf03634f2",
"group": "6f5566a6ee302091",
"name": "",
"order": 1,
"width": 18,
"height": 1,
"columns": [
{
"field": "timestamp",
"title": "Date & Time",
"width": "22%",
"align": "center",
"formatter": "plaintext",
"formatterParams": {
"target": "_blank"
}
},
{
"field": "temperature",
"title": "Temperature (°C)",
"width": "17%",
"align": "center",
"formatter": "plaintext",
"formatterParams": {
"target": "_blank"
}
},
{
"field": "humidity",
"title": "Relative Humidity (%)",
"width": "20%",
"align": "center",
"formatter": "plaintext",
"formatterParams": {
"target": "_blank"
}
},
{
"field": "waterlevel",
"title": "Water Level (m)",
"width": "17%",
"align": "center",
"formatter": "plaintext",
"formatterParams": {
"target": "_blank"
}
},
{
"field": "rainfall",
"title": "Rainfall (mm)",
"width": "14%",
"align": "center",
"formatter": "plaintext",
"formatterParams": {
"target": "_blank"
}
},
{
"field": "LED",
"title": "Motor",
"width": "10%",
"align": "center",
"formatter": "tickCross",
"formatterParams": {
"target": "_blank"
}
}
],
"outputs": 0,
"cts": false,
"x": 1410,
"y": 840,
"wires": []
},
{
"id": "6dea5e38bd5f9cdf",
"type": "join",
"z": "eb90474bf03634f2",
"name": "",
"mode": "custom",
"build": "object",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": false,
"timeout": "",
"count": "4",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "",
"reduceFixup": "",
"x": 730,
"y": 700,
"wires": [
[
"6fde2bdece836903"
]
]
},
{
"id": "b691d6c31a21d5da",
"type": "mqtt in",
"z": "eb90474bf03634f2",
"name": "",
"topic": "room/temperature",
"qos": "2",
"datatype": "auto-detect",
"broker": "fad0edd9443a7d21",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 230,
"y": 560,
"wires": [
[
"6de91f63aebfaaa3"
]
]
},
{
"id": "ad09411a554d6314",
"type": "mqtt in",
"z": "eb90474bf03634f2",
"name": "",
"topic": "room/RH",
"qos": "2",
"datatype": "auto-detect",
"broker": "fad0edd9443a7d21",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 260,
"y": 640,
"wires": [
[
"8383fb95606f8823"
]
]
},
{
"id": "280340dca8fd3f70",
"type": "mqtt in",
"z": "eb90474bf03634f2",
"name": "",
"topic": "room/rainfall",
"qos": "2",
"datatype": "auto-detect",
"broker": "fad0edd9443a7d21",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 250,
"y": 800,
"wires": [
[
"3d0ac081d960d2ca",
"2bb5565794518d2a"
]
]
},
{
"id": "98dc55f8397d8abc",
"type": "mqtt in",
"z": "eb90474bf03634f2",
"name": "",
"topic": "room/waterLevel",
"qos": "2",
"datatype": "auto-detect",
"broker": "fad0edd9443a7d21",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 240,
"y": 720,
"wires": [
[
"1215a45fb0e5b173"
]
]
},
{
"id": "434fd8dea6e37959",
"type": "mqtt in",
"z": "eb90474bf03634f2",
"name": "LED Status",
"topic": "room/ledstatus",
"qos": "2",
"datatype": "auto-detect",
"broker": "fad0edd9443a7d21",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 250,
"y": 920,
"wires": [
[
"fe079a0ed62fac27"
]
]
},
{
"id": "3d0ac081d960d2ca",
"type": "function",
"z": "eb90474bf03634f2",
"name": "Convert to global",
"func": "global.set(\"tablerainfallG\", msg.payload);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 450,
"y": 800,
"wires": [
[
"6dea5e38bd5f9cdf"
]
]
},
{
"id": "1215a45fb0e5b173",
"type": "function",
"z": "eb90474bf03634f2",
"name": "Convert to global",
"func": "global.set(\"tablewaterG\", msg.payload);\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 450,
"y": 720,
"wires": [
[
"6dea5e38bd5f9cdf"
]
]
},
{
"id": "f8bc32727f124d18",
"type": "function",
"z": "eb90474bf03634f2",
"name": "Convert to global",
"func": "global.set(\"tableLEDG\", msg.payload);\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 650,
"y": 920,
"wires": [
[
"6fde2bdece836903",
"d9eb80bdd775fdf7"
]
]
},
{
"id": "db5af3dcfeacd63c",
"type": "debug",
"z": "eb90474bf03634f2",
"name": "debug",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1250,
"y": 660,
"wires": []
},
{
"id": "4e746eb2a211b137",
"type": "function",
"z": "eb90474bf03634f2",
"name": "function 22",
"func": "var timestamp = msg.payload;\nvar time = new Date(timestamp).toLocaleString();\nglobal.set(\"timestampG\", time);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 690,
"y": 820,
"wires": [
[
"6fde2bdece836903"
]
]
},
{
"id": "2bb5565794518d2a",
"type": "change",
"z": "eb90474bf03634f2",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "",
"tot": "date"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 460,
"y": 860,
"wires": [
[
"4e746eb2a211b137"
]
]
},
{
"id": "2068320627081e1e",
"type": "change",
"z": "eb90474bf03634f2",
"name": "",
"rules": [
{
"t": "set",
"p": "payload.command",
"pt": "msg",
"to": "addRow",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1200,
"y": 840,
"wires": [
[
"e3795e248eb51de9"
]
]
},
{
"id": "fe079a0ed62fac27",
"type": "change",
"z": "eb90474bf03634f2",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "true",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 480,
"y": 980,
"wires": [
[
"f8bc32727f124d18",
"0df4b8c167ebe8d2"
]
]
},
{
"id": "0df4b8c167ebe8d2",
"type": "debug",
"z": "eb90474bf03634f2",
"name": "debug",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 650,
"y": 1020,
"wires": []
},
{
"id": "d9eb80bdd775fdf7",
"type": "debug",
"z": "eb90474bf03634f2",
"name": "debug",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 830,
"y": 960,
"wires": []
},
{
"id": "60e222c4d757a279",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 2,
"width": 24,
"height": 1
},
{
"id": "6c89683b55b89676",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 3,
"width": 24,
"height": 1
},
{
"id": "9030838e1ebf9689",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 7,
"width": 4,
"height": 1
},
{
"id": "0dfe63c881942f8f",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 9,
"width": 2,
"height": 1
},
{
"id": "d4989945c2af4f50",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 10,
"width": 4,
"height": 1
},
{
"id": "2b2386f4e8c633b2",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 11,
"width": 2,
"height": 1
},
{
"id": "74753ad4d37c922e",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 12,
"width": 4,
"height": 1
},
{
"id": "231dbbfff281e746",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 13,
"width": 2,
"height": 1
},
{
"id": "8ea5fa8b5094f2f9",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 14,
"width": 4,
"height": 1
},
{
"id": "c5f41f7f189e5b42",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 16,
"width": 2,
"height": 1
},
{
"id": "d5a85771e08f9bfc",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 18,
"width": 16,
"height": 1
},
{
"id": "4e15f060b9d2a8e7",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 19,
"width": 2,
"height": 1
},
{
"id": "1026abd9a1ed67db",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 20,
"width": 16,
"height": 1
},
{
"id": "f9f462bf9a0f0eeb",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 21,
"width": 2,
"height": 1
},
{
"id": "374f91fc665fa0d4",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 22,
"width": 16,
"height": 1
},
{
"id": "dbea46012e487e49",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 23,
"width": 2,
"height": 1
},
{
"id": "5c2a58d7d827062d",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 24,
"width": 24,
"height": 1
},
{
"id": "da0653eb586fccca",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 25,
"width": 22,
"height": 1
},
{
"id": "f3ef2be7e982037a",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 27,
"width": 2,
"height": 1
},
{
"id": "b23c901aaf9f33d8",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 30,
"width": 10,
"height": 1
},
{
"id": "63642963ec1463b5",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 31,
"width": 2,
"height": 1
},
{
"id": "1c1ef419726482bc",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 32,
"width": 10,
"height": 1
},
{
"id": "5a1347c3d5c51c2f",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 33,
"width": 2,
"height": 1
},
{
"id": "48b534a52ad735cb",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 34,
"width": 10,
"height": 1
},
{
"id": "71d0470bcfe757d9",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 35,
"width": 2,
"height": 1
},
{
"id": "a1793790a7159696",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 36,
"width": 12,
"height": 1
},
{
"id": "1dc04a783af09de6",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 38,
"width": 24,
"height": 1
},
{
"id": "873e27f8eaaea457",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 39,
"width": 24,
"height": 1
},
{
"id": "1e523d4aaa2addaf",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 40,
"width": 24,
"height": 1
},
{
"id": "9cce3a213f266c27",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 41,
"width": 24,
"height": 1
},
{
"id": "8f860374b003d18e",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 43,
"width": 24,
"height": 1
},
{
"id": "bfa7be5760d9b9e5",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 44,
"width": 24,
"height": 1
},
{
"id": "2d129f83c2d58eec",
"type": "ui_spacer",
"z": "eb90474bf03634f2",
"name": "spacer",
"group": "d5da3e9b.46abf",
"order": 45,
"width": 24,
"height": 1
},
{
"id": "6f5566a6ee302091",
"type": "ui_group",
"name": "Group 1",
"tab": "d6eb2d1eb564a3bc",
"order": 1,
"disp": true,
"width": 18
},
{
"id": "fad0edd9443a7d21",
"type": "mqtt-broker",
"name": "",
"broker": "91.121.93.94",
"port": "1883",
"clientid": "test-client",
"autoConnect": true,
"usetls": false,
"protocolVersion": "4",
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willPayload": "",
"willMsg": {},
"userProps": "",
"sessionExpiry": ""
},
{
"id": "d5da3e9b.46abf",
"type": "ui_group",
"name": "Sensor Node",
"tab": "",
"order": 2,
"disp": true,
"width": "30",
"collapse": false,
"className": ""
},
{
"id": "d6eb2d1eb564a3bc",
"type": "ui_tab",
"name": "Flow4",
"icon": "dashboard",
"order": 18,
"disabled": false,
"hidden": false
}
]