Skip to content

Instantly share code, notes, and snippets.

@jonchen727
Created December 18, 2019 00:16
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 jonchen727/84f91dfb77cb437c9baeeff3bb758627 to your computer and use it in GitHub Desktop.
Save jonchen727/84f91dfb77cb437c9baeeff3bb758627 to your computer and use it in GitHub Desktop.
Multiple Node Red Flows for Raspberry Pi PLC Project
[
{
"id": "a67b02db.65d08",
"type": "tab",
"label": "Define Inputs",
"disabled": false,
"info": ""
},
{
"id": "bca3b7d8.ee3178",
"type": "tab",
"label": "Display Varibales",
"disabled": false,
"info": ""
},
{
"id": "20ece430.4c99ec",
"type": "tab",
"label": "Logic/Control",
"disabled": false,
"info": ""
},
{
"id": "d466712f.3b5d",
"type": "tab",
"label": "Data Logging",
"disabled": false,
"info": ""
},
{
"id": "722422f2.92376c",
"type": "tab",
"label": "Ambient Graph",
"disabled": false,
"info": ""
},
{
"id": "6192cd5f.3ebfb4",
"type": "tab",
"label": "Process Graph",
"disabled": false,
"info": ""
},
{
"id": "9368ac8b.630df",
"type": "tab",
"label": "pH Sensor I2C #99",
"disabled": false,
"info": ""
},
{
"id": "e562458a.b05e28",
"type": "tab",
"label": "EC Sensor I2C #100",
"disabled": false,
"info": ""
},
{
"id": "4959b239.3baf5c",
"type": "tab",
"label": "EC Sensor I2C #101",
"disabled": false,
"info": ""
},
{
"id": "5fb493fb.22d96c",
"type": "tab",
"label": "OpenCV Flowmeter ",
"disabled": true,
"info": ""
},
{
"id": "d7efb715.854c58",
"type": "tab",
"label": "Login",
"disabled": true,
"info": ""
},
{
"id": "8e5eabab.140278",
"type": "tab",
"label": "Scale",
"disabled": false,
"info": ""
},
{
"id": "8ddcf0be.63b95",
"type": "tab",
"label": "Level Sensor",
"disabled": true,
"info": ""
},
{
"id": "e73e5dd5.981d6",
"type": "tab",
"label": "Permeate Temperature",
"disabled": true,
"info": ""
},
{
"id": "d8426a64.e2a948",
"type": "tab",
"label": "Temperature Control",
"disabled": false,
"info": ""
},
{
"id": "c172fcd9.e64cf",
"type": "i2c-device",
"z": "",
"device": "/dev/i2c-1",
"address": "24"
},
{
"id": "1d80b743.0287b9",
"type": "ui_group",
"z": "",
"name": "Data Logging",
"tab": "84333839.c04538",
"order": 1,
"disp": false,
"width": "20",
"collapse": false
},
{
"id": "1bfdd59.8aaab2a",
"type": "ui_tab",
"z": "",
"name": "Calibration",
"icon": "settings",
"order": 5
},
{
"id": "18af7fa6.0dfb4",
"type": "ui_base",
"theme": {
"name": "theme-dark",
"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": true,
"reset": 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": "#097479",
"value": "#097479",
"edited": false
},
"page-titlebar-backgroundColor": {
"value": "#097479",
"edited": false
},
"page-backgroundColor": {
"value": "#111111",
"edited": false
},
"page-sidebar-backgroundColor": {
"value": "#000000",
"edited": false
},
"group-textColor": {
"value": "#0eb8c0",
"edited": false
},
"group-borderColor": {
"value": "#555555",
"edited": false
},
"group-backgroundColor": {
"value": "#333333",
"edited": false
},
"widget-textColor": {
"value": "#eeeeee",
"edited": false
},
"widget-backgroundColor": {
"value": "#097479",
"edited": false
},
"widget-borderColor": {
"value": "#333333",
"edited": false
},
"base-font": {
"value": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"
}
}
},
"site": {
"name": "FMX-B Control Pannel",
"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": "d5d21687.ca1738",
"type": "ui_group",
"z": "",
"name": "Level Sensor",
"tab": "1bfdd59.8aaab2a",
"order": 1,
"disp": true,
"width": "4"
},
{
"id": "232a9e55.429882",
"type": "ui_tab",
"z": "",
"name": "Overview",
"icon": "dashboard",
"order": 2
},
{
"id": "e6b1beec.63f6e",
"type": "ui_group",
"z": "",
"name": "Login",
"tab": "e4ac06d8.fea2f8",
"order": 1,
"disp": false,
"width": "6"
},
{
"id": "967ebb71.cdb518",
"type": "ui_group",
"z": "",
"name": "Ambient Conditions",
"tab": "473bf10a.92205",
"order": 2,
"disp": false,
"width": "20"
},
{
"id": "84333839.c04538",
"type": "ui_tab",
"z": "",
"name": "Process Graph",
"icon": "trending_up",
"order": 3
},
{
"id": "ca4a0643.3b3f88",
"type": "ui_group",
"z": "",
"name": "Set Points",
"tab": "232a9e55.429882",
"order": 1,
"disp": true,
"width": "6"
},
{
"id": "473bf10a.92205",
"type": "ui_tab",
"z": "",
"name": "Ambient Graph",
"icon": "trending_up",
"order": 4
},
{
"id": "eee554a2.f4fad8",
"type": "ui_group",
"z": "",
"name": "pH Probe",
"tab": "1bfdd59.8aaab2a",
"disp": true,
"width": "6"
},
{
"id": "ecd09f83.54653",
"type": "ui_group",
"z": "",
"name": "Feed Conductivity Probe",
"tab": "1bfdd59.8aaab2a",
"order": 3,
"disp": true,
"width": "6"
},
{
"id": "6666aed4.efad4",
"type": "ui_group",
"z": "",
"name": "Permeate Conductiviy Probe",
"tab": "1bfdd59.8aaab2a",
"order": 4,
"disp": true,
"width": "6"
},
{
"id": "e4ac06d8.fea2f8",
"type": "ui_tab",
"z": "",
"name": "Login",
"icon": "fa-sign-in",
"order": 1
},
{
"id": "b49abd38.93418",
"type": "ui_group",
"z": "",
"name": "Ambient",
"tab": "232a9e55.429882",
"order": 10,
"disp": false,
"width": "6"
},
{
"id": "cb4fb20a.918cb",
"type": "ui_group",
"z": "",
"name": "Feed",
"tab": "232a9e55.429882",
"order": 5,
"disp": false,
"width": "6",
"collapse": false
},
{
"id": "1cf729f1.c8f1c6",
"type": "ui_group",
"z": "",
"name": "Permeate",
"tab": "232a9e55.429882",
"order": 8,
"disp": false,
"width": "6"
},
{
"id": "83c57b0a.062898",
"type": "ui_group",
"z": "",
"name": "Feed",
"tab": "232a9e55.429882",
"order": 6,
"disp": false,
"width": "6"
},
{
"id": "e27e0519.53ef58",
"type": "ui_tab",
"z": "",
"name": "RPi Control",
"icon": "dashboard",
"order": 1
},
{
"id": "fdb94034.da593",
"type": "mqtt-broker",
"z": "",
"broker": "192.168.1.117",
"port": "1883",
"clientid": "",
"usetls": false,
"compatmode": true,
"keepalive": "60",
"cleansession": true,
"willTopic": "",
"willQos": "0",
"willPayload": "",
"birthTopic": "",
"birthQos": "0",
"birthPayload": ""
},
{
"id": "13bc8a10.d81e96",
"type": "serial-port",
"z": "",
"serialport": "/dev/PRESS",
"serialbaud": "9600",
"databits": "8",
"parity": "none",
"stopbits": "1",
"newline": "\\n",
"bin": "false",
"out": "char",
"addchar": false
},
{
"id": "9301c102.d79c4",
"type": "serial-port",
"z": "",
"serialport": "/dev/SR05",
"serialbaud": "115200",
"databits": "8",
"parity": "none",
"stopbits": "1",
"newline": "\\n",
"bin": "false",
"out": "char",
"addchar": false
},
{
"id": "2eeaf23e.f3378e",
"type": "ui_group",
"z": "",
"name": "Scale",
"tab": "1bfdd59.8aaab2a",
"disp": true,
"width": "6"
},
{
"id": "7b651cb9.7da0a4",
"type": "nodebot",
"z": "",
"name": "",
"username": "",
"password": "",
"boardType": "raspi-io",
"serialportName": "",
"connectionType": "local",
"mqttServer": "",
"socketServer": "",
"pubTopic": "",
"subTopic": "",
"tcpHost": "",
"tcpPort": "",
"sparkId": "",
"sparkToken": "",
"beanId": "",
"impId": "",
"meshbluServer": "https://meshblu.octoblu.com",
"uuid": "",
"token": "",
"sendUuid": ""
},
{
"id": "ec9e2da9.eddd5",
"type": "ui_gauge",
"z": "bca3b7d8.ee3178",
"name": "Level Display",
"group": "cb4fb20a.918cb",
"order": 1,
"width": "6",
"height": "8",
"gtype": "wave",
"title": "Tank Level",
"label": "%",
"format": "{{value}}",
"min": 0,
"max": "100",
"colors": [
"#00b500",
"#e6e600",
"#ca3838"
],
"seg1": "",
"seg2": "",
"x": 900.9999618530273,
"y": 155.00000286102295,
"wires": []
},
{
"id": "864f9808.4072d8",
"type": "ui_text",
"z": "bca3b7d8.ee3178",
"group": "d5d21687.ca1738",
"order": 6,
"width": 0,
"height": 0,
"name": "Level Readout",
"label": "Current Level:",
"format": "{{msg.payload | number:1}}%",
"layout": "row-spread",
"x": 921.1333999633789,
"y": 237.00006580352783,
"wires": []
},
{
"id": "bf7d8bab.b54858",
"type": "function",
"z": "bca3b7d8.ee3178",
"name": "Return global.level",
"func": "level = global.get('level');\nmsg.payload = level.toFixed(2);\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"x": 641.1666717529297,
"y": 240.53334999084473,
"wires": [
[
"864f9808.4072d8",
"ec9e2da9.eddd5"
]
]
},
{
"id": "42b795eb.ef9d7c",
"type": "ui_text_input",
"z": "d466712f.3b5d",
"name": "",
"label": "File Name",
"group": "ca4a0643.3b3f88",
"order": 21,
"width": "0",
"height": "0",
"passthru": true,
"mode": "text",
"delay": "100",
"topic": "",
"x": 496.03357315063477,
"y": 680.3065690994263,
"wires": [
[
"cac0222f.84f9e"
]
]
},
{
"id": "f6987b1d.c75898",
"type": "debug",
"z": "d466712f.3b5d",
"name": "",
"active": true,
"console": "false",
"complete": "true",
"x": 1080.3337860107422,
"y": 676.0128688812256,
"wires": []
},
{
"id": "cac0222f.84f9e",
"type": "function",
"z": "d466712f.3b5d",
"name": "Define global.filename",
"func": "global.set('filename',msg.payload);\nvar dest = { filename:'/home/pi/Documents/' + global.get('filename')};\nreturn dest;",
"outputs": 1,
"noerr": 0,
"x": 751.8339157104492,
"y": 678.0131120681763,
"wires": [
[
"f6987b1d.c75898"
]
]
},
{
"id": "894beb1.2890a18",
"type": "inject",
"z": "d466712f.3b5d",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": true,
"x": 157.7667694091797,
"y": 694.0793647766113,
"wires": [
[
"6fdfdac4.10a6e4"
]
]
},
{
"id": "3d4fce04.24a152",
"type": "ui_button",
"z": "20ece430.4c99ec",
"name": "",
"group": "ca4a0643.3b3f88",
"order": 18,
"width": 0,
"height": 0,
"passthru": true,
"label": "Stop",
"color": "#ff0000",
"bgcolor": "",
"icon": "stop",
"payload": "stop",
"payloadType": "str",
"topic": "",
"x": 382.9999237060547,
"y": 559.666579246521,
"wires": [
[
"1d27e964.e87ca7",
"f8a310f.7ca65f"
]
]
},
{
"id": "c8c458e1.8c2e48",
"type": "ui_button",
"z": "20ece430.4c99ec",
"name": "",
"group": "ca4a0643.3b3f88",
"order": 17,
"width": 0,
"height": 0,
"passthru": true,
"label": "Start",
"color": "#00FF00",
"bgcolor": "",
"icon": "play_arrow",
"payload": "1",
"payloadType": "str",
"topic": "",
"x": 392.0335159301758,
"y": 401.00007724761963,
"wires": [
[
"471e4e5.1d61bb",
"2b3eaaf1.296076",
"4e292be.79ee8d4"
]
]
},
{
"id": "471e4e5.1d61bb",
"type": "trigger",
"z": "20ece430.4c99ec",
"op1": "1",
"op2": "",
"op1type": "num",
"op2type": "nul",
"duration": "0",
"extend": true,
"units": "ms",
"reset": "123",
"name": "",
"x": 863.2335891723633,
"y": 388.2000560760498,
"wires": [
[
"3d74c80a.57a468",
"a17279c1.d62958",
"d34209ee.10a4f8",
"7534da9f.c17234"
]
]
},
{
"id": "fd587677.c15ff8",
"type": "inject",
"z": "bca3b7d8.ee3178",
"name": "",
"topic": "Refresh Interval",
"payload": "",
"payloadType": "date",
"repeat": "3",
"crontab": "",
"once": true,
"x": 160,
"y": 560,
"wires": [
[
"bf7d8bab.b54858",
"f098c7d7.240468",
"f98435cd.a61be8",
"d98907d.6e06cf8",
"944be229.cd98f",
"74ab879a.acaac8",
"4d2f6ece.616b3",
"498629e7.7cba08",
"bf8f52b0.a742d",
"188ab01a.c100d",
"c0b8bafa.e7eca8",
"492e92b0.067a0c",
"94f5314.ccd4bd",
"80324130.d165b"
]
]
},
{
"id": "fdbc8bf9.6be018",
"type": "function",
"z": "a67b02db.65d08",
"name": "Define global.temp1,pHtempcorr,EC1tempcorr",
"func": "global.set('temp1',msg.payload);\nglobal.set('EC1tempcorr',msg.payload);\nglobal.set('pHtempcorr',msg.payload);\n",
"outputs": 1,
"noerr": 0,
"x": 460,
"y": 160,
"wires": [
[
"d352e0e.c114d2"
]
]
},
{
"id": "f098c7d7.240468",
"type": "function",
"z": "bca3b7d8.ee3178",
"name": "Return global.temp1",
"func": "msg.payload = global.get('temp1');\nmsg.topic = 'Temeprature';\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 656.9999771118164,
"y": 312.5999593734741,
"wires": [
[
"43767c03.0122c4"
]
]
},
{
"id": "d352e0e.c114d2",
"type": "debug",
"z": "a67b02db.65d08",
"name": "",
"active": false,
"console": "false",
"complete": "true",
"x": 926.2333087921143,
"y": 152.133154630661,
"wires": []
},
{
"id": "bf0984bd.5d2a18",
"type": "rpi-dht22",
"z": "a67b02db.65d08",
"name": "",
"topic": "rpi-dht22",
"dht": "11",
"pintype": "2",
"pin": "40",
"x": 680,
"y": 540,
"wires": [
[
"81917c15.331c7"
]
]
},
{
"id": "2b46ccf9.7a8934",
"type": "inject",
"z": "a67b02db.65d08",
"name": "Read Interval",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "300",
"crontab": "",
"once": true,
"x": 167.23330307006836,
"y": 528.7336263656616,
"wires": [
[
"9b92f9aa.5811b8"
]
]
},
{
"id": "81917c15.331c7",
"type": "function",
"z": "a67b02db.65d08",
"name": "Define global.humidity and global.ambtemp",
"func": "global.set('humidity',msg.humidity);\nglobal.set('ambtemp',msg.payload);\n",
"outputs": 1,
"noerr": 0,
"x": 990.066650390625,
"y": 541.3996090888977,
"wires": [
[]
]
},
{
"id": "d98907d.6e06cf8",
"type": "function",
"z": "bca3b7d8.ee3178",
"name": "Return global.humidity",
"func": "msg.payload = global.get('humidity');\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"x": 680,
"y": 860,
"wires": [
[
"b97e0f6a.bbfff"
]
]
},
{
"id": "b97e0f6a.bbfff",
"type": "ui_gauge",
"z": "bca3b7d8.ee3178",
"name": "Humidity",
"group": "83c57b0a.062898",
"order": 5,
"width": 0,
"height": 0,
"gtype": "gage",
"title": "Relitive Humidity",
"label": "%",
"format": "{{value}}",
"min": "20",
"max": "95",
"colors": [
"#b3b3ff",
"#6c6cff",
"#0000ff"
],
"seg1": "45",
"seg2": "70",
"x": 980,
"y": 800,
"wires": []
},
{
"id": "5830cbad.3a5a14",
"type": "ui_chart",
"z": "722422f2.92376c",
"name": "",
"group": "967ebb71.cdb518",
"order": 1,
"width": "0",
"height": "0",
"label": "Ambient Conditions",
"chartType": "line",
"legend": "true",
"xformat": "ddd h:mm A",
"interpolate": "bezier",
"nodata": "",
"dot": false,
"ymin": "0",
"ymax": "100",
"removeOlder": "1",
"removeOlderPoints": "1000",
"removeOlderUnit": "86400",
"cutout": 0,
"useOneColor": false,
"colors": [
"#00ffff",
"#ff0000",
"#00ff00",
"#ffff00",
"#ff00ff",
"#8080ff",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"x": 1002.9333343505859,
"y": 409.93340587615967,
"wires": [
[],
[]
]
},
{
"id": "a9162dd7.ddb3e",
"type": "function",
"z": "722422f2.92376c",
"name": "Return global.humidity",
"func": "msg.payload = global.get('humidity');\nmsg.topic = 'Relitive Humidity';\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"x": 698.9333343505859,
"y": 380.9333801269531,
"wires": [
[
"5830cbad.3a5a14"
]
]
},
{
"id": "996aa092.e489b",
"type": "inject",
"z": "722422f2.92376c",
"name": "",
"topic": "Refresh Interval",
"payload": "true",
"payloadType": "bool",
"repeat": "900",
"crontab": "",
"once": true,
"x": 415.00001525878906,
"y": 381.9999656677246,
"wires": [
[
"a9162dd7.ddb3e",
"8371e31.6e9c72"
]
]
},
{
"id": "8371e31.6e9c72",
"type": "function",
"z": "722422f2.92376c",
"name": "Return global.ambtemp",
"func": "msg.payload = global.get('ambtemp');\nmsg.topic = 'Ambient Temperature';\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"x": 693.9333381652832,
"y": 429.9333770275116,
"wires": [
[
"5830cbad.3a5a14"
]
]
},
{
"id": "88472c28.d2f21",
"type": "ui_gauge",
"z": "bca3b7d8.ee3178",
"name": "AmbTemp",
"group": "83c57b0a.062898",
"order": 4,
"width": 0,
"height": 0,
"gtype": "gage",
"title": "Ambient Temperature",
"label": "°C",
"format": "{{value}}",
"min": "0",
"max": "50",
"colors": [
"#00b500",
"#e6e600",
"#ca3838"
],
"seg1": "16.66",
"seg2": "33.33",
"x": 980,
"y": 860,
"wires": []
},
{
"id": "944be229.cd98f",
"type": "function",
"z": "bca3b7d8.ee3178",
"name": "Return global.ambtemp",
"func": "msg.payload = global.get('ambtemp');\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"x": 690,
"y": 920,
"wires": [
[
"88472c28.d2f21"
]
]
},
{
"id": "d5c697d4.ebd1c8",
"type": "ui_button",
"z": "722422f2.92376c",
"name": "",
"group": "967ebb71.cdb518",
"order": 3,
"width": "2",
"height": "1",
"passthru": false,
"label": "Clear",
"color": "",
"bgcolor": "",
"icon": "replay",
"payload": "[]",
"payloadType": "json",
"topic": "",
"x": 530,
"y": 280,
"wires": [
[
"5830cbad.3a5a14"
]
]
},
{
"id": "9db78ec1.5cd45",
"type": "catch",
"z": "a67b02db.65d08",
"name": "",
"scope": null,
"x": 1420,
"y": 640,
"wires": [
[
"a0e8a998.c2f7a8"
]
]
},
{
"id": "a0e8a998.c2f7a8",
"type": "debug",
"z": "a67b02db.65d08",
"name": "",
"active": true,
"console": "false",
"complete": "true",
"x": 1640,
"y": 580,
"wires": []
},
{
"id": "1653145d.f110cc",
"type": "inject",
"z": "a67b02db.65d08",
"name": "",
"topic": "global.time",
"payload": "",
"payloadType": "date",
"repeat": "1",
"crontab": "",
"once": true,
"x": 190,
"y": 740,
"wires": [
[
"69d193cc.43172c"
]
]
},
{
"id": "69d193cc.43172c",
"type": "function",
"z": "a67b02db.65d08",
"name": "Define global.time",
"func": "global.set('time',msg.payload);\n",
"outputs": 1,
"noerr": 0,
"x": 532.354118347168,
"y": 738.5154414176941,
"wires": [
[]
]
},
{
"id": "60cbd7cb.9ec988",
"type": "ui_switch",
"z": "d466712f.3b5d",
"name": "",
"label": "Data Logging",
"group": "ca4a0643.3b3f88",
"order": 20,
"width": "0",
"height": "0",
"passthru": true,
"decouple": "false",
"topic": "",
"style": "",
"onvalue": "true",
"onvalueType": "bool",
"onicon": "",
"oncolor": "",
"offvalue": "stop",
"offvalueType": "str",
"officon": "",
"offcolor": "",
"x": 200,
"y": 220,
"wires": [
[
"8f8744f8.5874a8",
"7b23d02.f68b33"
]
]
},
{
"id": "d1e74b4e.bb1ac8",
"type": "function",
"z": "6192cd5f.3ebfb4",
"name": "Return global.level",
"func": "msg.payload = parseFloat(global.get('level')).toFixed(2);\nmsg.topic = 'Level'\nreturn msg;\n\n",
"outputs": 1,
"noerr": 0,
"x": 510,
"y": 440,
"wires": [
[
"1973c83c.540cb8"
]
]
},
{
"id": "c317b422.50b3c8",
"type": "inject",
"z": "6192cd5f.3ebfb4",
"name": "",
"topic": "Refresh Interval",
"payload": "",
"payloadType": "date",
"repeat": "300",
"crontab": "",
"once": true,
"x": 163.0000228881836,
"y": 490.0000710487366,
"wires": [
[
"d1e74b4e.bb1ac8",
"3953b26f.60b63e",
"20dd7531.8ab8ba",
"22fbe7d7.b24558",
"e07578b3.7b5548",
"12036e0e.659fc2",
"e40145b2.0f8618",
"f87595cd.0560b8",
"239c2a22.11fe16",
"a3a3d800.af1cc8"
]
]
},
{
"id": "3953b26f.60b63e",
"type": "function",
"z": "6192cd5f.3ebfb4",
"name": "Return global.temp1",
"func": "msg.payload = global.get('temp1');\nmsg.topic = 'Feed Temperature'\nreturn msg;\n\n\n",
"outputs": 1,
"noerr": 0,
"x": 512.0000152587891,
"y": 501.0000047683716,
"wires": [
[
"1973c83c.540cb8"
]
]
},
{
"id": "c45bf25a.b558c",
"type": "debug",
"z": "d466712f.3b5d",
"name": "",
"active": false,
"console": "false",
"complete": "true",
"x": 1030,
"y": 180,
"wires": []
},
{
"id": "47fd776e.695468",
"type": "function",
"z": "d466712f.3b5d",
"name": "json formatting ",
"func": "var level = parseFloat(global.get('level')).toFixed(2);\nvar temp1 = global.get('temp1');\nvar temp2 = global.get('temp2');\nvar pH = global.get('pH');\nvar EC1 = global.get('EC1');\nvar EC2 = global.get('EC2');\nvar flow = global.get('flowrate');\nvar time = global.get('time');\nvar flux = global.get('flux');\nvar wtot = global.get('wtotal');\nvar rejection = global.get('rejection');\nvar pressure = global.get('pressure');\nflow=flow.toFixed(1);\nflux=flux.toFixed(2);\nvar cflux = global.get('correctedflux');\ncflux = cflux.toFixed(2);\nmsg.filename = '/mnt/filmax-pc/BKT\\040Server/Jon/FMXBData/' + global.get('filename')+'.csv';\nmsg.payload = [time,level,pressure, temp1,EC1,temp2,pH,EC2,flow,flux,cflux,rejection,wtot];\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 824.0000305175781,
"y": 181.00000381469727,
"wires": [
[
"c45bf25a.b558c",
"ad16e2cd.70782",
"d8c0fb9.566cf08"
]
]
},
{
"id": "ad16e2cd.70782",
"type": "csv",
"z": "d466712f.3b5d",
"name": "",
"sep": ",",
"hdrin": false,
"hdrout": false,
"multi": "mult",
"ret": "\\n",
"temp": "",
"x": 960.0001640319824,
"y": 276.00009536743164,
"wires": [
[
"2e74ed8b.3a6072"
]
]
},
{
"id": "2e74ed8b.3a6072",
"type": "file",
"z": "d466712f.3b5d",
"name": "",
"filename": "",
"appendNewline": false,
"createDir": true,
"overwriteFile": "false",
"x": 1239.9999885559082,
"y": 275.00002670288086,
"wires": []
},
{
"id": "48827d90.d65cb4",
"type": "trigger",
"z": "d466712f.3b5d",
"op1": "timestamp",
"op2": "0",
"op1type": "global",
"op2type": "str",
"duration": "-1",
"extend": false,
"units": "min",
"reset": "stop",
"name": "",
"x": 590,
"y": 220,
"wires": [
[
"47fd776e.695468"
]
]
},
{
"id": "e6483396.22cfe",
"type": "file",
"z": "20ece430.4c99ec",
"name": "",
"filename": "/home/pi/Documents/BKT/backup.csv",
"appendNewline": false,
"createDir": true,
"overwriteFile": "false",
"x": 1496.812728881836,
"y": 301.81880950927734,
"wires": []
},
{
"id": "645e0584.1b7ddc",
"type": "csv",
"z": "20ece430.4c99ec",
"name": "",
"sep": ",",
"hdrin": false,
"hdrout": false,
"multi": "mult",
"ret": "\\n",
"temp": "",
"x": 1171.8124160766602,
"y": 304.8187608718872,
"wires": [
[
"e6483396.22cfe"
]
]
},
{
"id": "e9040e3.26584f",
"type": "function",
"z": "20ece430.4c99ec",
"name": "JSON Formatting",
"func": "var level = parseFloat(global.get('level')).toFixed(2);\nvar temp1 = global.get('temp1');\nvar temp2 = global.get('temp2');\nvar pH = global.get('pH');\nvar EC1 = global.get('EC1');\nvar EC2 = global.get('EC2');\nvar flow = global.get('flowrate');\nvar time = global.get('time');\nvar flux = global.get('flux');\nvar rejection = global.get('rejection');\nvar wtot = global.get('wtotal');\nvar pressure = global.get('pressure');\nflow = flow.toFixed(1);\nflux=flux.toFixed(2);\nvar cflux = global.get('correctedflux');\ncflux = cflux.toFixed(2);\nmsg.payload = [time,level, pressure, temp1,EC1,temp2,pH,EC2,flow,flux,cflux,rejection,wtot];\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 970,
"y": 300,
"wires": [
[
"645e0584.1b7ddc"
]
]
},
{
"id": "f8a310f.7ca65f",
"type": "trigger",
"z": "20ece430.4c99ec",
"op1": "timestamp",
"op2": "0",
"op1type": "global",
"op2type": "str",
"duration": "-2",
"extend": false,
"units": "min",
"reset": "stop",
"name": "",
"x": 730,
"y": 300,
"wires": [
[
"e9040e3.26584f"
]
]
},
{
"id": "f98435cd.a61be8",
"type": "function",
"z": "bca3b7d8.ee3178",
"name": "Return global.flowrate",
"func": "msg.payload = global.get('flowrate');\nmsg.topic = 'flowrate';\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 654.9999008178711,
"y": 430.8187532424927,
"wires": [
[
"b401b86f.144328"
]
]
},
{
"id": "b401b86f.144328",
"type": "ui_gauge",
"z": "bca3b7d8.ee3178",
"name": "Permeate Flow",
"group": "b49abd38.93418",
"order": 1,
"width": "0",
"height": "0",
"gtype": "gage",
"title": "Permeate Flow",
"label": "mL/min",
"format": "{{value| number:1}}",
"min": 0,
"max": "60",
"colors": [
"#5b7cff",
"#0038fb",
"#001397"
],
"seg1": "10",
"seg2": "30",
"x": 940.9998779296875,
"y": 429.1520719528198,
"wires": []
},
{
"id": "1973c83c.540cb8",
"type": "ui_chart",
"z": "6192cd5f.3ebfb4",
"name": "",
"group": "1d80b743.0287b9",
"order": 1,
"width": 0,
"height": 0,
"label": "Process Variables",
"chartType": "line",
"legend": "true",
"xformat": "HH:mm:ss",
"interpolate": "bezier",
"nodata": "",
"dot": false,
"ymin": "0",
"ymax": "100",
"removeOlder": "1",
"removeOlderPoints": "",
"removeOlderUnit": "86400",
"cutout": 0,
"useOneColor": false,
"colors": [
"#00ffff",
"#ff0000",
"#00ff00",
"#ffff00",
"#ff00ff",
"#8080ff",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"x": 901.9999923706055,
"y": 464,
"wires": [
[],
[]
]
},
{
"id": "fbc64037.01a05",
"type": "ui_button",
"z": "6192cd5f.3ebfb4",
"name": "",
"group": "1d80b743.0287b9",
"order": 5,
"width": "2",
"height": "1",
"passthru": false,
"label": "Clear",
"color": "",
"bgcolor": "",
"icon": "replay",
"payload": "[]",
"payloadType": "json",
"topic": "",
"x": 483.76698303222656,
"y": 379.1999626159668,
"wires": [
[
"eba1ac79.8f64a",
"d2dcd2c0.f1862",
"1973c83c.540cb8"
]
]
},
{
"id": "9883d47c.5595b8",
"type": "ds18b20",
"z": "a67b02db.65d08",
"name": "DS18B20 #1",
"sensorid": "28-0416a4f7aaff",
"timer": "0.05",
"x": 130.3999900817871,
"y": 161.00053477287292,
"wires": [
[
"fdbc8bf9.6be018"
]
]
},
{
"id": "ae3c4422.d867f8",
"type": "delay",
"z": "9368ac8b.630df",
"name": "",
"pauseType": "delay",
"timeout": "950",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 1564.1001281738281,
"y": 106.00012016296387,
"wires": [
[
"d4fa533.7b9aab"
]
]
},
{
"id": "cd5b145b.38a548",
"type": "function",
"z": "9368ac8b.630df",
"name": "Read pH",
"func": "msg.payload=[0x72]\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1317.1001586914062,
"y": 122.26694869995117,
"wires": [
[
"ae3c4422.d867f8",
"e482354f.59b718"
]
]
},
{
"id": "f4b306d8.13d4a8",
"type": "ui_switch",
"z": "9368ac8b.630df",
"name": "",
"label": "pH Sensor Continous Read",
"group": "ca4a0643.3b3f88",
"order": 2,
"width": 0,
"height": 0,
"passthru": true,
"decouple": "false",
"topic": "",
"style": "",
"onvalue": "1",
"onvalueType": "num",
"onicon": "",
"oncolor": "",
"offvalue": "0",
"offvalueType": "num",
"officon": "",
"offcolor": "",
"x": 463.16678619384766,
"y": 220.40029525756836,
"wires": [
[
"f4c8833.ea2ce8"
]
]
},
{
"id": "f4c8833.ea2ce8",
"type": "trigger",
"z": "9368ac8b.630df",
"op1": "true",
"op2": "0",
"op1type": "bool",
"op2type": "str",
"duration": "-3000",
"extend": false,
"units": "ms",
"reset": "0",
"name": "",
"x": 735.1667022705078,
"y": 221.20007419586182,
"wires": [
[
"55cb1e85.f9d1b"
]
]
},
{
"id": "1a5363fa.100cbc",
"type": "ui_text",
"z": "9368ac8b.630df",
"group": "ca4a0643.3b3f88",
"order": 14,
"width": 0,
"height": 0,
"name": "",
"label": "pH",
"format": "{{msg.payload}}",
"layout": "row-right",
"x": 2281.1670455932617,
"y": 107.00011730194092,
"wires": []
},
{
"id": "92c6436a.31671",
"type": "function",
"z": "9368ac8b.630df",
"name": "Define global.pH",
"func": "var pH = msg.payload.toString().slice(1)\npH = parseFloat(pH);\nmsg.payload = pH.toFixed(3)\nglobal.set(\"pH\",msg.payload);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1996.933250427246,
"y": 109.93340682983398,
"wires": [
[
"1a5363fa.100cbc",
"85e676a.1f10688"
]
]
},
{
"id": "85e676a.1f10688",
"type": "debug",
"z": "9368ac8b.630df",
"name": "",
"active": false,
"console": "false",
"complete": "true",
"x": 2440.2335243225098,
"y": 106.3333911895752,
"wires": []
},
{
"id": "d4fa533.7b9aab",
"type": "i2c in",
"z": "9368ac8b.630df",
"name": "",
"i2cdevice": "c172fcd9.e64cf",
"address": "99",
"command": "",
"count": "31",
"x": 1760.7001419067383,
"y": 103.86671733856201,
"wires": [
[
"92c6436a.31671",
"85e676a.1f10688"
]
]
},
{
"id": "9c059132.85891",
"type": "ui_button",
"z": "9368ac8b.630df",
"name": "",
"group": "eee554a2.f4fad8",
"order": 3,
"width": 0,
"height": 0,
"passthru": false,
"label": "pH 7.00 Cal (#1)",
"color": "",
"bgcolor": "",
"icon": "perm_data_setting",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 540.1000480651855,
"y": 681.8000974655151,
"wires": [
[
"a9f1fe3e.3d31f"
]
]
},
{
"id": "a9f1fe3e.3d31f",
"type": "function",
"z": "9368ac8b.630df",
"name": "pH Cal 7.00",
"func": "msg.payload=[0x63,0x61,0x6c,0x2c,0x6d,0x69,0x64,0x2c,0x37,0x2e,0x30,0x30]\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 756.9334106445312,
"y": 683.2667036056519,
"wires": [
[
"5d50524a.3e2e6c",
"a5238509.6a0528"
]
]
},
{
"id": "5c97bb93.14bb94",
"type": "function",
"z": "9368ac8b.630df",
"name": "pH Cal 4.00",
"func": "msg.payload=[0x63,0x61,0x6c,0x2c,0x6c,0x6f,0x77,0x2c,0x34,0x2e,0x30,0x30]\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 750.9334716796875,
"y": 747.2667112350464,
"wires": [
[
"5d50524a.3e2e6c",
"a5238509.6a0528"
]
]
},
{
"id": "1c518a90.3f50b5",
"type": "function",
"z": "9368ac8b.630df",
"name": "pH Cal 10.00",
"func": "msg.payload=[0x63,0x61,0x6c,0x2c,0x68,0x69,0x67,0x68,0x2c,0x31,0x30,0x2e,0x30,0x30]\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 747.933406829834,
"y": 796.2667837142944,
"wires": [
[
"5d50524a.3e2e6c",
"a5238509.6a0528"
]
]
},
{
"id": "a57d5c95.dab7c",
"type": "ui_button",
"z": "9368ac8b.630df",
"name": "",
"group": "eee554a2.f4fad8",
"order": 4,
"width": 0,
"height": 0,
"passthru": false,
"label": "pH 4.00 Cal (#2)",
"color": "",
"bgcolor": "",
"icon": "perm_data_setting",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 543.9333572387695,
"y": 736.2666654586792,
"wires": [
[
"5c97bb93.14bb94"
]
]
},
{
"id": "5abe42a9.119bdc",
"type": "ui_button",
"z": "9368ac8b.630df",
"name": "",
"group": "eee554a2.f4fad8",
"order": 5,
"width": 0,
"height": 0,
"passthru": false,
"label": "pH 10.00 Cal (#3)",
"color": "",
"bgcolor": "",
"icon": "perm_data_setting",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 549.9333572387695,
"y": 797.2667531967163,
"wires": [
[
"1c518a90.3f50b5"
]
]
},
{
"id": "90570bd8.eabba8",
"type": "ui_text",
"z": "9368ac8b.630df",
"group": "eee554a2.f4fad8",
"order": 12,
"width": 0,
"height": 0,
"name": "",
"label": "Debug",
"format": "{{msg.payload}}",
"layout": "row-spread",
"x": 1514.9332733154297,
"y": 610.9334981665015,
"wires": []
},
{
"id": "e6691697.76ac58",
"type": "function",
"z": "9368ac8b.630df",
"name": "Responce",
"func": "msg.payload = msg.payload.toString();\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1337.9332847595215,
"y": 618.9335460662842,
"wires": [
[
"90570bd8.eabba8",
"2d909575.d8835a"
]
]
},
{
"id": "6d3095b6.80a99c",
"type": "i2c in",
"z": "9368ac8b.630df",
"name": "",
"i2cdevice": "c172fcd9.e64cf",
"address": "99",
"command": "",
"count": "32",
"x": 1139.933364868164,
"y": 625.9335927963257,
"wires": [
[
"e6691697.76ac58",
"2d909575.d8835a"
]
]
},
{
"id": "5d50524a.3e2e6c",
"type": "delay",
"z": "9368ac8b.630df",
"name": "",
"pauseType": "delay",
"timeout": "900",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 957.9333610534668,
"y": 591.9334239959717,
"wires": [
[
"6d3095b6.80a99c"
]
]
},
{
"id": "2d909575.d8835a",
"type": "debug",
"z": "9368ac8b.630df",
"name": "",
"active": true,
"console": "false",
"complete": "true",
"x": 1488.000015258789,
"y": 690.933352470398,
"wires": []
},
{
"id": "11ae3786.c6e948",
"type": "ui_button",
"z": "9368ac8b.630df",
"name": "",
"group": "eee554a2.f4fad8",
"order": 2,
"width": 0,
"height": 0,
"passthru": false,
"label": "Check pH",
"color": "",
"bgcolor": "",
"icon": "cached",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 402.9999694824219,
"y": 425.9334535598755,
"wires": [
[
"d6a57c74.bbdbf"
]
]
},
{
"id": "f83c83df.86ef9",
"type": "delay",
"z": "9368ac8b.630df",
"name": "",
"pauseType": "delay",
"timeout": "900",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 1366.9332275390625,
"y": 334.9334011077881,
"wires": [
[
"30b835b6.1d878a"
]
]
},
{
"id": "c6157e8.c146b8",
"type": "function",
"z": "9368ac8b.630df",
"name": "Read pH",
"func": "msg.payload=[0x72]\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1128.9332580566406,
"y": 333.20022201538086,
"wires": [
[
"f83c83df.86ef9",
"cae37f4a.d23a7"
]
]
},
{
"id": "5cb3e06.20f2d2",
"type": "ui_text",
"z": "9368ac8b.630df",
"group": "eee554a2.f4fad8",
"order": 1,
"width": 0,
"height": 0,
"name": "",
"label": "pH",
"format": "{{msg.payload}}",
"layout": "row-right",
"x": 2033.0001411437988,
"y": 334.93340158462524,
"wires": []
},
{
"id": "d8dd4e4d.686b9",
"type": "function",
"z": "9368ac8b.630df",
"name": "Define global.pH",
"func": "var pH = msg.payload.toString().slice(1)\npH = parseFloat(pH);\nmsg.payload = pH.toFixed(3)\nglobal.set(\"pH\",msg.payload);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1807.7665405273438,
"y": 333.8667025566101,
"wires": [
[
"5cb3e06.20f2d2"
]
]
},
{
"id": "30b835b6.1d878a",
"type": "i2c in",
"z": "9368ac8b.630df",
"name": "",
"i2cdevice": "c172fcd9.e64cf",
"address": "99",
"command": "",
"count": "31",
"x": 1597.533332824707,
"y": 333.80002784729004,
"wires": [
[
"d8dd4e4d.686b9"
]
]
},
{
"id": "ec84619f.4aa02",
"type": "function",
"z": "9368ac8b.630df",
"name": "clear cal",
"func": "msg.payload=[0x63,0x61,0x6c,0x2c,0x63,0x6c,0x65,0x61,0x72]\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 723.9332885742188,
"y": 868.2666263580322,
"wires": [
[
"743c8d57.87cd24",
"a5238509.6a0528"
]
]
},
{
"id": "c4d84e14.f3f95",
"type": "function",
"z": "9368ac8b.630df",
"name": "check cal",
"func": "msg.payload=[0x63,0x61,0x6c,0x2c,0x3f]\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 744.9333572387695,
"y": 938.2666616439819,
"wires": [
[
"743c8d57.87cd24"
]
]
},
{
"id": "f07a79d7.26fce8",
"type": "ui_button",
"z": "9368ac8b.630df",
"name": "",
"group": "eee554a2.f4fad8",
"order": 7,
"width": "3",
"height": "1",
"passthru": false,
"label": "Clear Cal",
"color": "",
"bgcolor": "",
"icon": "delete",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 499.933292388916,
"y": 868.2665910720825,
"wires": [
[
"ec84619f.4aa02"
]
]
},
{
"id": "74f602b3.b5775c",
"type": "ui_button",
"z": "9368ac8b.630df",
"name": "",
"group": "eee554a2.f4fad8",
"order": 6,
"width": "3",
"height": "1",
"passthru": false,
"label": "Check Cal",
"color": "",
"bgcolor": "",
"icon": "check",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 503.9333038330078,
"y": 940.2666473388672,
"wires": [
[
"c4d84e14.f3f95"
]
]
},
{
"id": "119c8f12.5ae9f1",
"type": "function",
"z": "9368ac8b.630df",
"name": "Set Temperature Correction",
"func": "tempcorr = global.get('pHtempcorr');\nvar arr=[0x54,0x2c];\narr = arr.concat(tempcorr);\nmsg.payload=arr;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 750.9332466125488,
"y": 1048.6000394821167,
"wires": [
[
"5d50524a.3e2e6c",
"a5238509.6a0528"
]
]
},
{
"id": "660bf19e.b4943",
"type": "ui_button",
"z": "9368ac8b.630df",
"name": "Temp Correction Send",
"group": "eee554a2.f4fad8",
"order": 9,
"width": "3",
"height": "1",
"passthru": false,
"label": "Temp Correction ",
"color": "",
"bgcolor": "",
"icon": "save",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 484.9332847595215,
"y": 1029.6001358032227,
"wires": [
[
"119c8f12.5ae9f1"
]
]
},
{
"id": "61ec6958.c92868",
"type": "ui_text_input",
"z": "9368ac8b.630df",
"name": "",
"label": "Temperature Correction",
"group": "eee554a2.f4fad8",
"order": 8,
"width": 0,
"height": 0,
"passthru": true,
"mode": "text",
"delay": "20",
"topic": "",
"x": 499.99997329711914,
"y": 1143.2668771743774,
"wires": [
[
"9cd28436.bbc3e8"
]
]
},
{
"id": "9cd28436.bbc3e8",
"type": "function",
"z": "9368ac8b.630df",
"name": "Define global.pHtempcorr",
"func": "var str = msg.payload;\nmsg.payload = str.split ('').map (function (c) { return c.charCodeAt (0); })\nglobal.set('pHtempcorr',msg.payload);\nreturn msg;\n ",
"outputs": 1,
"noerr": 0,
"x": 797.9333229064941,
"y": 1145.9332056045532,
"wires": [
[
"a5238509.6a0528"
]
]
},
{
"id": "bc83e0ee.35903",
"type": "debug",
"z": "9368ac8b.630df",
"name": "",
"active": true,
"console": "false",
"complete": "true",
"x": 1199.9332733154297,
"y": 1108.933259010315,
"wires": []
},
{
"id": "326d7ccf.741b54",
"type": "ui_button",
"z": "9368ac8b.630df",
"name": "Temp Correction Check",
"group": "eee554a2.f4fad8",
"order": 10,
"width": "3",
"height": "1",
"passthru": false,
"label": "Temp Correction",
"color": "",
"bgcolor": "",
"icon": "check",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 498.9333152770996,
"y": 1227.333219051361,
"wires": [
[
"c2a4709e.6dc05"
]
]
},
{
"id": "c2a4709e.6dc05",
"type": "function",
"z": "9368ac8b.630df",
"name": "Check Temperature Correction",
"func": "var arr=[0x54,0x2c,0x3f];\nmsg.payload=arr;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 793.9333534240723,
"y": 1227.3331699371338,
"wires": [
[
"743c8d57.87cd24",
"a5238509.6a0528"
]
]
},
{
"id": "743c8d57.87cd24",
"type": "delay",
"z": "9368ac8b.630df",
"name": "",
"pauseType": "delay",
"timeout": "300",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 978.8125114440918,
"y": 653.8186082839966,
"wires": [
[
"6d3095b6.80a99c"
]
]
},
{
"id": "74ab879a.acaac8",
"type": "function",
"z": "bca3b7d8.ee3178",
"name": "Return global.pH",
"func": "msg.payload = global.get('pH');\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"x": 670,
"y": 1020,
"wires": [
[
"3da74658.c663fa"
]
]
},
{
"id": "3da74658.c663fa",
"type": "ui_gauge",
"z": "bca3b7d8.ee3178",
"name": "pH Display",
"group": "1cf729f1.c8f1c6",
"order": 1,
"width": "0",
"height": "0",
"gtype": "gage",
"title": "Permeate pH",
"label": "pH",
"format": "{{value| number:3}}",
"min": 0,
"max": "14",
"colors": [
"#ff0000",
"#00ff00",
"#0000ff"
],
"seg1": "6",
"seg2": "9",
"x": 960.0000228881836,
"y": 1014.9999089241028,
"wires": []
},
{
"id": "f46e02e0.a0d5f",
"type": "delay",
"z": "e562458a.b05e28",
"name": "",
"pauseType": "delay",
"timeout": "600",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 1600.8125915527344,
"y": 130.81876850128174,
"wires": [
[
"2112da7b.0fa5b6"
]
]
},
{
"id": "b6ddf529.554718",
"type": "function",
"z": "e562458a.b05e28",
"name": "Read EC",
"func": "msg.payload=[0x72]\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1390.8130722045898,
"y": 150.0855827331543,
"wires": [
[
"f46e02e0.a0d5f",
"b21b776.63f7d88"
]
]
},
{
"id": "9eacf5ff.55eae8",
"type": "ui_switch",
"z": "e562458a.b05e28",
"name": "",
"label": "EC Sensor #1 Continous Read",
"group": "ca4a0643.3b3f88",
"order": 3,
"width": 0,
"height": 0,
"passthru": true,
"decouple": "false",
"topic": "",
"style": "",
"onvalue": "1",
"onvalueType": "num",
"onicon": "",
"oncolor": "",
"offvalue": "0",
"offvalueType": "num",
"officon": "",
"offcolor": "",
"x": 465.8793029785156,
"y": 223.2188892364502,
"wires": [
[
"d0368dbb.f3e72",
"579fc80d.165568"
]
]
},
{
"id": "d0368dbb.f3e72",
"type": "trigger",
"z": "e562458a.b05e28",
"op1": "true",
"op2": "0",
"op1type": "bool",
"op2type": "str",
"duration": "-3000",
"extend": false,
"units": "ms",
"reset": "0",
"name": "",
"x": 767.8794403076172,
"y": 247.01872730255127,
"wires": [
[
"777fc4cd.c915cc"
]
]
},
{
"id": "96c09038.0d1c4",
"type": "ui_text",
"z": "e562458a.b05e28",
"group": "ca4a0643.3b3f88",
"order": 15,
"width": 0,
"height": 0,
"name": "",
"label": "EC #1",
"format": "{{msg.payload}}uS",
"layout": "row-right",
"x": 2240.8795013427734,
"y": 115.81876850128174,
"wires": []
},
{
"id": "a9e2c856.311358",
"type": "function",
"z": "e562458a.b05e28",
"name": "Define global.EC1",
"func": "var EC1 = msg.payload.toString().slice(1)\nEC1 = parseFloat(EC1);\nmsg.payload = EC1.toFixed(2)\nglobal.set(\"EC1\",msg.payload);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 2025.64599609375,
"y": 120.75206756591797,
"wires": [
[
"96c09038.0d1c4",
"f4d86dcb.70308"
]
]
},
{
"id": "f4d86dcb.70308",
"type": "debug",
"z": "e562458a.b05e28",
"name": "",
"active": false,
"console": "false",
"complete": "true",
"x": 2268.9458503723145,
"y": 27.000000953674316,
"wires": []
},
{
"id": "2112da7b.0fa5b6",
"type": "i2c in",
"z": "e562458a.b05e28",
"name": "",
"i2cdevice": "c172fcd9.e64cf",
"address": "100",
"command": "",
"count": "31",
"x": 1790.4125900268555,
"y": 123.68540477752686,
"wires": [
[
"a9e2c856.311358",
"f4d86dcb.70308"
]
]
},
{
"id": "ce172332.94dff",
"type": "ui_button",
"z": "e562458a.b05e28",
"name": "",
"group": "ecd09f83.54653",
"order": 3,
"width": "3",
"height": "1",
"passthru": false,
"label": "EC Cal Dry (#1)",
"color": "",
"bgcolor": "",
"icon": "perm_data_setting",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 564.8125534057617,
"y": 707.618766784668,
"wires": [
[
"d5fb7271.9d07e"
]
]
},
{
"id": "d5fb7271.9d07e",
"type": "function",
"z": "e562458a.b05e28",
"name": "EC Cal Dry",
"func": "msg.payload=[0x63,0x61,0x6c,0x2c,0x64,0x72,0x79];\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 781.6459159851074,
"y": 709.0853729248047,
"wires": [
[
"da9ad614.eff678",
"75113844.7cb1f8"
]
]
},
{
"id": "255c91f3.6bcf5e",
"type": "function",
"z": "e562458a.b05e28",
"name": "EC Cal Low (12,880uS)",
"func": "msg.payload=[0x63, 0x61, 0x6c, 0x2c, 0x6c, 0x6f, 0x77, 0x2c, 0x31, 0x32, 0x38, 0x38, 0x30];\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 815.6459770202637,
"y": 773.0853805541992,
"wires": [
[
"da9ad614.eff678",
"75113844.7cb1f8"
]
]
},
{
"id": "599549e6.9fa098",
"type": "function",
"z": "e562458a.b05e28",
"name": "EC Cal High (80,000uS)",
"func": "msg.payload=[0x63, 0x61, 0x6c, 0x2c, 0x68, 0x69, 0x67, 0x68, 0x2c, 0x38, 0x30, 0x30, 0x30, 0x30];\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 813.645923614502,
"y": 824.0854692459106,
"wires": [
[
"da9ad614.eff678",
"75113844.7cb1f8"
]
]
},
{
"id": "c7bad49e.80fe58",
"type": "ui_button",
"z": "e562458a.b05e28",
"name": "",
"group": "ecd09f83.54653",
"order": 4,
"width": "3",
"height": "1",
"passthru": false,
"label": "EC Cal Low (12,880uS)",
"color": "",
"bgcolor": "",
"icon": "perm_data_setting",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 563.6458854675293,
"y": 763.0853562355042,
"wires": [
[
"255c91f3.6bcf5e"
]
]
},
{
"id": "35ef4dc.79c6eb2",
"type": "ui_button",
"z": "e562458a.b05e28",
"name": "",
"group": "ecd09f83.54653",
"order": 5,
"width": "3",
"height": "1",
"passthru": false,
"label": "EC Cal High (80,000uS)",
"color": "",
"bgcolor": "",
"icon": "perm_data_setting",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 559.6458854675293,
"y": 821.0854291915894,
"wires": [
[
"599549e6.9fa098"
]
]
},
{
"id": "5236e7d1.c6a5f8",
"type": "ui_text",
"z": "e562458a.b05e28",
"group": "ecd09f83.54653",
"order": 14,
"width": 0,
"height": 0,
"name": "",
"label": "Debug",
"format": "{{msg.payload}}",
"layout": "row-spread",
"x": 1546.6458320617676,
"y": 634.7522058486938,
"wires": []
},
{
"id": "ab1de412.2fd1a8",
"type": "function",
"z": "e562458a.b05e28",
"name": "Responce",
"func": "msg.payload = msg.payload.toString();\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1385.645824432373,
"y": 644.7522048950195,
"wires": [
[
"5236e7d1.c6a5f8",
"fbc87e0c.8caad"
]
]
},
{
"id": "720f232c.a3ecac",
"type": "i2c in",
"z": "e562458a.b05e28",
"name": "",
"i2cdevice": "c172fcd9.e64cf",
"address": "100",
"command": "",
"count": "32",
"x": 1182.6458320617676,
"y": 651.7522535324097,
"wires": [
[
"ab1de412.2fd1a8",
"fbc87e0c.8caad"
]
]
},
{
"id": "da9ad614.eff678",
"type": "delay",
"z": "e562458a.b05e28",
"name": "",
"pauseType": "delay",
"timeout": "800",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 982.645866394043,
"y": 617.7520933151245,
"wires": [
[
"720f232c.a3ecac"
]
]
},
{
"id": "fbc87e0c.8caad",
"type": "debug",
"z": "e562458a.b05e28",
"name": "",
"active": true,
"console": "false",
"complete": "true",
"x": 1512.7125205993652,
"y": 716.7520217895508,
"wires": []
},
{
"id": "4a322846.ec1658",
"type": "ui_button",
"z": "e562458a.b05e28",
"name": "",
"group": "ecd09f83.54653",
"order": 2,
"width": 0,
"height": 0,
"passthru": false,
"label": "Check EC",
"color": "",
"bgcolor": "",
"icon": "cached",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 438.64586639404297,
"y": 458.752166390419,
"wires": [
[
"1f9d9b37.fbb415"
]
]
},
{
"id": "f256c6c8.ea89c8",
"type": "delay",
"z": "e562458a.b05e28",
"name": "",
"pauseType": "delay",
"timeout": "600",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 1321.6459197998047,
"y": 368.752103805542,
"wires": [
[
"ddaa1fad.ec627"
]
]
},
{
"id": "e4086e29.edb8c",
"type": "function",
"z": "e562458a.b05e28",
"name": "Read EC",
"func": "msg.payload=[0x72]\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1124.6459503173828,
"y": 393.01888275146484,
"wires": [
[
"f256c6c8.ea89c8",
"c8213add.db3448"
]
]
},
{
"id": "5ed82b0f.4b3834",
"type": "ui_text",
"z": "e562458a.b05e28",
"group": "ecd09f83.54653",
"order": 1,
"width": 0,
"height": 0,
"name": "",
"label": "EC",
"format": "{{msg.payload}}uS",
"layout": "row-right",
"x": 1941.713134765625,
"y": 366.75217723846436,
"wires": []
},
{
"id": "52f469d8.5786d8",
"type": "function",
"z": "e562458a.b05e28",
"name": "Define global.EC1",
"func": "var EC1 = msg.payload.toString().slice(1)\nEC1 = parseFloat(EC1);\nmsg.payload = EC1.toFixed(2)\nglobal.set(\"EC1\",msg.payload);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1733.4793395996094,
"y": 364.68538093566895,
"wires": [
[
"5ed82b0f.4b3834"
]
]
},
{
"id": "ddaa1fad.ec627",
"type": "i2c in",
"z": "e562458a.b05e28",
"name": "",
"i2cdevice": "c172fcd9.e64cf",
"address": "100",
"command": "",
"count": "31",
"x": 1516.2459335327148,
"y": 368.61873054504395,
"wires": [
[
"52f469d8.5786d8",
"f4d86dcb.70308"
]
]
},
{
"id": "cc96c183.2fc47",
"type": "function",
"z": "e562458a.b05e28",
"name": "clear cal",
"func": "msg.payload=[0x63,0x61,0x6c,0x2c,0x63,0x6c,0x65,0x61,0x72]\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 762.6458053588867,
"y": 1094.0853157043457,
"wires": [
[
"36e39814.ca2338",
"75113844.7cb1f8"
]
]
},
{
"id": "7d7d11e0.a3832",
"type": "function",
"z": "e562458a.b05e28",
"name": "check cal",
"func": "msg.payload=[0x63,0x61,0x6c,0x2c,0x3f]\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 803.6458625793457,
"y": 1164.085361480713,
"wires": [
[
"36e39814.ca2338",
"75113844.7cb1f8"
]
]
},
{
"id": "ca3a49c4.2e8268",
"type": "ui_button",
"z": "e562458a.b05e28",
"name": "",
"group": "ecd09f83.54653",
"order": 9,
"width": "3",
"height": "1",
"passthru": false,
"label": "Clear Cal",
"color": "",
"bgcolor": "",
"icon": "delete",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 558.6457977294922,
"y": 1094.0852909088135,
"wires": [
[
"cc96c183.2fc47"
]
]
},
{
"id": "f105813b.c740d",
"type": "ui_button",
"z": "e562458a.b05e28",
"name": "",
"group": "ecd09f83.54653",
"order": 8,
"width": "3",
"height": "1",
"passthru": false,
"label": "Check Cal",
"color": "",
"bgcolor": "",
"icon": "check",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 562.645809173584,
"y": 1166.0853471755981,
"wires": [
[
"7d7d11e0.a3832"
]
]
},
{
"id": "63911583.5bb37c",
"type": "function",
"z": "e562458a.b05e28",
"name": "Set Temperature Correction",
"func": "tempcorr = global.get('EC1tempcorr');\nvar arr=[0x54,0x2c];\narr = arr.concat(tempcorr);\nmsg.payload=arr;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 814.6459159851074,
"y": 1268.4189834594727,
"wires": [
[
"da9ad614.eff678",
"75113844.7cb1f8"
]
]
},
{
"id": "a4f93896.469298",
"type": "ui_button",
"z": "e562458a.b05e28",
"name": "Temp Correction Save",
"group": "ecd09f83.54653",
"order": 11,
"width": "3",
"height": "1",
"passthru": false,
"label": "Temp Correction",
"color": "",
"bgcolor": "",
"icon": "save",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 542.6457939147949,
"y": 1269.418851852417,
"wires": [
[
"63911583.5bb37c"
]
]
},
{
"id": "5ba6b23a.52f0cc",
"type": "ui_text_input",
"z": "e562458a.b05e28",
"name": "",
"label": "Temperature Correction Value",
"group": "ecd09f83.54653",
"order": 10,
"width": 0,
"height": 0,
"passthru": true,
"mode": "text",
"delay": "20",
"topic": "",
"x": 523.7125816345215,
"y": 1374.085292816162,
"wires": [
[
"e9a4922d.febb7"
]
]
},
{
"id": "e9a4922d.febb7",
"type": "function",
"z": "e562458a.b05e28",
"name": "Define global.EC1tempcorr",
"func": "var str = msg.payload;\nmsg.payload = str.split ('').map (function (c) { return c.charCodeAt (0); })\nglobal.set('EC1tempcorr',msg.payload);\nreturn msg;\n ",
"outputs": 1,
"noerr": 0,
"x": 837.6459465026855,
"y": 1382.7518730163574,
"wires": [
[
"75113844.7cb1f8"
]
]
},
{
"id": "f5eb38d8.c87638",
"type": "debug",
"z": "e562458a.b05e28",
"name": "",
"active": true,
"console": "false",
"complete": "true",
"x": 1224.6457786560059,
"y": 1134.7519283294678,
"wires": []
},
{
"id": "62e208d3.2dcdd8",
"type": "ui_button",
"z": "e562458a.b05e28",
"name": " Temp Correction Check",
"group": "ecd09f83.54653",
"order": 12,
"width": "3",
"height": "1",
"passthru": false,
"label": "Temp Correction",
"color": "",
"bgcolor": "",
"icon": "check",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 554.6457977294922,
"y": 1513.1518878936768,
"wires": [
[
"6025f3a8.6cd54c"
]
]
},
{
"id": "6025f3a8.6cd54c",
"type": "function",
"z": "e562458a.b05e28",
"name": "Check Temperature Correction",
"func": "var arr=[0x54,0x2c,0x3f];\nmsg.payload=arr;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 861.6458282470703,
"y": 1512.1519136428833,
"wires": [
[
"36e39814.ca2338",
"75113844.7cb1f8"
]
]
},
{
"id": "36e39814.ca2338",
"type": "delay",
"z": "e562458a.b05e28",
"name": "",
"pauseType": "delay",
"timeout": "300",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 1003.525016784668,
"y": 679.6372776031494,
"wires": [
[
"720f232c.a3ecac"
]
]
},
{
"id": "e339b216.77a2a",
"type": "ui_button",
"z": "e562458a.b05e28",
"name": "",
"group": "ecd09f83.54653",
"order": 6,
"width": "3",
"height": "1",
"passthru": false,
"label": "EC Cal Custom",
"color": "",
"bgcolor": "",
"icon": "perm_data_setting",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 561.2124214172363,
"y": 895.4187650680542,
"wires": [
[
"9fb9719c.15e1"
]
]
},
{
"id": "9fb9719c.15e1",
"type": "function",
"z": "e562458a.b05e28",
"name": "EC Cal Custom",
"func": "customEC1 = global.get('customEC1');\nvar arr=[0x63, 0x61, 0x6c, 0x2c];\narr = arr.concat(customEC1);\nmsg.payload=arr;\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"x": 773.2125129699707,
"y": 904.4187879562378,
"wires": [
[
"da9ad614.eff678",
"75113844.7cb1f8"
]
]
},
{
"id": "1d475bcb.bc4824",
"type": "ui_text_input",
"z": "e562458a.b05e28",
"name": "",
"label": "Custom EC",
"group": "ecd09f83.54653",
"order": 7,
"width": 0,
"height": 0,
"passthru": true,
"mode": "text",
"delay": "20",
"topic": "",
"x": 544.6124229431152,
"y": 973.4187831878662,
"wires": [
[
"866e7619.a584f8"
]
]
},
{
"id": "866e7619.a584f8",
"type": "function",
"z": "e562458a.b05e28",
"name": "define global.customEC1",
"func": "var str = msg.payload;\nmsg.payload = str.split ('').map (function (c) { return c.charCodeAt (0); })\nglobal.set('customEC1',msg.payload);\nreturn msg;\n ",
"outputs": 1,
"noerr": 0,
"x": 769.5458946228027,
"y": 969.0851898193359,
"wires": [
[
"75113844.7cb1f8"
]
]
},
{
"id": "15eb76b2.7bf1b9",
"type": "delay",
"z": "4959b239.3baf5c",
"name": "",
"pauseType": "delay",
"timeout": "600",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 1595.8125610351562,
"y": 146.66672611236572,
"wires": [
[
"eb730249.3d43a"
]
]
},
{
"id": "53c90a1c.6c6034",
"type": "function",
"z": "4959b239.3baf5c",
"name": "Read EC",
"func": "msg.payload=[0x72];\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1375.8124923706055,
"y": 145.9335470199585,
"wires": [
[
"15eb76b2.7bf1b9",
"5baf940f.5197dc"
]
]
},
{
"id": "d5b16555.e19418",
"type": "ui_switch",
"z": "4959b239.3baf5c",
"name": "",
"label": "EC Sensor #2 Continous Read",
"group": "ca4a0643.3b3f88",
"order": 4,
"width": 0,
"height": 0,
"passthru": true,
"decouple": "false",
"topic": "",
"style": "",
"onvalue": "1",
"onvalueType": "num",
"onicon": "",
"oncolor": "",
"offvalue": "0",
"offvalueType": "num",
"officon": "",
"offcolor": "",
"x": 483,
"y": 235.06682109832764,
"wires": [
[
"f46a809e.3b16"
]
]
},
{
"id": "f46a809e.3b16",
"type": "trigger",
"z": "4959b239.3baf5c",
"op1": "true",
"op2": "0",
"op1type": "bool",
"op2type": "str",
"duration": "-3000",
"extend": false,
"units": "ms",
"reset": "0",
"name": "",
"x": 748.8791809082031,
"y": 233.86667442321777,
"wires": [
[
"befa4032.c866a"
]
]
},
{
"id": "9335c0b.cfe324",
"type": "ui_text",
"z": "4959b239.3baf5c",
"group": "ca4a0643.3b3f88",
"order": 16,
"width": 0,
"height": 0,
"name": "",
"label": "EC #2",
"format": "{{msg.payload}}uS",
"layout": "row-right",
"x": 2299.8791828155518,
"y": 142.6667013168335,
"wires": []
},
{
"id": "82a3c8e1.8c8ff8",
"type": "function",
"z": "4959b239.3baf5c",
"name": "Define global.EC2",
"func": "var EC2 = msg.payload.toString().slice(1)\nEC2 = parseFloat(EC2);\nmsg.payload = EC2.toFixed(2)\nglobal.set(\"EC2\",msg.payload);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 2067.6459732055664,
"y": 139.60000228881836,
"wires": [
[
"9335c0b.cfe324",
"8c993de6.647aa"
]
]
},
{
"id": "8c993de6.647aa",
"type": "debug",
"z": "4959b239.3baf5c",
"name": "",
"active": false,
"console": "false",
"complete": "true",
"x": 2025.945945739746,
"y": 45.99999713897705,
"wires": []
},
{
"id": "eb730249.3d43a",
"type": "i2c in",
"z": "4959b239.3baf5c",
"name": "",
"i2cdevice": "c172fcd9.e64cf",
"address": "101",
"command": "",
"count": "31",
"x": 1796.4123764038086,
"y": 143.53334045410156,
"wires": [
[
"82a3c8e1.8c8ff8",
"8c993de6.647aa"
]
]
},
{
"id": "9c94b27e.8d172",
"type": "ui_button",
"z": "4959b239.3baf5c",
"name": "",
"group": "6666aed4.efad4",
"order": 3,
"width": "3",
"height": "1",
"passthru": false,
"label": "EC Cal Dry (#1)",
"color": "",
"bgcolor": "",
"icon": "perm_data_setting",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 517.8125190734863,
"y": 777.4667320251465,
"wires": [
[
"70d6390c.634ca8"
]
]
},
{
"id": "70d6390c.634ca8",
"type": "function",
"z": "4959b239.3baf5c",
"name": "EC Cal Dry",
"func": "msg.payload=[0x63,0x61,0x6c,0x2c,0x64,0x72,0x79];\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 734.645881652832,
"y": 778.9333381652832,
"wires": [
[
"c12414cb.202ee8",
"dc82d664.9b21d8"
]
]
},
{
"id": "91777d80.bac18",
"type": "function",
"z": "4959b239.3baf5c",
"name": "EC Cal Low",
"func": "msg.payload=[0x63, 0x61, 0x6c, 0x2c, 0x6c, 0x6f, 0x77, 0x2c, 0x31, 0x32, 0x38, 0x38, 0x30];\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 728.6459426879883,
"y": 842.9333457946777,
"wires": [
[
"c12414cb.202ee8",
"dc82d664.9b21d8"
]
]
},
{
"id": "38c6e7d2.e2ad58",
"type": "function",
"z": "4959b239.3baf5c",
"name": "EC Cal High",
"func": "msg.payload=[0x63, 0x61, 0x6c, 0x2c, 0x68, 0x69, 0x67, 0x68, 0x2c, 0x38, 0x30, 0x30, 0x30, 0x30];\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 726.6458892822266,
"y": 893.9334344863892,
"wires": [
[
"c12414cb.202ee8",
"dc82d664.9b21d8"
]
]
},
{
"id": "ff0d9270.493da",
"type": "ui_button",
"z": "4959b239.3baf5c",
"name": "",
"group": "6666aed4.efad4",
"order": 4,
"width": "3",
"height": "1",
"passthru": false,
"label": "EC Cal Low (12,880uS)",
"color": "",
"bgcolor": "",
"icon": "perm_data_setting",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 480.64585876464844,
"y": 838.9332826137543,
"wires": [
[
"91777d80.bac18"
]
]
},
{
"id": "3ee0590d.b71db6",
"type": "ui_button",
"z": "4959b239.3baf5c",
"name": "",
"group": "6666aed4.efad4",
"order": 5,
"width": "3",
"height": "1",
"passthru": false,
"label": "EC Cal High (80,000uS)",
"color": "",
"bgcolor": "",
"icon": "perm_data_setting",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 487.64585876464844,
"y": 881.9334192276001,
"wires": [
[
"38c6e7d2.e2ad58"
]
]
},
{
"id": "78bdae96.f402b",
"type": "ui_text",
"z": "4959b239.3baf5c",
"group": "6666aed4.efad4",
"order": 14,
"width": 0,
"height": 0,
"name": "",
"label": "Debug",
"format": "{{msg.payload}}",
"layout": "row-spread",
"x": 1499.6457977294922,
"y": 704.6001710891724,
"wires": []
},
{
"id": "dbee02df.8f8d1",
"type": "function",
"z": "4959b239.3baf5c",
"name": "Responce",
"func": "msg.payload = msg.payload.toString();\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1338.6457901000977,
"y": 714.600170135498,
"wires": [
[
"78bdae96.f402b",
"bcbd78f4.a226f8"
]
]
},
{
"id": "93d83b91.9d0a38",
"type": "i2c in",
"z": "4959b239.3baf5c",
"name": "",
"i2cdevice": "c172fcd9.e64cf",
"address": "101",
"command": "",
"count": "32",
"x": 1135.6457977294922,
"y": 721.6002187728882,
"wires": [
[
"dbee02df.8f8d1",
"bcbd78f4.a226f8"
]
]
},
{
"id": "c12414cb.202ee8",
"type": "delay",
"z": "4959b239.3baf5c",
"name": "",
"pauseType": "delay",
"timeout": "800",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 935.6458320617676,
"y": 687.600058555603,
"wires": [
[
"93d83b91.9d0a38"
]
]
},
{
"id": "bcbd78f4.a226f8",
"type": "debug",
"z": "4959b239.3baf5c",
"name": "",
"active": true,
"console": "false",
"complete": "true",
"x": 1465.7124862670898,
"y": 786.5999870300293,
"wires": []
},
{
"id": "a18d0338.b16a5",
"type": "ui_button",
"z": "4959b239.3baf5c",
"name": "",
"group": "6666aed4.efad4",
"order": 2,
"width": 0,
"height": 0,
"passthru": false,
"label": "Check EC",
"color": "",
"bgcolor": "",
"icon": "cached",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 433.0000228881836,
"y": 464.60010385513306,
"wires": [
[
"b60beb72.781af8"
]
]
},
{
"id": "792a2c58.2c2c54",
"type": "delay",
"z": "4959b239.3baf5c",
"name": "",
"pauseType": "delay",
"timeout": "600",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 1571.6458892822266,
"y": 379.60006189346313,
"wires": [
[
"a2e76a99.892108"
]
]
},
{
"id": "a8ae89e9.fb9548",
"type": "function",
"z": "4959b239.3baf5c",
"name": "Read EC",
"func": "msg.payload=[0x72];\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1333.6458587646484,
"y": 374.86684942245483,
"wires": [
[
"792a2c58.2c2c54",
"64223a22.5934d4"
]
]
},
{
"id": "6cccd079.21c68",
"type": "ui_text",
"z": "4959b239.3baf5c",
"group": "6666aed4.efad4",
"order": 1,
"width": 0,
"height": 0,
"name": "",
"label": "EC",
"format": "{{msg.payload}}uS",
"layout": "row-right",
"x": 2255.712776184082,
"y": 380.6000499725342,
"wires": []
},
{
"id": "19442c9c.e9c0b3",
"type": "function",
"z": "4959b239.3baf5c",
"name": "Define global.EC2",
"func": "var EC2 = msg.payload.toString().slice(1)\nEC2 = parseFloat(EC2);\nmsg.payload = EC2.toFixed(2)\nglobal.set(\"EC2\",msg.payload);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 2008.4792785644531,
"y": 376.5333504676819,
"wires": [
[
"6cccd079.21c68"
]
]
},
{
"id": "a2e76a99.892108",
"type": "i2c in",
"z": "4959b239.3baf5c",
"name": "",
"i2cdevice": "c172fcd9.e64cf",
"address": "101",
"command": "",
"count": "31",
"x": 1762.2458419799805,
"y": 377.46666383743286,
"wires": [
[
"19442c9c.e9c0b3",
"8c993de6.647aa"
]
]
},
{
"id": "23a97143.3202ee",
"type": "function",
"z": "4959b239.3baf5c",
"name": "clear cal",
"func": "msg.payload=[0x63,0x61,0x6c,0x2c,0x63,0x6c,0x65,0x61,0x72]\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 715.6457710266113,
"y": 1163.9332809448242,
"wires": [
[
"ef053e9e.5da73",
"dc82d664.9b21d8"
]
]
},
{
"id": "70c25a20.6839b4",
"type": "function",
"z": "4959b239.3baf5c",
"name": "check cal",
"func": "msg.payload=[0x63,0x61,0x6c,0x2c,0x3f]\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 756.6458282470703,
"y": 1233.9333267211914,
"wires": [
[
"ef053e9e.5da73",
"dc82d664.9b21d8"
]
]
},
{
"id": "54a059f2.bdf6e8",
"type": "ui_button",
"z": "4959b239.3baf5c",
"name": "",
"group": "6666aed4.efad4",
"order": 9,
"width": "3",
"height": "1",
"passthru": false,
"label": "Clear Cal",
"color": "",
"bgcolor": "",
"icon": "delete",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 511.6457633972168,
"y": 1163.933256149292,
"wires": [
[
"23a97143.3202ee"
]
]
},
{
"id": "674e2cf9.c84194",
"type": "ui_button",
"z": "4959b239.3baf5c",
"name": "",
"group": "6666aed4.efad4",
"order": 8,
"width": "3",
"height": "1",
"passthru": false,
"label": "Check Cal",
"color": "",
"bgcolor": "",
"icon": "",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 515.6457748413086,
"y": 1235.9333124160767,
"wires": [
[
"70c25a20.6839b4"
]
]
},
{
"id": "ca2d5f2.d94ada",
"type": "function",
"z": "4959b239.3baf5c",
"name": "Set Temperature Correction",
"func": "tempcorr = global.get('EC2tempcorr');\nvar arr=[0x54,0x2c];\narr = arr.concat(tempcorr);\nmsg.payload=arr;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 774.6457138061523,
"y": 1348.266661643982,
"wires": [
[
"c12414cb.202ee8",
"dc82d664.9b21d8"
]
]
},
{
"id": "ee39416d.fdc23",
"type": "ui_button",
"z": "4959b239.3baf5c",
"name": "Temp Correction Send",
"group": "6666aed4.efad4",
"order": 11,
"width": "3",
"height": "1",
"passthru": false,
"label": "Temp Correction",
"color": "",
"bgcolor": "",
"icon": "save",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 494.645751953125,
"y": 1343.2668352127075,
"wires": [
[
"ca2d5f2.d94ada"
]
]
},
{
"id": "e364cdfb.1fd25",
"type": "ui_text_input",
"z": "4959b239.3baf5c",
"name": "",
"label": "Temperature Correction Value",
"group": "6666aed4.efad4",
"order": 10,
"width": 0,
"height": 0,
"passthru": true,
"mode": "text",
"delay": "20",
"topic": "",
"x": 516.7124252319336,
"y": 1453.9333047866821,
"wires": [
[
"512ab0cd.4bd02"
]
]
},
{
"id": "512ab0cd.4bd02",
"type": "function",
"z": "4959b239.3baf5c",
"name": "Define global.EC2tempcorr",
"func": "var str = msg.payload;\nmsg.payload = str.split ('').map (function (c) { return c.charCodeAt (0); })\nglobal.set('EC2tempcorr',msg.payload);\nreturn msg;\n ",
"outputs": 1,
"noerr": 0,
"x": 790.6459121704102,
"y": 1452.599838256836,
"wires": [
[
"dc82d664.9b21d8"
]
]
},
{
"id": "2f12fd81.3551d2",
"type": "debug",
"z": "4959b239.3baf5c",
"name": "",
"active": true,
"console": "false",
"complete": "true",
"x": 1177.6457443237305,
"y": 1204.5998935699463,
"wires": []
},
{
"id": "892565e.c29c598",
"type": "ui_button",
"z": "4959b239.3baf5c",
"name": "Temp Correction Check",
"group": "6666aed4.efad4",
"order": 12,
"width": "3",
"height": "1",
"passthru": false,
"label": "Temp Correction",
"color": "",
"bgcolor": "",
"icon": "check",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 507.6457633972168,
"y": 1582.9998531341553,
"wires": [
[
"65eddf1f.31a71"
]
]
},
{
"id": "65eddf1f.31a71",
"type": "function",
"z": "4959b239.3baf5c",
"name": "Check Temperature Correction",
"func": "var arr=[0x54,0x2c,0x3f];\nmsg.payload=arr;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 814.6457939147949,
"y": 1581.9998788833618,
"wires": [
[
"ef053e9e.5da73",
"dc82d664.9b21d8"
]
]
},
{
"id": "ef053e9e.5da73",
"type": "delay",
"z": "4959b239.3baf5c",
"name": "",
"pauseType": "delay",
"timeout": "300",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 956.5249824523926,
"y": 749.4852428436279,
"wires": [
[
"93d83b91.9d0a38"
]
]
},
{
"id": "5adb2622.8da4f8",
"type": "ui_button",
"z": "4959b239.3baf5c",
"name": "",
"group": "6666aed4.efad4",
"order": 6,
"width": "3",
"height": "1",
"passthru": false,
"label": "EC Cal Custom",
"color": "",
"bgcolor": "",
"icon": "perm_data_setting",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 514.2123870849609,
"y": 965.2667303085327,
"wires": [
[
"4ea064b9.05d2ac"
]
]
},
{
"id": "4ea064b9.05d2ac",
"type": "function",
"z": "4959b239.3baf5c",
"name": "EC Cal Custom",
"func": "customEC2 = global.get('customEC2');\nvar arr=[0x63, 0x61, 0x6c, 0x2c];\narr = arr.concat(customEC2);\nmsg.payload=arr;\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"x": 726.2124786376953,
"y": 974.2667531967163,
"wires": [
[
"c12414cb.202ee8"
]
]
},
{
"id": "f9ac580a.6b3eb8",
"type": "ui_text_input",
"z": "4959b239.3baf5c",
"name": "",
"label": "Custom EC",
"group": "6666aed4.efad4",
"order": 7,
"width": 0,
"height": 0,
"passthru": true,
"mode": "text",
"delay": "20",
"topic": "",
"x": 498.6123962402344,
"y": 1041.266749382019,
"wires": [
[
"4ebc4146.1f923"
]
]
},
{
"id": "4ebc4146.1f923",
"type": "function",
"z": "4959b239.3baf5c",
"name": "define global.customEC2",
"func": "var str = msg.payload;\nmsg.payload = str.split ('').map (function (c) { return c.charCodeAt (0); })\nglobal.set('customEC2',msg.payload);\nreturn msg;\n ",
"outputs": 1,
"noerr": 0,
"x": 722.5458602905273,
"y": 1038.9331550598145,
"wires": [
[
"dc82d664.9b21d8"
]
]
},
{
"id": "4ab3036a.e1f6bc",
"type": "function",
"z": "9368ac8b.630df",
"name": "Sleep",
"func": "msg.payload=[0x73,0x6c,0x65,0x65,0x70];\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 866.012523651123,
"y": 1308.818564414978,
"wires": [
[
"a5238509.6a0528"
]
]
},
{
"id": "cefddfb3.a1c4d",
"type": "ui_button",
"z": "9368ac8b.630df",
"name": "",
"group": "eee554a2.f4fad8",
"order": 11,
"width": "6",
"height": "1",
"passthru": false,
"label": "Sleep",
"color": "",
"bgcolor": "",
"icon": "snooze",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 474.0125846862793,
"y": 1308.818588256836,
"wires": [
[
"4ab3036a.e1f6bc"
]
]
},
{
"id": "bb5dbe90.843d3",
"type": "function",
"z": "e562458a.b05e28",
"name": "Sleep",
"func": "msg.payload=[0x73,0x6c,0x65,0x65,0x70];\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 916.8124542236328,
"y": 1611.8187274932861,
"wires": [
[]
]
},
{
"id": "fe796fe9.5d914",
"type": "ui_button",
"z": "e562458a.b05e28",
"name": "",
"group": "ecd09f83.54653",
"order": 13,
"width": "6",
"height": "1",
"passthru": false,
"label": "Sleep",
"color": "",
"bgcolor": "",
"icon": "snooze",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 521.8124694824219,
"y": 1613.8186297416687,
"wires": [
[
"bb5dbe90.843d3"
]
]
},
{
"id": "314fa825.bc2328",
"type": "function",
"z": "4959b239.3baf5c",
"name": "Sleep",
"func": "msg.payload=[0x73,0x6c,0x65,0x65,0x70];\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 884.8124313354492,
"y": 1705.8187246322632,
"wires": [
[
"dc82d664.9b21d8"
]
]
},
{
"id": "774a22b1.aef89c",
"type": "ui_button",
"z": "4959b239.3baf5c",
"name": "",
"group": "6666aed4.efad4",
"order": 13,
"width": "6",
"height": "1",
"passthru": false,
"label": "Sleep",
"color": "",
"bgcolor": "",
"icon": "snooze",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 492.81249237060547,
"y": 1705.818748474121,
"wires": [
[
"314fa825.bc2328"
]
]
},
{
"id": "8242077f.e5b468",
"type": "debug",
"z": "5fb493fb.22d96c",
"name": "",
"active": false,
"console": "true",
"complete": "true",
"x": 1508.1669692993164,
"y": 480.73353385925293,
"wires": []
},
{
"id": "351d9ec.7150862",
"type": "inject",
"z": "5fb493fb.22d96c",
"name": "",
"topic": "",
"payload": "1",
"payloadType": "num",
"repeat": "",
"crontab": "",
"once": false,
"x": 110,
"y": 500,
"wires": [
[
"bd509786.066cb8"
]
]
},
{
"id": "bd509786.066cb8",
"type": "function",
"z": "5fb493fb.22d96c",
"name": "program start/stop",
"func": "if (msg.payload === 0){\n msg.kill = \"SIGKILL\";\n\n} else if (msg.payload === 1){\n msg.payload = 1;\n\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 510,
"y": 600,
"wires": [
[
"877b620a.467b"
]
]
},
{
"id": "b242ac13.45548",
"type": "inject",
"z": "5fb493fb.22d96c",
"name": "",
"topic": "",
"payload": "0",
"payloadType": "num",
"repeat": "",
"crontab": "",
"once": false,
"x": 128.1666603088379,
"y": 675.2667102813721,
"wires": [
[
"bd509786.066cb8"
]
]
},
{
"id": "4d2f6ece.616b3",
"type": "function",
"z": "bca3b7d8.ee3178",
"name": "Return global.EC1",
"func": "msg.payload = global.get('EC1');\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"x": 697.1208572387695,
"y": 1108.781222820282,
"wires": [
[
"58b54ca3.0b2d04"
]
]
},
{
"id": "498629e7.7cba08",
"type": "function",
"z": "bca3b7d8.ee3178",
"name": "Return global.EC2",
"func": "msg.payload = global.get('EC2');\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"x": 735.1208267211914,
"y": 1202.781222820282,
"wires": [
[
"52290ca2.f6c5a4"
]
]
},
{
"id": "52290ca2.f6c5a4",
"type": "ui_gauge",
"z": "bca3b7d8.ee3178",
"name": "Permeate Conductivity",
"group": "1cf729f1.c8f1c6",
"order": 3,
"width": "0",
"height": "0",
"gtype": "gage",
"title": "Permeate Conductivity",
"label": "uS",
"format": "{{value| number:2}}",
"min": 0,
"max": "80000",
"colors": [
"#00ff00",
"#ffff00",
"#ff0000"
],
"seg1": "2000",
"seg2": "15000",
"x": 987.1208419799805,
"y": 1202.781394481659,
"wires": []
},
{
"id": "58b54ca3.0b2d04",
"type": "ui_gauge",
"z": "bca3b7d8.ee3178",
"name": "Feed Conductivity",
"group": "1cf729f1.c8f1c6",
"order": 2,
"width": "0",
"height": "0",
"gtype": "gage",
"title": "Feed Conductivity",
"label": "uS",
"format": "{{value| number:2}}",
"min": 0,
"max": "80000",
"colors": [
"#00ff13",
"#ffff00",
"#ff0000"
],
"seg1": "2000",
"seg2": "15000",
"x": 987.1208419799805,
"y": 1106.7814326286316,
"wires": []
},
{
"id": "12036e0e.659fc2",
"type": "function",
"z": "6192cd5f.3ebfb4",
"name": "Return global.temp2",
"func": "msg.payload = global.get('temp2');\nmsg.topic = 'Permeate Temperature'\nreturn msg;\n\n\n",
"outputs": 1,
"noerr": 0,
"x": 500,
"y": 580,
"wires": [
[
"1973c83c.540cb8"
]
]
},
{
"id": "20dd7531.8ab8ba",
"type": "function",
"z": "6192cd5f.3ebfb4",
"name": "Return global.pH",
"func": "msg.payload = global.get('pH');\nmsg.topic = 'pH'\nreturn msg;\n\n\n",
"outputs": 1,
"noerr": 0,
"x": 490,
"y": 640,
"wires": [
[
"d2dcd2c0.f1862"
]
]
},
{
"id": "22fbe7d7.b24558",
"type": "function",
"z": "6192cd5f.3ebfb4",
"name": "Return global.EC1",
"func": "msg.payload = global.get('EC1');\nmsg.topic = 'Feed Conductivity'\nreturn msg;\n\n\n",
"outputs": 1,
"noerr": 0,
"x": 450,
"y": 920,
"wires": [
[
"eba1ac79.8f64a"
]
]
},
{
"id": "e07578b3.7b5548",
"type": "function",
"z": "6192cd5f.3ebfb4",
"name": "Return global.EC2",
"func": "msg.payload = global.get('EC2');\nmsg.topic = 'Permeate Conductivity'\nreturn msg;\n\n\n",
"outputs": 1,
"noerr": 0,
"x": 450,
"y": 1020,
"wires": [
[
"eba1ac79.8f64a"
]
]
},
{
"id": "2d765923.10fb36",
"type": "ui_button",
"z": "722422f2.92376c",
"name": "",
"group": "967ebb71.cdb518",
"order": 2,
"width": "2",
"height": "1",
"passthru": false,
"label": "Update",
"color": "",
"bgcolor": "",
"icon": "update",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 395.9333305358887,
"y": 483.2668695449829,
"wires": [
[
"a9162dd7.ddb3e",
"8371e31.6e9c72"
]
]
},
{
"id": "29be8e7.807de72",
"type": "ui_button",
"z": "6192cd5f.3ebfb4",
"name": "",
"group": "1d80b743.0287b9",
"order": 4,
"width": "2",
"height": "1",
"passthru": false,
"label": "Update",
"color": "",
"bgcolor": "",
"icon": "update",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 124.93333435058594,
"y": 676.0000219345093,
"wires": [
[
"d1e74b4e.bb1ac8",
"3953b26f.60b63e",
"12036e0e.659fc2",
"20dd7531.8ab8ba",
"22fbe7d7.b24558",
"e07578b3.7b5548",
"e40145b2.0f8618",
"f87595cd.0560b8",
"239c2a22.11fe16",
"a3a3d800.af1cc8"
]
]
},
{
"id": "1d27e964.e87ca7",
"type": "trigger",
"z": "20ece430.4c99ec",
"op1": "0",
"op2": "",
"op1type": "num",
"op2type": "nul",
"duration": "0",
"extend": false,
"units": "ms",
"reset": "123",
"name": "",
"x": 857.2336120605469,
"y": 577.2000560760498,
"wires": [
[
"3d74c80a.57a468",
"a17279c1.d62958",
"d34209ee.10a4f8",
"7534da9f.c17234"
]
]
},
{
"id": "777fc4cd.c915cc",
"type": "function",
"z": "e562458a.b05e28",
"name": "Set Temperature Correction",
"func": "msg.payload = global.get('EC1tempcorr');\nvar str = String(msg.payload);\nmsg.payload = str.split ('').map (function (c) { return c.charCodeAt (0); });\nvar arr=[0x54,0x2c];\narr = arr.concat(msg.payload);\nmsg.payload=arr;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1005.2666778564453,
"y": 238.9333724975586,
"wires": [
[
"d1784135.dda54",
"b21b776.63f7d88"
]
]
},
{
"id": "d1784135.dda54",
"type": "delay",
"z": "e562458a.b05e28",
"name": "",
"pauseType": "delay",
"timeout": "300",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 1199.5000457763672,
"y": 153.73334980010986,
"wires": [
[
"b6ddf529.554718"
]
]
},
{
"id": "1f9d9b37.fbb415",
"type": "function",
"z": "e562458a.b05e28",
"name": "Set Temperature Correction",
"func": "msg.payload = global.get('EC1tempcorr');\nvar str = String(msg.payload);\nmsg.payload = str.split ('').map (function (c) { return c.charCodeAt (0); });\nvar arr=[0x54,0x2c];\narr = arr.concat(msg.payload);\nmsg.payload=arr;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 652.012565612793,
"y": 459.81879234313965,
"wires": [
[
"c4e0c119.dde85",
"c8213add.db3448"
]
]
},
{
"id": "c4e0c119.dde85",
"type": "delay",
"z": "e562458a.b05e28",
"name": "",
"pauseType": "delay",
"timeout": "300",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 939.012565612793,
"y": 395.81879234313965,
"wires": [
[
"e4086e29.edb8c"
]
]
},
{
"id": "befa4032.c866a",
"type": "function",
"z": "4959b239.3baf5c",
"name": "Set Temperature Correction",
"func": "msg.payload = global.get('EC1tempcorr');\nvar str = String(msg.payload);\nmsg.payload = str.split ('').map (function (c) { return c.charCodeAt (0); });\nvar arr=[0x54,0x2c];\narr = arr.concat(msg.payload);\nmsg.payload=arr;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1026.812240600586,
"y": 233.81872367858887,
"wires": [
[
"bbd02d75.5440d",
"5baf940f.5197dc"
]
]
},
{
"id": "bbd02d75.5440d",
"type": "delay",
"z": "4959b239.3baf5c",
"name": "",
"pauseType": "delay",
"timeout": "300",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 1200.8123931884766,
"y": 143.81875228881836,
"wires": [
[
"53c90a1c.6c6034"
]
]
},
{
"id": "b60beb72.781af8",
"type": "function",
"z": "4959b239.3baf5c",
"name": "Set Temperature Correction",
"func": "msg.payload = global.get('EC1tempcorr');\nvar str = String(msg.payload);\nmsg.payload = str.split ('').map (function (c) { return c.charCodeAt (0); });\nvar arr=[0x54,0x2c];\narr = arr.concat(msg.payload);\nmsg.payload=arr;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 673.8124618530273,
"y": 464.8187623023987,
"wires": [
[
"9f1cb133.78276",
"64223a22.5934d4"
]
]
},
{
"id": "9f1cb133.78276",
"type": "delay",
"z": "4959b239.3baf5c",
"name": "",
"pauseType": "delay",
"timeout": "300",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 1114.8125076293945,
"y": 371.81878995895386,
"wires": [
[
"a8ae89e9.fb9548"
]
]
},
{
"id": "b99adb57.cdb048",
"type": "delay",
"z": "9368ac8b.630df",
"name": "",
"pauseType": "delay",
"timeout": "400",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 1144.3999099731445,
"y": 124.40000438690186,
"wires": [
[
"cd5b145b.38a548"
]
]
},
{
"id": "55cb1e85.f9d1b",
"type": "function",
"z": "9368ac8b.630df",
"name": "Set Temperature Correction",
"func": "msg.payload = global.get('pHtempcorr');\nvar str = String(msg.payload);\nmsg.payload = str.split ('').map (function (c) { return c.charCodeAt (0); });\nvar arr=[0x54,0x2c];\narr = arr.concat(msg.payload);\nmsg.payload=arr;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1016.3998260498047,
"y": 221.39996910095215,
"wires": [
[
"b99adb57.cdb048",
"e482354f.59b718"
]
]
},
{
"id": "d6a57c74.bbdbf",
"type": "function",
"z": "9368ac8b.630df",
"name": "Set Temperature Correction",
"func": "msg.payload = global.get('pHtempcorr');\nvar str = String(msg.payload);\nmsg.payload = str.split ('').map (function (c) { return c.charCodeAt (0); });\nvar arr=[0x54,0x2c];\narr = arr.concat(msg.payload);\nmsg.payload=arr;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 706.3999938964844,
"y": 426.399995803833,
"wires": [
[
"d59522a8.37008",
"dc1fe86e.df1088",
"cae37f4a.d23a7"
]
]
},
{
"id": "d59522a8.37008",
"type": "delay",
"z": "9368ac8b.630df",
"name": "",
"pauseType": "delay",
"timeout": "300",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 916.4000473022461,
"y": 337.40002822875977,
"wires": [
[
"c6157e8.c146b8"
]
]
},
{
"id": "2838f492.2edd3c",
"type": "comment",
"z": "9368ac8b.630df",
"name": "Continous Reading of pH with temperature correction taken from global.pHtempcorr",
"info": "Continous Reading of pH with temperature correction\ntaken from pHtempcorr",
"x": 632.9999694824219,
"y": 83.00001168251038,
"wires": []
},
{
"id": "5a825013.1d218",
"type": "comment",
"z": "9368ac8b.630df",
"name": "Push button peading of pH with temperature correction taken from global.pHtempcorr",
"info": "Continous Reading of pH with temperature correction\ntaken from pHtempcorr",
"x": 632.9999694824219,
"y": 287.4000015258789,
"wires": []
},
{
"id": "21cff73.2883408",
"type": "comment",
"z": "9368ac8b.630df",
"name": "Calibration buttons for pH circuit",
"info": "Continous Reading of pH with temperature correction\ntaken from pHtempcorr",
"x": 472.9999694824219,
"y": 548.3999300003052,
"wires": []
},
{
"id": "dc78f250.20c4b",
"type": "comment",
"z": "e562458a.b05e28",
"name": "Continous Reading of EC with temperature correction taken from global.EC1tempcorr",
"info": "Continous Reading of pH with temperature correction\ntaken from pHtempcorr",
"x": 666.199951171875,
"y": 98.40000438690186,
"wires": []
},
{
"id": "e9ecac61.9b003",
"type": "comment",
"z": "e562458a.b05e28",
"name": "Push button peading of EC with temperature correction taken from global.EC1tempcorr",
"info": "Continous Reading of EC with temperature correction\ntaken from pHtempcorr",
"x": 673.2000122070312,
"y": 313.8000030517578,
"wires": []
},
{
"id": "7635a54.c4d7c5c",
"type": "comment",
"z": "e562458a.b05e28",
"name": "Calibration buttons for EC circuit",
"info": "Continous Reading of pH with temperature correction\ntaken from pHtempcorr",
"x": 498.19996643066406,
"y": 557.7997856140137,
"wires": []
},
{
"id": "daf69683.b956a8",
"type": "comment",
"z": "4959b239.3baf5c",
"name": "Push button peading of EC with temperature correction taken from global.EC2tempcorr",
"info": "Continous Reading of EC with temperature correction\ntaken from pHtempcorr",
"x": 653,
"y": 339.4000267982483,
"wires": []
},
{
"id": "cbe993ef.f8305",
"type": "comment",
"z": "4959b239.3baf5c",
"name": "Calibration buttons for EC circuit",
"info": "Continous Reading of pH with temperature correction\ntaken from pHtempcorr",
"x": 487,
"y": 607.3997821807861,
"wires": []
},
{
"id": "1a7e9bca.c64c74",
"type": "comment",
"z": "4959b239.3baf5c",
"name": "Continous Reading of EC with temperature correction taken from global.EC2tempcorr",
"info": "Continous Reading of pH with temperature correction\ntaken from pHtempcorr",
"x": 650.9999847412109,
"y": 127.99999809265137,
"wires": []
},
{
"id": "66743e32.5e1f6",
"type": "comment",
"z": "a67b02db.65d08",
"name": "Feed temperature input ",
"info": "",
"x": 160.73312377929688,
"y": 99.26713633537292,
"wires": []
},
{
"id": "e34c6f6f.be101",
"type": "comment",
"z": "a67b02db.65d08",
"name": "Ambient conditions input",
"info": "",
"x": 170,
"y": 440,
"wires": []
},
{
"id": "d005a0df.cef3",
"type": "comment",
"z": "a67b02db.65d08",
"name": "Global timestamp for data logging",
"info": "",
"x": 196.35418701171875,
"y": 687.3150515556335,
"wires": []
},
{
"id": "94a81d33.c0451",
"type": "comment",
"z": "bca3b7d8.ee3178",
"name": "Refresh interval to pull global values and display them on gagues",
"info": "",
"x": 450,
"y": 160,
"wires": []
},
{
"id": "e8758835.1bbbd8",
"type": "comment",
"z": "20ece430.4c99ec",
"name": "Logic for pump and FMX start/stop based on level and back up data logging",
"info": "",
"x": 538.4999847412109,
"y": 200.40002346038818,
"wires": []
},
{
"id": "f2014d3a.a039a",
"type": "comment",
"z": "d466712f.3b5d",
"name": "User input for data logging file name",
"info": "",
"x": 342.5,
"y": 617.3999757766724,
"wires": []
},
{
"id": "a13f770e.ff6978",
"type": "comment",
"z": "d466712f.3b5d",
"name": "Data logging interval, formatting and saving ",
"info": "",
"x": 384.5,
"y": 156.40000343322754,
"wires": []
},
{
"id": "b14ce7fe.732a38",
"type": "comment",
"z": "d466712f.3b5d",
"name": "Clear button for back up data logging",
"info": "",
"x": 358.3999938964844,
"y": 356.39998722076416,
"wires": []
},
{
"id": "8bed8d14.2eaee",
"type": "comment",
"z": "722422f2.92376c",
"name": "Update interval for data points on ambient graph, manual update, and clear",
"info": "",
"x": 567.4999732971191,
"y": 233.40001845359802,
"wires": []
},
{
"id": "b912dbbd.c13278",
"type": "comment",
"z": "6192cd5f.3ebfb4",
"name": "Update interval for data points on process graph, manual update, and clear",
"info": "",
"x": 338.3999938964844,
"y": 206.39999961853027,
"wires": []
},
{
"id": "cd88a3c2.6ca91",
"type": "comment",
"z": "5fb493fb.22d96c",
"name": "Spawn child process for flowmeter reading with open cv python code",
"info": "",
"x": 295.5,
"y": 395.4000024795532,
"wires": []
},
{
"id": "3220eac1.a9a656",
"type": "ui_form",
"z": "d7efb715.854c58",
"name": "",
"label": "",
"group": "e6b1beec.63f6e",
"order": 0,
"width": 0,
"height": 0,
"options": [
{
"label": "ID",
"value": "ID",
"type": "text",
"required": true
},
{
"label": "Password",
"value": "PW",
"type": "password",
"required": true
}
],
"formValue": {
"ID": "",
"PW": ""
},
"payload": "",
"topic": "",
"x": 164.16669464111328,
"y": 401.26679039001465,
"wires": [
[
"e78248f4.ea2ec8"
]
]
},
{
"id": "e78248f4.ea2ec8",
"type": "function",
"z": "d7efb715.854c58",
"name": "suh",
"func": "var ID = ['Jon','Lance','TL'];\nvar PW = ['1225','lance','tl'];\nvar power = ['admin','user','user'];\nvar index = ID.indexOf(msg.payload.ID);\n\nif (index >= 0){\n if (msg.payload.PW==PW[index]){\n msg.payload='Welcome '+ ID[index] + '(' + power[index] + ')';\n if (power[index]=='admin'){\n var admin = { enabled: true };\n var user = { enabled: true};\n }\n else if (power[index]=='user'){\n var admin = { enabled: false};\n var user ={ enabled: true};\n }\n \n }\n else {\n msg.payload='Bad Credentials';\n var admin = { enabled: false };\n var user = { enabled: false };\n }\n}\nelse {\n msg.payload='Bad Cridentials';\n var admin = { enabled: false };\n var user = { enabled: false };\n}\nreturn [msg, admin, user];",
"outputs": "3",
"noerr": 0,
"x": 478.1667175292969,
"y": 420.46690559387207,
"wires": [
[
"9bca1de8.38e77"
],
[
"b8c56ab4.c388c8"
],
[
"72c83576.f20c9c"
]
]
},
{
"id": "c987e1e7.51ab",
"type": "link in",
"z": "20ece430.4c99ec",
"name": "Start/Stop Batch",
"links": [
"72c83576.f20c9c"
],
"x": 204.36666774749756,
"y": 479.66679763793945,
"wires": [
[
"c8c458e1.8c2e48",
"3d4fce04.24a152"
]
]
},
{
"id": "3579086f.3d8fb8",
"type": "link in",
"z": "d466712f.3b5d",
"name": "Data Logging",
"links": [
"95756214.a774f",
"72c83576.f20c9c"
],
"x": 84.16665744781494,
"y": 344.6667194366455,
"wires": [
[
"60cbd7cb.9ec988",
"42b795eb.ef9d7c"
]
]
},
{
"id": "24c15075.c4a7e",
"type": "link in",
"z": "722422f2.92376c",
"name": "Ambient Graph",
"links": [
"95756214.a774f",
"72c83576.f20c9c"
],
"x": 111.16667175292969,
"y": 363.6666946411133,
"wires": [
[
"d5c697d4.ebd1c8",
"2d765923.10fb36"
]
]
},
{
"id": "134c5c4e.ad6514",
"type": "link in",
"z": "6192cd5f.3ebfb4",
"name": "Process Graph",
"links": [
"95756214.a774f",
"72c83576.f20c9c"
],
"x": 34.16666221618652,
"y": 326.6667528152466,
"wires": [
[
"fbc64037.01a05",
"29be8e7.807de72"
]
]
},
{
"id": "a8533d68.bbea8",
"type": "link in",
"z": "9368ac8b.630df",
"name": "pH Sensor Calibration",
"links": [
"8f050d2e.d44cd",
"b8c56ab4.c388c8"
],
"x": 85.166672706604,
"y": 842.0000915527344,
"wires": [
[
"9c059132.85891",
"a57d5c95.dab7c",
"5abe42a9.119bdc",
"f07a79d7.26fce8",
"74f602b3.b5775c",
"660bf19e.b4943",
"61ec6958.c92868",
"326d7ccf.741b54",
"cefddfb3.a1c4d"
]
]
},
{
"id": "108d70fd.9b421f",
"type": "link in",
"z": "9368ac8b.630df",
"name": "pH Sensor Continous Reading ",
"links": [
"95756214.a774f",
"72c83576.f20c9c"
],
"x": 146.93330764770508,
"y": 457.266637802124,
"wires": [
[
"f4b306d8.13d4a8",
"11ae3786.c6e948"
]
]
},
{
"id": "9b6d5352.e7f04",
"type": "link in",
"z": "e562458a.b05e28",
"name": "EC1 Reading",
"links": [
"95756214.a774f",
"72c83576.f20c9c"
],
"x": 167.166672706604,
"y": 337.6667203903198,
"wires": [
[
"9eacf5ff.55eae8",
"4a322846.ec1658"
]
]
},
{
"id": "2fdca541.45f67a",
"type": "link in",
"z": "e562458a.b05e28",
"name": "EC1 Sensor Calibration",
"links": [
"8f050d2e.d44cd",
"b8c56ab4.c388c8"
],
"x": 147.93331813812256,
"y": 993.2666397094727,
"wires": [
[
"ce172332.94dff",
"c7bad49e.80fe58",
"35ef4dc.79c6eb2",
"e339b216.77a2a",
"1d475bcb.bc4824",
"ca3a49c4.2e8268",
"f105813b.c740d",
"a4f93896.469298",
"5ba6b23a.52f0cc",
"62e208d3.2dcdd8",
"fe796fe9.5d914"
]
]
},
{
"id": "f8c1796c.804d68",
"type": "link in",
"z": "4959b239.3baf5c",
"name": "EC2 Read",
"links": [
"95756214.a774f",
"72c83576.f20c9c"
],
"x": 144.16665649414062,
"y": 341.6666946411133,
"wires": [
[
"d5b16555.e19418",
"a18d0338.b16a5"
]
]
},
{
"id": "855f4884.0282c8",
"type": "link in",
"z": "4959b239.3baf5c",
"name": "EC2 Sensor Calibration",
"links": [
"8f050d2e.d44cd",
"b8c56ab4.c388c8"
],
"x": 147.16665649414062,
"y": 1020.9999771118164,
"wires": [
[
"9c94b27e.8d172",
"ff0d9270.493da",
"3ee0590d.b71db6",
"5adb2622.8da4f8",
"f9ac580a.6b3eb8",
"54a059f2.bdf6e8",
"674e2cf9.c84194",
"ee39416d.fdc23",
"e364cdfb.1fd25",
"892565e.c29c598",
"774a22b1.aef89c"
]
]
},
{
"id": "7216443d.294e4c",
"type": "inject",
"z": "d7efb715.854c58",
"name": "",
"topic": "",
"payload": "{\"ID\":\"nothing\",\"PW\":\"nothing\"}",
"payloadType": "json",
"repeat": "",
"crontab": "",
"once": true,
"x": 112.16666793823242,
"y": 584.2667694091797,
"wires": [
[
"d38b47ee.176778"
]
]
},
{
"id": "d38b47ee.176778",
"type": "ui_button",
"z": "d7efb715.854c58",
"name": "",
"group": "e6b1beec.63f6e",
"order": 0,
"width": 0,
"height": 0,
"passthru": true,
"label": "Logout",
"color": "",
"bgcolor": "",
"icon": "fa-sign-out",
"payload": "{\"ID\":\"nothing\",\"PW\":\"nothing\"}",
"payloadType": "json",
"topic": "",
"x": 276.1666488647461,
"y": 585.2001094818115,
"wires": [
[
"a19feb3f.e28e88"
]
]
},
{
"id": "579fc80d.165568",
"type": "debug",
"z": "e562458a.b05e28",
"name": "",
"active": false,
"console": "false",
"complete": "true",
"x": 707.1667175292969,
"y": 186.73334503173828,
"wires": []
},
{
"id": "9bca1de8.38e77",
"type": "ui_text",
"z": "d7efb715.854c58",
"group": "e6b1beec.63f6e",
"order": 0,
"width": 0,
"height": 0,
"name": "",
"label": "",
"format": "{{msg.payload}}",
"layout": "row-spread",
"x": 715.1667594909668,
"y": 343.4000072479248,
"wires": []
},
{
"id": "43767c03.0122c4",
"type": "ui_gauge",
"z": "bca3b7d8.ee3178",
"name": "Temp Display",
"group": "83c57b0a.062898",
"order": 1,
"width": "0",
"height": "0",
"gtype": "gage",
"title": "Feed Temp Temperture",
"label": "°C",
"format": "{{value| number:2}}",
"min": 0,
"max": "75",
"colors": [
"#00b500",
"#e6e600",
"#ca3838"
],
"seg1": "25",
"seg2": "50",
"x": 950.9998741149902,
"y": 300.93332386016846,
"wires": []
},
{
"id": "dc1fe86e.df1088",
"type": "debug",
"z": "9368ac8b.630df",
"name": "",
"active": true,
"console": "false",
"complete": "false",
"x": 932.1000518798828,
"y": 465.7333755493164,
"wires": []
},
{
"id": "d4c64a82.348508",
"type": "function",
"z": "5fb493fb.22d96c",
"name": "define global.flowrate, flux, correctedflux ",
"func": "{\nvar newarray = msg.payload.split('\\n').map(Number);\n var total = 0;\n for (var i = 0; i < newarray.length; i++) {\n total += newarray[i];\n}\n var avg = total / ((newarray.length)-1);\n msg.payload = parseFloat(avg.toFixed(1));\n msg.stringlegnth = newarray.length;\n}\nglobal.set('flowrate',msg.payload);\nvar flow = msg.payload;\nvar reftemp = global.get('reftemp') + 273;\nvar temp = global.get('temp1') + 273;\nvar viscosity = 2.414E-5* Math.pow(10,(247.8 /(temp - 140)));\nvar refviscosity = 2.414E-5* Math.pow(10, (247.8 /(reftemp - 140)));\nvar flux = flow/0.0146*(60/1000);\nvar corrflux = flux*(viscosity/refviscosity);\nglobal.set('flux',flux);\nglobal.set('correctedflux',corrflux);\nmsg = {\n 'flow': flow,\n 'reftemp': reftemp,\n 'temp': temp,\n 'viscosity': viscosity,\n 'refviscosity': refviscosity,\n 'flux': flux,\n 'corrected flux': corrflux\n};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1205.1668548583984,
"y": 430.6001281738281,
"wires": [
[
"8242077f.e5b468"
]
]
},
{
"id": "5ed29ed1.ca94f",
"type": "inject",
"z": "9368ac8b.630df",
"name": "",
"topic": "",
"payload": "1",
"payloadType": "num",
"repeat": "",
"crontab": "",
"once": false,
"x": 133.16665649414062,
"y": 118.26667022705078,
"wires": [
[
"f4b306d8.13d4a8"
]
]
},
{
"id": "44953f73.9a076",
"type": "inject",
"z": "9368ac8b.630df",
"name": "",
"topic": "",
"payload": "0",
"payloadType": "num",
"repeat": "",
"crontab": "",
"once": false,
"x": 147.16665649414062,
"y": 189.26667022705078,
"wires": [
[
"f4b306d8.13d4a8"
]
]
},
{
"id": "c9a3073c.6b1b48",
"type": "ui_switch",
"z": "5fb493fb.22d96c",
"name": "",
"label": "Flow Continous Read",
"group": "ca4a0643.3b3f88",
"order": 5,
"width": 0,
"height": 0,
"passthru": true,
"decouple": "false",
"topic": "",
"style": "",
"onvalue": "1",
"onvalueType": "num",
"onicon": "",
"oncolor": "",
"offvalue": "0",
"offvalueType": "num",
"officon": "",
"offcolor": "",
"x": 240.16667938232422,
"y": 598.9334373474121,
"wires": [
[
"bd509786.066cb8"
]
]
},
{
"id": "1961d6fb.479899",
"type": "link in",
"z": "5fb493fb.22d96c",
"name": "",
"links": [
"95756214.a774f",
"72c83576.f20c9c"
],
"x": 86.16665935516357,
"y": 596.6666831970215,
"wires": [
[
"c9a3073c.6b1b48"
]
]
},
{
"id": "dbc9489.9baabb8",
"type": "status",
"z": "5fb493fb.22d96c",
"name": "",
"scope": [
"bd509786.066cb8"
],
"x": 121.16672134399414,
"y": 752.5333423614502,
"wires": [
[
"5275e86a.cec708",
"aad96ce1.8468f"
]
]
},
{
"id": "aad96ce1.8468f",
"type": "ui_text",
"z": "5fb493fb.22d96c",
"group": "b49abd38.93418",
"order": 5,
"width": 0,
"height": 0,
"name": "",
"label": "Status",
"format": "{{status.text}}",
"layout": "row-spread",
"x": 390,
"y": 740,
"wires": []
},
{
"id": "5275e86a.cec708",
"type": "debug",
"z": "5fb493fb.22d96c",
"name": "",
"active": true,
"console": "false",
"complete": "true",
"x": 390,
"y": 800,
"wires": []
},
{
"id": "eba1ac79.8f64a",
"type": "ui_chart",
"z": "6192cd5f.3ebfb4",
"name": "",
"group": "1d80b743.0287b9",
"order": 2,
"width": 0,
"height": 0,
"label": "Process Variables",
"chartType": "line",
"legend": "true",
"xformat": "HH:mm:ss",
"interpolate": "bezier",
"nodata": "",
"dot": false,
"ymin": "0",
"ymax": "20000",
"removeOlder": "1",
"removeOlderPoints": "",
"removeOlderUnit": "86400",
"cutout": 0,
"useOneColor": false,
"colors": [
"#00ffff",
"#ff0000",
"#00ff00",
"#ffff00",
"#ff00ff",
"#8080ff",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"x": 950,
"y": 640,
"wires": [
[],
[]
]
},
{
"id": "11345aed.56ed95",
"type": "ui_text",
"z": "20ece430.4c99ec",
"group": "ca4a0643.3b3f88",
"order": 19,
"width": 0,
"height": 0,
"name": "",
"label": "Status",
"format": "{{msg.payload}}",
"layout": "row-spread",
"x": 1270,
"y": 400,
"wires": []
},
{
"id": "3d74c80a.57a468",
"type": "function",
"z": "20ece430.4c99ec",
"name": "FMX Status",
"func": "if (msg.payload==1){\n msg.payload= 'FMX ON';\n}\nelse {\n msg.payload='FMX OFF';\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1090,
"y": 380,
"wires": [
[
"11345aed.56ed95"
]
]
},
{
"id": "9b92f9aa.5811b8",
"type": "delay",
"z": "a67b02db.65d08",
"name": "",
"pauseType": "delay",
"timeout": "10",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 466.7332572937012,
"y": 544.914870262146,
"wires": [
[
"bf0984bd.5d2a18"
]
]
},
{
"id": "bf8f52b0.a742d",
"type": "function",
"z": "bca3b7d8.ee3178",
"name": "return global.flux",
"func": "var flux = global.get('flux');\nmsg.payload = flux.toFixed(2);\nreturn msg;\n\n",
"outputs": 1,
"noerr": 0,
"x": 653.8124694824219,
"y": 516.8186702728271,
"wires": [
[
"c399f45c.ff8118"
]
]
},
{
"id": "188ab01a.c100d",
"type": "function",
"z": "bca3b7d8.ee3178",
"name": "return global.correctedflux",
"func": "var cflux = global.get('correctedflux');\nmsg.reftemp = global.get('reftemp');\nmsg.payload = cflux.toFixed(2);\nreturn msg;\n\n",
"outputs": 1,
"noerr": 0,
"x": 650,
"y": 620,
"wires": [
[
"dd537157.0421b"
]
]
},
{
"id": "a6322308.634e5",
"type": "ui_text_input",
"z": "a67b02db.65d08",
"name": "",
"label": "Refrence Temperature (C):",
"group": "b49abd38.93418",
"order": 4,
"width": 0,
"height": 0,
"passthru": true,
"mode": "text",
"delay": "100",
"topic": "",
"x": 460,
"y": 960,
"wires": [
[
"19a2c2da.19ffdd"
]
]
},
{
"id": "19a2c2da.19ffdd",
"type": "function",
"z": "a67b02db.65d08",
"name": "Define global.reftemp",
"func": "var reftemp = parseFloat(msg.payload);\nglobal.set('reftemp',reftemp);\n",
"outputs": 1,
"noerr": 0,
"x": 751.3062782287598,
"y": 959.6626472473145,
"wires": [
[]
]
},
{
"id": "ab6e3027.a5333",
"type": "inject",
"z": "a67b02db.65d08",
"name": "",
"topic": "",
"payload": "20",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": true,
"x": 83.30628204345703,
"y": 957.6624021530151,
"wires": [
[
"6b2dda9.8e15624"
]
]
},
{
"id": "c399f45c.ff8118",
"type": "ui_text",
"z": "bca3b7d8.ee3178",
"group": "b49abd38.93418",
"order": 2,
"width": 0,
"height": 0,
"name": "",
"label": "Flux:",
"format": "{{msg.payload}}LMH",
"layout": "row-spread",
"x": 939.5062408447266,
"y": 518.699914932251,
"wires": []
},
{
"id": "dd537157.0421b",
"type": "ui_text",
"z": "bca3b7d8.ee3178",
"group": "b49abd38.93418",
"order": 3,
"width": 0,
"height": 0,
"name": "",
"label": "Corrected Flux:",
"format": "{{msg.payload}}LMH at {{msg.reftemp}}C",
"layout": "row-spread",
"x": 954.5062408447266,
"y": 590.6999114751816,
"wires": []
},
{
"id": "68c0e06a.79426",
"type": "inject",
"z": "5fb493fb.22d96c",
"name": "",
"topic": "",
"payload": "0",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": true,
"x": 859.5061073303223,
"y": 371.3749761581421,
"wires": [
[
"d4c64a82.348508"
]
]
},
{
"id": "877b620a.467b",
"type": "exec",
"z": "5fb493fb.22d96c",
"command": "python3",
"addpay": false,
"append": "-u /home/pi/Documents/python3cvtest.py",
"useSpawn": "true",
"timer": "",
"oldrc": true,
"name": "",
"x": 718,
"y": 487.5,
"wires": [
[
"d4c64a82.348508"
],
[
"8278dd52.5a027"
],
[
"8278dd52.5a027"
]
]
},
{
"id": "8278dd52.5a027",
"type": "debug",
"z": "5fb493fb.22d96c",
"name": "",
"active": true,
"console": "false",
"complete": "true",
"x": 930,
"y": 520,
"wires": []
},
{
"id": "3925896e.a7dc66",
"type": "function",
"z": "20ece430.4c99ec",
"name": "Header for backup",
"func": "var reftemp = global.get('reftemp');\nmsg.payload = [\"Time\",\"Level\",\"Pressure\",\"Feed Temp\", \"Feed Conductivity\", \"Permeate Temp\" ,\"Permeate pH\",\"Permeate Conductivity\",\"Permeate Flow\",\"Flux\",\"Correct Flux @\"+ reftemp, \"Rejection\", \"Total Permeate Weight\"];\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 970,
"y": 160,
"wires": [
[
"645e0584.1b7ddc"
]
]
},
{
"id": "2b3eaaf1.296076",
"type": "trigger",
"z": "20ece430.4c99ec",
"op1": "true",
"op2": "0",
"op1type": "bool",
"op2type": "str",
"duration": "0",
"extend": false,
"units": "ms",
"reset": "stop",
"name": "",
"x": 760,
"y": 160,
"wires": [
[
"3925896e.a7dc66"
]
]
},
{
"id": "2b464867.d5bec8",
"type": "ui_button",
"z": "20ece430.4c99ec",
"name": "",
"group": "ca4a0643.3b3f88",
"order": 22,
"width": "0",
"height": "0",
"passthru": false,
"label": "Clear Backup",
"color": "",
"bgcolor": "",
"icon": "fa-trash",
"payload": "[]",
"payloadType": "str",
"topic": "",
"x": 320,
"y": 100,
"wires": [
[
"f578d4ac.867d18",
"2b3eaaf1.296076"
]
]
},
{
"id": "f578d4ac.867d18",
"type": "file",
"z": "20ece430.4c99ec",
"name": "",
"filename": "/home/pi/Documents/BKT/backup.csv",
"appendNewline": false,
"createDir": true,
"overwriteFile": "true",
"x": 1062.0000305175781,
"y": 76.00000286102295,
"wires": []
},
{
"id": "4e292be.79ee8d4",
"type": "delay",
"z": "20ece430.4c99ec",
"name": "",
"pauseType": "delay",
"timeout": "1",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 540,
"y": 300,
"wires": [
[
"f8a310f.7ca65f"
]
]
},
{
"id": "8f8744f8.5874a8",
"type": "delay",
"z": "d466712f.3b5d",
"name": "",
"pauseType": "delay",
"timeout": "1",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 400,
"y": 220,
"wires": [
[
"48827d90.d65cb4"
]
]
},
{
"id": "7b23d02.f68b33",
"type": "trigger",
"z": "d466712f.3b5d",
"op1": "true",
"op2": "0",
"op1type": "bool",
"op2type": "str",
"duration": "0",
"extend": false,
"units": "ms",
"reset": "stop",
"name": "",
"x": 360,
"y": 280,
"wires": [
[
"5631ec43.e9ccd4"
]
]
},
{
"id": "5631ec43.e9ccd4",
"type": "function",
"z": "d466712f.3b5d",
"name": "Header for backup",
"func": "var reftemp = global.get('reftemp');\nmsg.filename = '/mnt/filmax-pc/BKT\\040Server/Jon/FMXBData/' + global.get('filename')+'.csv';\nmsg.payload = [\"Time\",\"Level\",\"Pressure\",\"Feed Temp\", \"Feed Conductivity\", \"Permeate Temp\" ,\"Permeate pH\",\"Permeate Conductivity\",\"Permeate Flow\",\"Flux\",\"Correct Flux @\"+ reftemp, \"Rejection\", \"Total Permeate Weight\"];\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 608,
"y": 277,
"wires": [
[
"ad16e2cd.70782",
"d8c0fb9.566cf08"
]
]
},
{
"id": "e40145b2.0f8618",
"type": "function",
"z": "6192cd5f.3ebfb4",
"name": "Return global.flowrate",
"func": "flowrate = global.get('flowrate');\nmsg.payload = flowrate;\nmsg.topic = 'Flowrate';\nreturn msg;\n\n\n",
"outputs": 1,
"noerr": 0,
"x": 500,
"y": 680,
"wires": [
[
"1973c83c.540cb8"
]
]
},
{
"id": "f87595cd.0560b8",
"type": "function",
"z": "6192cd5f.3ebfb4",
"name": "Return global.flux",
"func": "flux = global.get('flux');\nmsg.payload = flux.toFixed(1);\nmsg.topic = 'Flux';\nreturn msg;\n\n\n",
"outputs": 1,
"noerr": 0,
"x": 490,
"y": 720,
"wires": [
[
"1973c83c.540cb8"
]
]
},
{
"id": "239c2a22.11fe16",
"type": "function",
"z": "6192cd5f.3ebfb4",
"name": "Return global.correctedflux",
"func": "cflux = global.get('correctedflux');\nmsg.payload = cflux.toFixed(1);\nmsg.topic = 'Corrected Flux';\nreturn msg;\n\n\n",
"outputs": 1,
"noerr": 0,
"x": 500,
"y": 780,
"wires": [
[
"1973c83c.540cb8"
]
]
},
{
"id": "72c83576.f20c9c",
"type": "link out",
"z": "d7efb715.854c58",
"name": "",
"links": [
"f8c1796c.804d68",
"f4582d7b.4758d",
"108d70fd.9b421f",
"3579086f.3d8fb8",
"134c5c4e.ad6514",
"24c15075.c4a7e",
"c987e1e7.51ab",
"9b6d5352.e7f04",
"1961d6fb.479899",
"27c7fc83.1c5fe4"
],
"x": 755,
"y": 560,
"wires": []
},
{
"id": "b8c56ab4.c388c8",
"type": "link out",
"z": "d7efb715.854c58",
"name": "",
"links": [
"855f4884.0282c8",
"2fdca541.45f67a",
"a8533d68.bbea8"
],
"x": 755,
"y": 440,
"wires": []
},
{
"id": "c0b8bafa.e7eca8",
"type": "function",
"z": "bca3b7d8.ee3178",
"name": "ETA Calculation",
"func": "//currentvolume = global.get('currentvolume');\n//endvolume = global.get('endvolume');\nstopweight = global.get('stopweight');\nwtotal = global.get('wtotal');\nflow = global.get('flowrate');\neta = (((stopweight-(wtotal))) / flow);\n//eta = (((currentvolume-(endvolume))) / flow);\nmsg.payload = eta.toFixed(0);\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"x": 656.0000076293945,
"y": 792.0000352859497,
"wires": [
[
"40e4b15.157415"
]
]
},
{
"id": "40e4b15.157415",
"type": "ui_text",
"z": "bca3b7d8.ee3178",
"group": "cb4fb20a.918cb",
"order": 9,
"width": 0,
"height": 0,
"name": "",
"label": "ETA: ",
"format": "{{msg.payload}} min",
"layout": "row-spread",
"x": 985.0001068115234,
"y": 718.0000991821289,
"wires": []
},
{
"id": "a19feb3f.e28e88",
"type": "delay",
"z": "d7efb715.854c58",
"name": "",
"pauseType": "delay",
"timeout": "8",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 372.50624084472656,
"y": 501.5874938964844,
"wires": [
[
"e78248f4.ea2ec8"
]
]
},
{
"id": "492e92b0.067a0c",
"type": "function",
"z": "bca3b7d8.ee3178",
"name": "Rejection Calculation",
"func": "feed = global.get('EC1');\nperm = global.get('EC2');\nrejection = ((1-(perm/feed))*100);\nrejection = rejection.toFixed(1);\nglobal.set('rejection', rejection);\nmsg.payload = rejection;\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"x": 743.0000457763672,
"y": 1291.999936580658,
"wires": [
[
"3b97e319.41b5ec"
]
]
},
{
"id": "3b97e319.41b5ec",
"type": "ui_text",
"z": "bca3b7d8.ee3178",
"group": "1cf729f1.c8f1c6",
"order": 4,
"width": 0,
"height": 0,
"name": "",
"label": "Rejection",
"format": "{{msg.payload}}%",
"layout": "row-spread",
"x": 976.0000762939453,
"y": 1283.9999375343323,
"wires": []
},
{
"id": "6b2dda9.8e15624",
"type": "delay",
"z": "a67b02db.65d08",
"name": "",
"pauseType": "delay",
"timeout": "4",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 229.3062973022461,
"y": 963.6625490188599,
"wires": [
[
"a6322308.634e5"
]
]
},
{
"id": "6fdfdac4.10a6e4",
"type": "delay",
"z": "d466712f.3b5d",
"name": "",
"pauseType": "delay",
"timeout": "3",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 326.8125,
"y": 694.8187866210938,
"wires": [
[
"42b795eb.ef9d7c"
]
]
},
{
"id": "ceefe0c1.28e1f",
"type": "mqtt in",
"z": "8e5eabab.140278",
"name": "Scale Weight",
"topic": "Scale1",
"qos": "0",
"broker": "fdb94034.da593",
"x": 191.99999618530273,
"y": 839.999997138977,
"wires": [
[
"9bf0c106.36f8",
"37e7e008.544e4"
]
]
},
{
"id": "bf16c238.c296e",
"type": "rate",
"z": "8e5eabab.140278",
"name": "Define global.flowrate",
"inputField": "payload",
"inputFieldType": "msg",
"outputField": "flowrate",
"outputFieldType": "global",
"timestampField": "timestamp",
"timestampFieldType": "msg",
"ratePeriod": "60000",
"x": 816.9998054504395,
"y": 841.9999475479126,
"wires": [
[]
]
},
{
"id": "cf2ba1aa.c8c8e",
"type": "function",
"z": "8e5eabab.140278",
"name": "Timestamp",
"func": "msg = {\n payload: msg.payload,\n timestamp: Date.now()\n \n \n};\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 588.9999809265137,
"y": 844.9999470710754,
"wires": [
[
"bf16c238.c296e"
]
]
},
{
"id": "9bf0c106.36f8",
"type": "delay",
"z": "8e5eabab.140278",
"name": "",
"pauseType": "rate",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "2",
"rateUnits": "minute",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": true,
"x": 383.99999618530273,
"y": 839.9999589920044,
"wires": [
[
"cf2ba1aa.c8c8e",
"6a58967.c4b9f68"
]
]
},
{
"id": "6a58967.c4b9f68",
"type": "function",
"z": "8e5eabab.140278",
"name": "Define global.flux",
"func": "\nvar flow = global.get(\"flowrate\");\nvar reftemp = global.get('reftemp') + 273;\nvar wtotal = global.get('wtotal');\nvar initialweight = global.get('initialweight');\nvar temp = global.get('temp1') + 273;\nvar viscosity = 2.414E-5* Math.pow(10,(247.8 /(temp - 140)));\nvar refviscosity = 2.414E-5* Math.pow(10, (247.8 /(reftemp - 140)));\nvar flux = flow/0.0146*(60/1000);\nvar corrflux = flux*(viscosity/refviscosity);\nvar level = ((initialweight - wtotal)/initialweight)*100;\nglobal.set('level',level);\nglobal.set('flux',flux);\nglobal.set('correctedflux',corrflux);\nmsg = {\n 'flow': flow,\n 'reftemp': reftemp,\n 'temp': temp,\n 'viscosity': viscosity,\n 'refviscosity': refviscosity,\n 'flux': flux,\n 'corrected flux': corrflux\n};\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"x": 690.9999580383301,
"y": 767.9999628067017,
"wires": [
[]
]
},
{
"id": "9d63039d.e1e2",
"type": "serial in",
"z": "a67b02db.65d08",
"name": "Arduino Nano Pressure",
"serial": "13bc8a10.d81e96",
"x": 160,
"y": 300,
"wires": [
[
"37a6233b.08c46c"
]
]
},
{
"id": "37a6233b.08c46c",
"type": "function",
"z": "a67b02db.65d08",
"name": "Define Global Pressure",
"func": "var p = msg.payload;\npressure = (0.02659 * p) - 2.57831;\npressure = pressure.toFixed(1);\nglobal.set(\"pressure\",pressure);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 496.9061813354492,
"y": 308.41865730285645,
"wires": [
[]
]
},
{
"id": "94f5314.ccd4bd",
"type": "function",
"z": "bca3b7d8.ee3178",
"name": "return global.pressure",
"func": "pressure = global.get(\"pressure\");\nmsg.payload = pressure;\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"x": 660.0186233520508,
"y": 679.0250291824341,
"wires": [
[
"59e0f902.caab48"
]
]
},
{
"id": "59e0f902.caab48",
"type": "ui_gauge",
"z": "bca3b7d8.ee3178",
"name": "Pressure",
"group": "83c57b0a.062898",
"order": 2,
"width": "0",
"height": "0",
"gtype": "gage",
"title": "Pressure",
"label": "bar",
"format": "{{value| number:1}}",
"min": 0,
"max": "20",
"colors": [
"#00ff00",
"#f1f803",
"#ff0000"
],
"seg1": "5",
"seg2": "15",
"x": 936.018798828125,
"y": 637.0250244140625,
"wires": []
},
{
"id": "37e7e008.544e4",
"type": "function",
"z": "8e5eabab.140278",
"name": "Define global.wtotal",
"func": "wtotal = parseInt(msg.payload);\nglobal.set(\"wtotal\",wtotal);\nmsg.stopweight=global.get('stopweight');\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 446.912540435791,
"y": 908.431188583374,
"wires": [
[
"bc9e9eeb.dc915",
"24e1b663.0f2f7a"
]
]
},
{
"id": "3c2ffe3e.4bb242",
"type": "mqtt in",
"z": "8e5eabab.140278",
"name": "Calibration Constant",
"topic": "HX711calfactor",
"qos": "0",
"broker": "fdb94034.da593",
"x": 244.2999610900879,
"y": 1261.600193977356,
"wires": [
[
"40a2be8f.e29c2"
]
]
},
{
"id": "40a2be8f.e29c2",
"type": "ui_text",
"z": "8e5eabab.140278",
"group": "2eeaf23e.f3378e",
"order": 2,
"width": 0,
"height": 0,
"name": "",
"label": "Constant: ",
"format": "{{msg.payload}}",
"layout": "row-spread",
"x": 646.3000831604004,
"y": 1269.1333961486816,
"wires": []
},
{
"id": "fb710609.c06e78",
"type": "ui_button",
"z": "8e5eabab.140278",
"name": "+0.1",
"group": "2eeaf23e.f3378e",
"order": 5,
"width": "3",
"height": "1",
"passthru": false,
"label": "+0.1",
"color": "",
"bgcolor": "",
"icon": "",
"payload": "+0.1",
"payloadType": "str",
"topic": "",
"x": 261.3000030517578,
"y": 1544.133318901062,
"wires": [
[
"dba5df34.e0119"
]
]
},
{
"id": "fc0a1f8c.521c",
"type": "ui_button",
"z": "8e5eabab.140278",
"name": "-0.1",
"group": "2eeaf23e.f3378e",
"order": 4,
"width": "3",
"height": "1",
"passthru": false,
"label": "-0.1",
"color": "",
"bgcolor": "",
"icon": "",
"payload": "-0.1",
"payloadType": "str",
"topic": "",
"x": 272.99998474121094,
"y": 1596.999903678894,
"wires": [
[
"dba5df34.e0119"
]
]
},
{
"id": "2ea42db3.ad6f82",
"type": "ui_button",
"z": "8e5eabab.140278",
"name": "+1",
"group": "2eeaf23e.f3378e",
"order": 7,
"width": "3",
"height": "1",
"passthru": false,
"label": "+1",
"color": "",
"bgcolor": "",
"icon": "",
"payload": "+1",
"payloadType": "str",
"topic": "",
"x": 266.9999885559082,
"y": 1667.9999284744263,
"wires": [
[
"dba5df34.e0119"
]
]
},
{
"id": "1f1cf159.ec0fcf",
"type": "ui_button",
"z": "8e5eabab.140278",
"name": "-1",
"group": "2eeaf23e.f3378e",
"order": 6,
"width": "3",
"height": "1",
"passthru": false,
"label": "-1",
"color": "",
"bgcolor": "",
"icon": "",
"payload": "-1",
"payloadType": "str",
"topic": "",
"x": 263.9999885559082,
"y": 1711.9999351501465,
"wires": [
[
"dba5df34.e0119"
]
]
},
{
"id": "b5307462.d80118",
"type": "ui_button",
"z": "8e5eabab.140278",
"name": "+10",
"group": "2eeaf23e.f3378e",
"order": 9,
"width": "3",
"height": "1",
"passthru": false,
"label": "+10",
"color": "",
"bgcolor": "",
"icon": "",
"payload": "+10",
"payloadType": "str",
"topic": "",
"x": 262.9999885559082,
"y": 1781.0000100135803,
"wires": [
[
"dba5df34.e0119"
]
]
},
{
"id": "26bfc713.dbfce8",
"type": "ui_button",
"z": "8e5eabab.140278",
"name": "-10",
"group": "2eeaf23e.f3378e",
"order": 8,
"width": "3",
"height": "1",
"passthru": false,
"label": "-10",
"color": "",
"bgcolor": "",
"icon": "",
"payload": "-10",
"payloadType": "str",
"topic": "",
"x": 264.9999885559082,
"y": 1830.0002508163452,
"wires": [
[
"dba5df34.e0119"
]
]
},
{
"id": "259a2d30.082a52",
"type": "ui_button",
"z": "8e5eabab.140278",
"name": "+100",
"group": "2eeaf23e.f3378e",
"order": 11,
"width": "3",
"height": "1",
"passthru": false,
"label": "+100",
"color": "",
"bgcolor": "",
"icon": "",
"payload": "+100",
"payloadType": "str",
"topic": "",
"x": 244.99998950958252,
"y": 1894.0002574920654,
"wires": [
[
"dba5df34.e0119"
]
]
},
{
"id": "d4a45e6f.f737a",
"type": "ui_button",
"z": "8e5eabab.140278",
"name": "-100",
"group": "2eeaf23e.f3378e",
"order": 10,
"width": "3",
"height": "1",
"passthru": false,
"label": "-100",
"color": "",
"bgcolor": "",
"icon": "",
"payload": "-100",
"payloadType": "str",
"topic": "",
"x": 250.99998474121094,
"y": 1936.9999570846558,
"wires": [
[
"dba5df34.e0119"
]
]
},
{
"id": "7e574718.cd7d38",
"type": "ui_text",
"z": "8e5eabab.140278",
"group": "2eeaf23e.f3378e",
"order": 1,
"width": 0,
"height": 0,
"name": "",
"label": "Weight:",
"format": "{{msg.payload}}g",
"layout": "row-spread",
"x": 493.9999198913574,
"y": 1210.999942779541,
"wires": []
},
{
"id": "73dea670.1224c8",
"type": "ui_button",
"z": "8e5eabab.140278",
"name": "tare",
"group": "cb4fb20a.918cb",
"order": 11,
"width": "0",
"height": "0",
"passthru": false,
"label": "Tare",
"color": "",
"bgcolor": "",
"icon": "",
"payload": "tare",
"payloadType": "str",
"topic": "",
"x": 279.99998474121094,
"y": 1481.6665983200073,
"wires": [
[
"dba5df34.e0119"
]
]
},
{
"id": "f7acf5f2.5a4c38",
"type": "ui_button",
"z": "8e5eabab.140278",
"name": "tare",
"group": "2eeaf23e.f3378e",
"order": 3,
"width": "0",
"height": "0",
"passthru": false,
"label": "Tare",
"color": "",
"bgcolor": "",
"icon": "",
"payload": "tare",
"payloadType": "str",
"topic": "",
"x": 278.99998474121094,
"y": 1443.6665906906128,
"wires": [
[
"dba5df34.e0119"
]
]
},
{
"id": "dba5df34.e0119",
"type": "mqtt out",
"z": "8e5eabab.140278",
"name": "HX711cal",
"topic": "HX711cal",
"qos": "0",
"retain": "",
"broker": "fdb94034.da593",
"x": 772.3000717163086,
"y": 1639.600058555603,
"wires": []
},
{
"id": "d7d92c27.a1add",
"type": "mqtt in",
"z": "8e5eabab.140278",
"name": "Raw Weight",
"topic": "Debug",
"qos": "0",
"broker": "fdb94034.da593",
"x": 231.9999122619629,
"y": 1217.333348274231,
"wires": [
[
"7e574718.cd7d38"
]
]
},
{
"id": "beebe39b.de002",
"type": "inject",
"z": "8e5eabab.140278",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": true,
"x": 216.29999160766602,
"y": 774.2666416168213,
"wires": [
[
"6a58967.c4b9f68"
]
]
},
{
"id": "d8c0fb9.566cf08",
"type": "function",
"z": "d466712f.3b5d",
"name": "json formatting ",
"func": "msg.filename = '/home/pi/Documents/BKT/' + global.get('filename')+'.csv';\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 887.0007019042969,
"y": 364.9999752044678,
"wires": [
[
"f8e63c67.9774b"
]
]
},
{
"id": "b47788ee.4ffed8",
"type": "file",
"z": "d466712f.3b5d",
"name": "",
"filename": "",
"appendNewline": false,
"createDir": true,
"overwriteFile": "false",
"x": 1301.9998817443848,
"y": 368.9999752044678,
"wires": []
},
{
"id": "f8e63c67.9774b",
"type": "csv",
"z": "d466712f.3b5d",
"name": "",
"sep": ",",
"hdrin": false,
"hdrout": false,
"multi": "mult",
"ret": "\\n",
"temp": "",
"x": 1097.6666793823242,
"y": 368.9999752044678,
"wires": [
[
"b47788ee.4ffed8"
]
]
},
{
"id": "3ad8ca0f.611876",
"type": "switch",
"z": "20ece430.4c99ec",
"name": "Scale to Setpoint Logic",
"property": "stopweight",
"propertyType": "global",
"rules": [
{
"t": "lte",
"v": "wtotal",
"vt": "global"
}
],
"checkall": "true",
"outputs": 1,
"x": 658.9999389648438,
"y": 815.9999389648438,
"wires": [
[
"1d27e964.e87ca7",
"7d84bcfd.8829e4"
]
]
},
{
"id": "a7a3f334.87ed2",
"type": "ui_text_input",
"z": "8e5eabab.140278",
"name": "Stop Weight",
"label": "Stop Weight (Max 8500g)",
"group": "cb4fb20a.918cb",
"order": 5,
"width": 0,
"height": 0,
"passthru": true,
"mode": "text",
"delay": 300,
"topic": "",
"x": 241.30012130737305,
"y": 1069.2667970657349,
"wires": [
[
"ebac5d03.cdb49"
]
]
},
{
"id": "ebac5d03.cdb49",
"type": "function",
"z": "8e5eabab.140278",
"name": "Define global.flux",
"func": "global.set('stopweight',msg.payload);\nstopweight = msg.payload;\ninitialweight = global.get('initialweight');\nmsg.payload = (stopweight/initialweight)*100;\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"x": 528.9999351501465,
"y": 1070.0000066757202,
"wires": [
[
"8a0bf5da.50f148"
]
]
},
{
"id": "bc9e9eeb.dc915",
"type": "debug",
"z": "8e5eabab.140278",
"name": "",
"active": false,
"console": "false",
"complete": "true",
"x": 869.9999370574951,
"y": 948.999969959259,
"wires": []
},
{
"id": "ba99bc05.56039",
"type": "ui_switch",
"z": "20ece430.4c99ec",
"name": "",
"label": "Scale Autostop",
"group": "ca4a0643.3b3f88",
"order": 7,
"width": 0,
"height": 0,
"passthru": true,
"decouple": "false",
"topic": "",
"style": "",
"onvalue": "1",
"onvalueType": "num",
"onicon": "",
"oncolor": "",
"offvalue": "0",
"offvalueType": "num",
"officon": "",
"offcolor": "",
"x": 114.0000991821289,
"y": 793.3335514068604,
"wires": [
[
"fba41994.38c068"
]
]
},
{
"id": "7d84bcfd.8829e4",
"type": "debug",
"z": "20ece430.4c99ec",
"name": "",
"active": true,
"console": "false",
"complete": "true",
"x": 1050,
"y": 740,
"wires": []
},
{
"id": "fba41994.38c068",
"type": "trigger",
"z": "20ece430.4c99ec",
"op1": "true",
"op2": "0",
"op1type": "bool",
"op2type": "str",
"duration": "-2",
"extend": false,
"units": "s",
"reset": "0",
"name": "",
"x": 353.9999694824219,
"y": 801.6666431427002,
"wires": [
[
"3ad8ca0f.611876"
]
]
},
{
"id": "a17279c1.d62958",
"type": "function",
"z": "20ece430.4c99ec",
"name": "Block",
"func": "msg.payload=123;\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 866.1000862121582,
"y": 475.0666980743408,
"wires": [
[
"1d27e964.e87ca7",
"471e4e5.1d61bb"
]
]
},
{
"id": "a3a3d800.af1cc8",
"type": "function",
"z": "6192cd5f.3ebfb4",
"name": "Return global.Pressure",
"func": "pressure = global.get('pressure');\nmsg.payload = pressure;\nmsg.topic = 'Pressure';\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"x": 495.0187759399414,
"y": 829.0250415802002,
"wires": [
[
"d2dcd2c0.f1862"
]
]
},
{
"id": "786c7b15.72b9c4",
"type": "debug",
"z": "8ddcf0be.63b95",
"name": "",
"active": false,
"console": "false",
"complete": "true",
"x": 1537.833236694336,
"y": 779.6658315658569,
"wires": []
},
{
"id": "f5b39b4.a236b68",
"type": "smooth",
"z": "8ddcf0be.63b95",
"name": "",
"action": "mean",
"count": "20",
"round": "1",
"mult": "single",
"x": 782.1331481933594,
"y": 775.9330921173096,
"wires": [
[
"a6f00cd2.66932",
"7e0281fa.10bbd"
]
]
},
{
"id": "dfbe7531.91fad8",
"type": "comment",
"z": "8ddcf0be.63b95",
"name": "Input data from ultrasonic level sensor 1 with conversion to level",
"info": "",
"x": 413.4998779296875,
"y": 669.199872970581,
"wires": []
},
{
"id": "a6f00cd2.66932",
"type": "debug",
"z": "8ddcf0be.63b95",
"name": "",
"active": false,
"console": "false",
"complete": "true",
"x": 1019.9999465942383,
"y": 888.9998826980591,
"wires": []
},
{
"id": "7e0281fa.10bbd",
"type": "function",
"z": "8ddcf0be.63b95",
"name": "define global.dist, fullvolume,currentvolume,level",
"func": "global.set('dist',msg.payload);\nvar d = parseFloat(global.get('dist'));\nvar emptydist = parseFloat(global.get('emptydist'));\nvar fulldist = parseFloat(global.get('fulldist'));\nif (fulldist > 33){\n fullvolume = (190.125 * (38 - (fulldist)));\n global.set('fullvolume',fullvolume);\n}if (fulldist <= 33){\n fullvolume = ((380.25 * (33 - fulldist)) + 950.625);\n global.set('fullvolume',fullvolume);\n}\nif (d > 33){\n currentvolume = (190.125 * (38 - (d)));\n}if (d <= 33){\n currentvolume = ((380.25 * (33 - d)) + 950.625);\n}\nglobal.set('currentvolume',currentvolume);\nvar level = (currentvolume/fullvolume)*100;\nglobal.set('level',level);\nreturn msg;\n",
"outputs": "2",
"noerr": 0,
"x": 1154.0000457763672,
"y": 741.0000057220459,
"wires": [
[
"786c7b15.72b9c4"
],
[]
]
},
{
"id": "4d36991b.f37ed8",
"type": "serial in",
"z": "8ddcf0be.63b95",
"name": "Arduino Nano Level Sensor",
"serial": "9301c102.d79c4",
"x": 332.00001525878906,
"y": 782.9999904632568,
"wires": [
[
"f5b39b4.a236b68",
"a6f00cd2.66932"
]
]
},
{
"id": "f7f10e74.473db",
"type": "inject",
"z": "8ddcf0be.63b95",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": true,
"x": 784.0000457763672,
"y": 661.0000057220459,
"wires": [
[
"7e0281fa.10bbd",
"8f22b176.2ab52"
]
]
},
{
"id": "8f22b176.2ab52",
"type": "function",
"z": "8ddcf0be.63b95",
"name": "Zero Values on Start",
"func": "global.set(\"fullvolume\",0);\nglobal.set(\"currentvolume\",0);\nglobal.set(\"level\",0);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1034.0000457763672,
"y": 621.0000057220459,
"wires": [
[]
]
},
{
"id": "49bc6f2e.1d1f8",
"type": "link in",
"z": "20ece430.4c99ec",
"name": "Level Auto Stop",
"links": [
"76225e7a.6018f"
],
"x": 540.9124374389648,
"y": 732.7124423980713,
"wires": [
[
"1d27e964.e87ca7"
]
]
},
{
"id": "3493bb11.618994",
"type": "switch",
"z": "8ddcf0be.63b95",
"name": "Level to Setpoint Logic",
"property": "level",
"propertyType": "global",
"rules": [
{
"t": "lte",
"v": "recovery",
"vt": "global"
}
],
"checkall": "true",
"outputs": 1,
"x": 898.0188140869141,
"y": 1100.025037765503,
"wires": [
[
"76225e7a.6018f"
]
]
},
{
"id": "9ee1f1b4.225cb",
"type": "ui_switch",
"z": "8ddcf0be.63b95",
"name": "",
"label": "Level Sensor Autostop",
"group": "ca4a0643.3b3f88",
"order": 6,
"width": 0,
"height": 0,
"passthru": true,
"decouple": "false",
"topic": "",
"style": "",
"onvalue": "1",
"onvalueType": "num",
"onicon": "",
"oncolor": "",
"offvalue": "0",
"offvalueType": "num",
"officon": "",
"offcolor": "",
"x": 356.08526611328125,
"y": 1087.6249809265137,
"wires": [
[
"707561f2.bf5a4"
]
]
},
{
"id": "707561f2.bf5a4",
"type": "trigger",
"z": "8ddcf0be.63b95",
"op1": "true",
"op2": "0",
"op1type": "bool",
"op2type": "str",
"duration": "-2",
"extend": false,
"units": "s",
"reset": "0",
"name": "",
"x": 620.0850982666016,
"y": 1096.5580377578735,
"wires": [
[
"3493bb11.618994"
]
]
},
{
"id": "76225e7a.6018f",
"type": "link out",
"z": "8ddcf0be.63b95",
"name": "",
"links": [
"49bc6f2e.1d1f8"
],
"x": 1124.918685913086,
"y": 1114.3499660491943,
"wires": []
},
{
"id": "c02f22b6.76303",
"type": "ui_text_input",
"z": "8ddcf0be.63b95",
"name": "",
"label": "Full Distance (cm):",
"group": "d5d21687.ca1738",
"order": 1,
"width": 0,
"height": 0,
"passthru": true,
"mode": "text",
"delay": "100",
"topic": "min",
"x": 784.8334541320801,
"y": 205.02498245239258,
"wires": [
[
"a1bb4741.777a78"
]
]
},
{
"id": "8748b80.43f2948",
"type": "ui_text_input",
"z": "8ddcf0be.63b95",
"name": "",
"label": "Empty Distance (cm):",
"group": "d5d21687.ca1738",
"order": 2,
"width": 0,
"height": 0,
"passthru": true,
"mode": "text",
"delay": "100",
"topic": "max",
"x": 773.8334083557129,
"y": 340.02488899230957,
"wires": [
[
"404e8448.9eac7c"
]
]
},
{
"id": "a1bb4741.777a78",
"type": "change",
"z": "8ddcf0be.63b95",
"name": "Define global.fulldist",
"rules": [
{
"t": "move",
"p": "payload",
"pt": "msg",
"to": "fulldist",
"tot": "global"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1102.6000785827637,
"y": 204.62420177459717,
"wires": [
[]
]
},
{
"id": "404e8448.9eac7c",
"type": "change",
"z": "8ddcf0be.63b95",
"name": "Define global.emptydist",
"rules": [
{
"t": "move",
"p": "payload",
"pt": "msg",
"to": "emptydist",
"tot": "global"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1106.6000862121582,
"y": 341.62420558929443,
"wires": [
[]
]
},
{
"id": "4ecb6b9f.aec884",
"type": "ui_text_input",
"z": "8ddcf0be.63b95",
"name": "",
"label": "Percent Recovery (%)",
"group": "cb4fb20a.918cb",
"order": 3,
"width": 0,
"height": 0,
"passthru": true,
"mode": "text",
"delay": "100",
"topic": "",
"x": 897.6667327880859,
"y": 458.424129486084,
"wires": [
[
"71b8d3cf.54c67c"
]
]
},
{
"id": "71b8d3cf.54c67c",
"type": "function",
"z": "8ddcf0be.63b95",
"name": "Define global.recovery",
"func": "global.set('PercentFiltered',msg.payload);\nvar percfil = global.get('PercentFiltered',msg.payload);\nvar percrec = 100-percfil;\nglobal.set('recovery',percrec);",
"outputs": 1,
"noerr": 0,
"x": 1185.6666831970215,
"y": 484.6907124519348,
"wires": [
[]
]
},
{
"id": "1fc84018.c2e94",
"type": "inject",
"z": "8ddcf0be.63b95",
"name": "",
"topic": "",
"payload": "19",
"payloadType": "num",
"repeat": "",
"crontab": "",
"once": true,
"x": 459.0000648498535,
"y": 183.95828199386597,
"wires": [
[
"8952922a.888c2"
]
]
},
{
"id": "cc058552.847d98",
"type": "inject",
"z": "8ddcf0be.63b95",
"name": "",
"topic": "",
"payload": "38",
"payloadType": "num",
"repeat": "",
"crontab": "",
"once": true,
"x": 388.766788482666,
"y": 331.62516498565674,
"wires": [
[
"79f13bab.4f2114"
]
]
},
{
"id": "bb963b9c.36e598",
"type": "inject",
"z": "8ddcf0be.63b95",
"name": "",
"topic": "",
"payload": "60",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": true,
"x": 408,
"y": 494.95855236053467,
"wires": [
[
"64b5611d.70f86"
]
]
},
{
"id": "b72c0745.ac98c8",
"type": "comment",
"z": "8ddcf0be.63b95",
"name": "User input for pump stop recovery percentage",
"info": "",
"x": 672.3334007263184,
"y": 423.82450008392334,
"wires": []
},
{
"id": "27c7fc83.1c5fe4",
"type": "link in",
"z": "8ddcf0be.63b95",
"name": "Distance Entry and Percent Recovery",
"links": [
"95756214.a774f",
"72c83576.f20c9c"
],
"x": 239.000093460083,
"y": 276.6915044784546,
"wires": [
[
"8748b80.43f2948",
"4ecb6b9f.aec884",
"c02f22b6.76303"
]
]
},
{
"id": "8952922a.888c2",
"type": "delay",
"z": "8ddcf0be.63b95",
"name": "",
"pauseType": "delay",
"timeout": "4",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 595.3396759033203,
"y": 188.81199550628662,
"wires": [
[
"c02f22b6.76303"
]
]
},
{
"id": "79f13bab.4f2114",
"type": "delay",
"z": "8ddcf0be.63b95",
"name": "",
"pauseType": "delay",
"timeout": "4",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 560.6459045410156,
"y": 334.843279838562,
"wires": [
[
"8748b80.43f2948"
]
]
},
{
"id": "64b5611d.70f86",
"type": "delay",
"z": "8ddcf0be.63b95",
"name": "",
"pauseType": "delay",
"timeout": "4",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 603.6459121704102,
"y": 493.84327030181885,
"wires": [
[
"4ecb6b9f.aec884"
]
]
},
{
"id": "24cc818e.caf78e",
"type": "comment",
"z": "8ddcf0be.63b95",
"name": "Level Sensor Settings/Calibration",
"info": "",
"x": 345.0187683105469,
"y": 96.0250015258789,
"wires": []
},
{
"id": "2995bd31.689252",
"type": "comment",
"z": "a67b02db.65d08",
"name": "Refrence Temperature for Corrected Flux",
"info": "",
"x": 330.51269149780273,
"y": 909.8689150810242,
"wires": []
},
{
"id": "82125778.f39688",
"type": "comment",
"z": "8ddcf0be.63b95",
"name": "User input for min and max distance for level calculations",
"info": "",
"x": 409.0187683105469,
"y": 138.02500915527344,
"wires": []
},
{
"id": "15f41a91.c50155",
"type": "ds18b20",
"z": "e73e5dd5.981d6",
"name": "DS18B20 #2",
"sensorid": "28-041693648cff",
"timer": "0.05",
"x": 139.0187530517578,
"y": 136.02500915527344,
"wires": [
[
"ba5ab572.2ac8e8"
]
]
},
{
"id": "ba5ab572.2ac8e8",
"type": "function",
"z": "e73e5dd5.981d6",
"name": "Define global.temp2,EC2tempcorr",
"func": "global.set('temp2',msg.payload);\nglobal.set('EC2tempcorr',msg.payload);",
"outputs": 1,
"noerr": 0,
"x": 426.0187301635742,
"y": 128.02500915527344,
"wires": [
[]
]
},
{
"id": "3f0c6cf3.48ea04",
"type": "comment",
"z": "e73e5dd5.981d6",
"name": "Permeate temperature input ",
"info": "",
"x": 178.48540496826172,
"y": 84.49158477783203,
"wires": []
},
{
"id": "48d62580.294fbc",
"type": "function",
"z": "e73e5dd5.981d6",
"name": "Return global.temp2",
"func": "msg.payload = global.get('temp2');\nmsg.topic = 'Temeprature';\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 399.0187683105469,
"y": 317.0249938964844,
"wires": [
[
"18baf0db.bedc2f"
]
]
},
{
"id": "18baf0db.bedc2f",
"type": "ui_gauge",
"z": "e73e5dd5.981d6",
"name": "Temp Display",
"group": "83c57b0a.062898",
"order": 3,
"width": "0",
"height": "0",
"gtype": "gage",
"title": "Permeate Temperture",
"label": "°C",
"format": "{{value| number:2}}",
"min": 0,
"max": "75",
"colors": [
"#00b500",
"#e6e600",
"#ca3838"
],
"seg1": "25",
"seg2": "50",
"x": 690.0186996459961,
"y": 321.0249938964844,
"wires": []
},
{
"id": "2cf726b9.c04c0a",
"type": "link in",
"z": "e73e5dd5.981d6",
"name": "",
"links": [
"80324130.d165b"
],
"x": 122.92500305175781,
"y": 312.69998931884766,
"wires": [
[
"48d62580.294fbc"
]
]
},
{
"id": "80324130.d165b",
"type": "link out",
"z": "bca3b7d8.ee3178",
"name": "",
"links": [
"2cf726b9.c04c0a"
],
"x": 638.9249572753906,
"y": 564.1562271118164,
"wires": []
},
{
"id": "4456ea29.e194c4",
"type": "link in",
"z": "9368ac8b.630df",
"name": "Auto Turn off Sensor",
"links": [
"d34209ee.10a4f8"
],
"x": 107.91250514984131,
"y": 293.70621490478516,
"wires": [
[
"f4b306d8.13d4a8"
]
]
},
{
"id": "d34209ee.10a4f8",
"type": "link out",
"z": "20ece430.4c99ec",
"name": "",
"links": [
"4456ea29.e194c4",
"876d11d5.3f1b8",
"edc4b56d.c98988",
"27e58472.21da8c"
],
"x": 1209.9186706542969,
"y": 504.13748931884766,
"wires": []
},
{
"id": "876d11d5.3f1b8",
"type": "link in",
"z": "e562458a.b05e28",
"name": "Auto Turn off Sensor",
"links": [
"d34209ee.10a4f8"
],
"x": 179.9999942779541,
"y": 213.02500915527344,
"wires": [
[
"9eacf5ff.55eae8"
]
]
},
{
"id": "edc4b56d.c98988",
"type": "link in",
"z": "4959b239.3baf5c",
"name": "Auto Turn off Sensor",
"links": [
"d34209ee.10a4f8"
],
"x": 139.0187530517578,
"y": 204.02500915527344,
"wires": [
[
"d5b16555.e19418"
]
]
},
{
"id": "1fa6204d.a68f5",
"type": "comment",
"z": "8e5eabab.140278",
"name": "Scale Calibration",
"info": "",
"x": 241.9249610900879,
"y": 1367.5374460220337,
"wires": []
},
{
"id": "6368da13.f351a4",
"type": "comment",
"z": "8e5eabab.140278",
"name": "Calibration Display ",
"info": "",
"x": 263.9249839782715,
"y": 1150.5312070846558,
"wires": []
},
{
"id": "48a8d9d4.51cef8",
"type": "comment",
"z": "8e5eabab.140278",
"name": "Input for Stop Weight",
"info": "",
"x": 300.9249839782715,
"y": 1009.5312070846558,
"wires": []
},
{
"id": "16a7a65b.3397ca",
"type": "comment",
"z": "8e5eabab.140278",
"name": "Scale Weight Display and Flowrate Calculations",
"info": "",
"x": 300.91875076293945,
"y": 717.5312156677246,
"wires": []
},
{
"id": "c9aef79.5d7aa08",
"type": "ui_text_input",
"z": "8e5eabab.140278",
"name": "",
"label": "Initial Weight (g)",
"group": "cb4fb20a.918cb",
"order": 4,
"width": 0,
"height": 0,
"passthru": true,
"mode": "text",
"delay": 300,
"topic": "",
"x": 557,
"y": 570.0000610351562,
"wires": [
[
"828d5717.de7ef8"
]
]
},
{
"id": "828d5717.de7ef8",
"type": "function",
"z": "8e5eabab.140278",
"name": "Define global.initialweight",
"func": "global.set('initialweight',msg.payload);\n",
"outputs": 1,
"noerr": 0,
"x": 891.0000152587891,
"y": 579.0000171661377,
"wires": [
[]
]
},
{
"id": "bcb78e0.852df7",
"type": "ui_text",
"z": "8ddcf0be.63b95",
"group": "cb4fb20a.918cb",
"order": 8,
"width": 0,
"height": 0,
"name": "",
"label": "Current Volume:",
"format": "{{msg.payload}}mL",
"layout": "row-spread",
"x": 484,
"y": 861,
"wires": []
},
{
"id": "ec8cc949.34d558",
"type": "ui_text",
"z": "8ddcf0be.63b95",
"group": "d5d21687.ca1738",
"order": 4,
"width": 0,
"height": 0,
"name": "",
"label": "Current Volume:",
"format": "{{msg.payload}}mL",
"layout": "row-spread",
"x": 484,
"y": 821,
"wires": []
},
{
"id": "e242a409.03fae8",
"type": "ui_text",
"z": "8ddcf0be.63b95",
"group": "cb4fb20a.918cb",
"order": 7,
"width": 0,
"height": 0,
"name": "",
"label": "End Volume:",
"format": "{{msg.endvolume}}mL",
"layout": "row-spread",
"x": 494,
"y": 1121,
"wires": []
},
{
"id": "69d8e63.997f118",
"type": "ui_text",
"z": "8ddcf0be.63b95",
"group": "ca4a0643.3b3f88",
"order": 1,
"width": 0,
"height": 0,
"name": "",
"label": "Stop Percent:",
"format": "{{msg.payload}}%",
"layout": "row-spread",
"x": 484,
"y": 1161,
"wires": []
},
{
"id": "5331e25d.e9991c",
"type": "ui_text",
"z": "8ddcf0be.63b95",
"group": "cb4fb20a.918cb",
"order": 6,
"width": 0,
"height": 0,
"name": "",
"label": "Starting Volume:",
"format": "{{msg.payload}}mL",
"layout": "row-spread",
"x": 484,
"y": 1081,
"wires": []
},
{
"id": "9e40a4dd.c5c098",
"type": "ui_text",
"z": "8ddcf0be.63b95",
"group": "d5d21687.ca1738",
"order": 3,
"width": 0,
"height": 0,
"name": "",
"label": "Starting Volume:",
"format": "{{msg.payload}}mL",
"layout": "row-spread",
"x": 484,
"y": 1021,
"wires": []
},
{
"id": "a664e85.3dbd818",
"type": "function",
"z": "8ddcf0be.63b95",
"name": "Return global.currentvolume",
"func": "level = global.get('currentvolume');\nmsg.payload = level.toFixed(1);\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"x": 780,
"y": 1213,
"wires": [
[]
]
},
{
"id": "82019fae.088e9",
"type": "function",
"z": "8ddcf0be.63b95",
"name": "Return global.fullvolume",
"func": "var vol = global.get('fullvolume');\nmsg.payload = vol.toFixed(1);\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"x": 770,
"y": 1393,
"wires": [
[]
]
},
{
"id": "7f4fd5ed.32824c",
"type": "function",
"z": "8ddcf0be.63b95",
"name": "Return global.recovery",
"func": "startingvolume = global.get('fullvolume');\nstoppercent = global.get('recovery');\nendvolume = startingvolume * (stoppercent/100);\nendvolume = endvolume.toFixed(1);\nglobal.set('endvolume',endvolume);\nmsg.payload = stoppercent;\nmsg.endvolume = endvolume;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 780,
"y": 1453,
"wires": [
[]
]
},
{
"id": "4bfcb567.4d908c",
"type": "function",
"z": "8ddcf0be.63b95",
"name": "Return global.dist",
"func": "msg.payload = global.get('dist');\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"x": 553,
"y": 1902,
"wires": [
[
"81b22992.ce0548"
]
]
},
{
"id": "81b22992.ce0548",
"type": "ui_text",
"z": "8ddcf0be.63b95",
"group": "d5d21687.ca1738",
"order": 5,
"width": 0,
"height": 0,
"name": "",
"label": "Current Distance:",
"format": "{{msg.payload}}cm",
"layout": "row-spread",
"x": 860.0000534057617,
"y": 1902.999927520752,
"wires": []
},
{
"id": "24e1b663.0f2f7a",
"type": "ui_text",
"z": "8e5eabab.140278",
"group": "cb4fb20a.918cb",
"order": 10,
"width": 0,
"height": 0,
"name": "",
"label": "Current Weight: ",
"format": "{{msg.payload}}g",
"layout": "row-spread",
"x": 890.918643951416,
"y": 898.9499273300171,
"wires": []
},
{
"id": "8a0bf5da.50f148",
"type": "ui_text",
"z": "8e5eabab.140278",
"group": "cb4fb20a.918cb",
"order": 2,
"width": 0,
"height": 0,
"name": "",
"label": "Percent Recovery",
"format": "{{msg.payload}}%",
"layout": "row-spread",
"x": 866.9999618530273,
"y": 1061.0002422332764,
"wires": []
},
{
"id": "3844ec3d.787934",
"type": "ui_switch",
"z": "20ece430.4c99ec",
"name": "",
"label": "Low Pressure Autostop",
"group": "ca4a0643.3b3f88",
"order": 8,
"width": 0,
"height": 0,
"passthru": true,
"decouple": "false",
"topic": "",
"style": "",
"onvalue": "1",
"onvalueType": "num",
"onicon": "",
"oncolor": "",
"offvalue": "0",
"offvalueType": "num",
"officon": "",
"offcolor": "",
"x": 136,
"y": 861.6666498184204,
"wires": [
[
"65edc774.0fc668"
]
]
},
{
"id": "65edc774.0fc668",
"type": "trigger",
"z": "20ece430.4c99ec",
"op1": "true",
"op2": "0",
"op1type": "bool",
"op2type": "str",
"duration": "-2",
"extend": false,
"units": "s",
"reset": "0",
"name": "",
"x": 355.9999694824219,
"y": 868.6666259765625,
"wires": [
[
"dbe304da.3a9618"
]
]
},
{
"id": "dbe304da.3a9618",
"type": "switch",
"z": "20ece430.4c99ec",
"name": "Pressure Autostop",
"property": "pressure",
"propertyType": "global",
"rules": [
{
"t": "lt",
"v": "0.8",
"vt": "num"
}
],
"checkall": "true",
"outputs": 1,
"x": 634.9999389648438,
"y": 883.6666526794434,
"wires": [
[
"1d27e964.e87ca7"
]
]
},
{
"id": "d2dcd2c0.f1862",
"type": "ui_chart",
"z": "6192cd5f.3ebfb4",
"name": "",
"group": "1d80b743.0287b9",
"order": 3,
"width": 0,
"height": 0,
"label": "Process Variables",
"chartType": "line",
"legend": "true",
"xformat": "HH:mm:ss",
"interpolate": "bezier",
"nodata": "",
"dot": false,
"ymin": "0",
"ymax": "20",
"removeOlder": "1",
"removeOlderPoints": "",
"removeOlderUnit": "86400",
"cutout": 0,
"useOneColor": false,
"colors": [
"#00ffff",
"#ff0000",
"#00ff00",
"#ffff00",
"#ff00ff",
"#8080ff",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"useOldStyle": true,
"x": 957.0001678466797,
"y": 556.6666202545166,
"wires": [
[],
[]
]
},
{
"id": "bab3e57c.25a228",
"type": "switch",
"z": "d8426a64.e2a948",
"name": "Valve Setpoint",
"property": "temp1",
"propertyType": "global",
"rules": [
{
"t": "gte",
"v": "tempon",
"vt": "global"
},
{
"t": "lte",
"v": "tempoff",
"vt": "global"
}
],
"checkall": "true",
"outputs": 2,
"x": 720,
"y": 460,
"wires": [
[
"9976b2c2.488b2"
],
[
"b1af760d.f3b208"
]
]
},
{
"id": "85117fb6.f169d",
"type": "ui_switch",
"z": "d8426a64.e2a948",
"name": "",
"label": "Temperature Control",
"group": "ca4a0643.3b3f88",
"order": 9,
"width": 0,
"height": 0,
"passthru": true,
"decouple": "false",
"topic": "",
"style": "",
"onvalue": "true",
"onvalueType": "bool",
"onicon": "",
"oncolor": "",
"offvalue": "0",
"offvalueType": "num",
"officon": "",
"offcolor": "",
"x": 140,
"y": 560,
"wires": [
[
"f056c220.41b8e",
"23fee8c5.890798"
]
]
},
{
"id": "1cf99897.cb17d7",
"type": "ui_text_input",
"z": "d8426a64.e2a948",
"name": "",
"label": "Valve on Temp",
"group": "ca4a0643.3b3f88",
"order": 12,
"width": 0,
"height": 0,
"passthru": true,
"mode": "text",
"delay": 300,
"topic": "",
"x": 500,
"y": 820,
"wires": [
[
"9038c004.53767"
]
]
},
{
"id": "9038c004.53767",
"type": "function",
"z": "d8426a64.e2a948",
"name": "Define global.tempon",
"func": "var tempon = parseFloat(msg.payload);\nglobal.set('tempon',tempon);\n",
"outputs": 1,
"noerr": 0,
"x": 764.0000152587891,
"y": 816.3333930969238,
"wires": [
[]
]
},
{
"id": "d822a74c.124e48",
"type": "ui_text_input",
"z": "d8426a64.e2a948",
"name": "",
"label": "Valve off Temp",
"group": "ca4a0643.3b3f88",
"order": 11,
"width": 0,
"height": 0,
"passthru": true,
"mode": "text",
"delay": 300,
"topic": "",
"x": 574.0000076293945,
"y": 909.3333549499512,
"wires": [
[
"f8a3ad15.df908"
]
]
},
{
"id": "f8a3ad15.df908",
"type": "function",
"z": "d8426a64.e2a948",
"name": "Define global.tempoff",
"func": "var tempoff = parseFloat(msg.payload);\nglobal.set('tempoff',tempoff);\n",
"outputs": 1,
"noerr": 0,
"x": 848.0000534057617,
"y": 910.3333549499512,
"wires": [
[]
]
},
{
"id": "f056c220.41b8e",
"type": "trigger",
"z": "d8426a64.e2a948",
"op1": "true",
"op2": "0",
"op1type": "bool",
"op2type": "str",
"duration": "-30",
"extend": false,
"units": "s",
"reset": "0",
"name": "",
"x": 370,
"y": 520,
"wires": [
[
"6acb937d.61500c"
]
]
},
{
"id": "9976b2c2.488b2",
"type": "trigger",
"z": "d8426a64.e2a948",
"op1": "1",
"op2": "",
"op1type": "str",
"op2type": "nul",
"duration": "250",
"extend": false,
"units": "ms",
"reset": "",
"name": "",
"x": 920.1667709350586,
"y": 456.66668224334717,
"wires": [
[
"49688898.bef438",
"7084aa1.3c57954"
]
]
},
{
"id": "b1af760d.f3b208",
"type": "trigger",
"z": "d8426a64.e2a948",
"op1": "0",
"op2": "",
"op1type": "str",
"op2type": "nul",
"duration": "250",
"extend": false,
"units": "ms",
"reset": "",
"name": "",
"x": 945.0000305175781,
"y": 592.0000171661377,
"wires": [
[
"49688898.bef438",
"7084aa1.3c57954"
]
]
},
{
"id": "bc34a574.283a48",
"type": "inject",
"z": "d8426a64.e2a948",
"name": "",
"topic": "",
"payload": "30",
"payloadType": "num",
"repeat": "",
"crontab": "",
"once": true,
"x": 121.16667556762695,
"y": 835.3333597183228,
"wires": [
[
"23f80c6f.22bb34"
]
]
},
{
"id": "e715ec56.327f1",
"type": "inject",
"z": "d8426a64.e2a948",
"name": "",
"topic": "",
"payload": "25",
"payloadType": "num",
"repeat": "",
"crontab": "",
"once": true,
"x": 139.1666717529297,
"y": 914.3333549499512,
"wires": [
[
"5cdb1a36.62f814"
]
]
},
{
"id": "23f80c6f.22bb34",
"type": "delay",
"z": "d8426a64.e2a948",
"name": "",
"pauseType": "delay",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 273.1666946411133,
"y": 856.6666870117188,
"wires": [
[
"1cf99897.cb17d7"
]
]
},
{
"id": "5cdb1a36.62f814",
"type": "delay",
"z": "d8426a64.e2a948",
"name": "",
"pauseType": "delay",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 365.00002670288086,
"y": 921.0000219345093,
"wires": [
[
"d822a74c.124e48"
]
]
},
{
"id": "49688898.bef438",
"type": "function",
"z": "d8426a64.e2a948",
"name": "Valve Status",
"func": "if (msg.payload==1){\n msg.payload= 'Valve ON';\n}\nelse {\n msg.payload='Valve OFF';\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1205,
"y": 678.3333129882812,
"wires": [
[
"b0558d74.c7ff4"
]
]
},
{
"id": "b0558d74.c7ff4",
"type": "ui_text",
"z": "d8426a64.e2a948",
"group": "ca4a0643.3b3f88",
"order": 13,
"width": 0,
"height": 0,
"name": "",
"label": "Valve Status",
"format": "{{msg.payload}}",
"layout": "row-spread",
"x": 1405,
"y": 698.3333129882812,
"wires": []
},
{
"id": "23fee8c5.890798",
"type": "function",
"z": "d8426a64.e2a948",
"name": "Valve Status",
"func": "if (msg.payload===0){\n msg.payload=1;\n return msg;\n}\nelse {\n}\n",
"outputs": 1,
"noerr": 0,
"x": 572,
"y": 700,
"wires": [
[
"b1af760d.f3b208"
]
]
},
{
"id": "5213b8ff.29af88",
"type": "function",
"z": "20ece430.4c99ec",
"name": "Block",
"func": "msg.payload=\"stop\";\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 250,
"y": 440,
"wires": [
[
"3d4fce04.24a152"
]
]
},
{
"id": "6b865e0a.00d05",
"type": "switch",
"z": "20ece430.4c99ec",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "1",
"vt": "num"
},
{
"t": "eq",
"v": "0",
"vt": "num"
}
],
"checkall": "true",
"outputs": 2,
"x": 234.00002479553223,
"y": 288.00000953674316,
"wires": [
[
"c8c458e1.8c2e48"
],
[
"5213b8ff.29af88"
]
]
},
{
"id": "e482354f.59b718",
"type": "gpio out",
"z": "9368ac8b.630df",
"name": "",
"state": "I2C_WRITE_REQUEST",
"pin": "",
"i2cDelay": "0",
"i2cAddress": "99",
"i2cRegister": "",
"outputs": 0,
"board": "7b651cb9.7da0a4",
"x": 1793.1667175292969,
"y": 214.66669464111328,
"wires": []
},
{
"id": "e1eb8b1e.d91c78",
"type": "rpi-gpio in",
"z": "20ece430.4c99ec",
"name": "",
"pin": "22",
"intype": "down",
"debounce": "25",
"read": true,
"x": 79.16667175292969,
"y": 289.33334159851074,
"wires": [
[
"6b865e0a.00d05"
]
]
},
{
"id": "7534da9f.c17234",
"type": "rpi-gpio out",
"z": "20ece430.4c99ec",
"name": "",
"pin": "35",
"set": true,
"level": "0",
"freq": "",
"out": "out",
"x": 1459.1667079925537,
"y": 486.6666784286499,
"wires": []
},
{
"id": "cae37f4a.d23a7",
"type": "gpio out",
"z": "9368ac8b.630df",
"name": "",
"state": "I2C_WRITE_REQUEST",
"pin": "",
"i2cDelay": "0",
"i2cAddress": "99",
"i2cRegister": "",
"outputs": 0,
"board": "7b651cb9.7da0a4",
"x": 1726,
"y": 446,
"wires": []
},
{
"id": "a5238509.6a0528",
"type": "gpio out",
"z": "9368ac8b.630df",
"name": "",
"state": "I2C_WRITE_REQUEST",
"pin": "",
"i2cDelay": "0",
"i2cAddress": "99",
"i2cRegister": "",
"outputs": 0,
"board": "7b651cb9.7da0a4",
"x": 1258,
"y": 914,
"wires": []
},
{
"id": "b21b776.63f7d88",
"type": "gpio out",
"z": "e562458a.b05e28",
"name": "",
"state": "I2C_WRITE_REQUEST",
"pin": "",
"i2cDelay": "0",
"i2cAddress": "100",
"i2cRegister": "",
"outputs": 0,
"board": "7b651cb9.7da0a4",
"x": 1876.0000534057617,
"y": 242.00000762939453,
"wires": []
},
{
"id": "7084aa1.3c57954",
"type": "rpi-gpio out",
"z": "d8426a64.e2a948",
"name": "",
"pin": "36",
"set": true,
"level": "0",
"freq": "",
"out": "out",
"x": 1298,
"y": 520,
"wires": []
},
{
"id": "75113844.7cb1f8",
"type": "gpio out",
"z": "e562458a.b05e28",
"name": "",
"state": "I2C_WRITE_REQUEST",
"pin": "",
"i2cDelay": "0",
"i2cAddress": "100",
"i2cRegister": "",
"outputs": 0,
"board": "7b651cb9.7da0a4",
"x": 1366,
"y": 864,
"wires": []
},
{
"id": "c8213add.db3448",
"type": "gpio out",
"z": "e562458a.b05e28",
"name": "",
"state": "I2C_WRITE_REQUEST",
"pin": "",
"i2cDelay": "0",
"i2cAddress": "100",
"i2cRegister": "",
"outputs": 0,
"board": "7b651cb9.7da0a4",
"x": 1550,
"y": 488,
"wires": []
},
{
"id": "5baf940f.5197dc",
"type": "gpio out",
"z": "4959b239.3baf5c",
"name": "",
"state": "I2C_WRITE_REQUEST",
"pin": "",
"i2cDelay": "0",
"i2cAddress": "101",
"i2cRegister": "",
"outputs": 0,
"board": "7b651cb9.7da0a4",
"x": 1734,
"y": 244,
"wires": []
},
{
"id": "64223a22.5934d4",
"type": "gpio out",
"z": "4959b239.3baf5c",
"name": "",
"state": "I2C_WRITE_REQUEST",
"pin": "",
"i2cDelay": "0",
"i2cAddress": "101",
"i2cRegister": "",
"outputs": 0,
"board": "7b651cb9.7da0a4",
"x": 1454,
"y": 468,
"wires": []
},
{
"id": "dc82d664.9b21d8",
"type": "gpio out",
"z": "4959b239.3baf5c",
"name": "",
"state": "I2C_WRITE_REQUEST",
"pin": "",
"i2cDelay": "0",
"i2cAddress": "101",
"i2cRegister": "",
"outputs": 0,
"board": "7b651cb9.7da0a4",
"x": 1190.0000338554382,
"y": 924.0000267028809,
"wires": []
},
{
"id": "6acb937d.61500c",
"type": "switch",
"z": "d8426a64.e2a948",
"name": "",
"property": "tempcontrol",
"propertyType": "global",
"rules": [
{
"t": "eq",
"v": "0",
"vt": "num"
},
{
"t": "eq",
"v": "1",
"vt": "num"
}
],
"checkall": "true",
"outputs": 2,
"x": 550,
"y": 520,
"wires": [
[
"bab3e57c.25a228"
],
[
"db4109a9.d76dc8"
]
]
},
{
"id": "5978b044.e3728",
"type": "ui_switch",
"z": "d8426a64.e2a948",
"name": "",
"label": "Heating (Cooling=off)",
"group": "ca4a0643.3b3f88",
"order": 10,
"width": 0,
"height": 0,
"passthru": true,
"decouple": "false",
"topic": "",
"style": "",
"onvalue": "1",
"onvalueType": "num",
"onicon": "",
"oncolor": "",
"offvalue": "0",
"offvalueType": "num",
"officon": "",
"offcolor": "",
"x": 180,
"y": 380,
"wires": [
[
"55cae10b.91b8a"
]
]
},
{
"id": "db4109a9.d76dc8",
"type": "switch",
"z": "d8426a64.e2a948",
"name": "Valve Setpoint",
"property": "temp1",
"propertyType": "global",
"rules": [
{
"t": "lte",
"v": "tempon",
"vt": "global"
},
{
"t": "gte",
"v": "tempoff",
"vt": "global"
}
],
"checkall": "true",
"outputs": 2,
"x": 700,
"y": 580,
"wires": [
[
"9976b2c2.488b2"
],
[
"b1af760d.f3b208"
]
]
},
{
"id": "55cae10b.91b8a",
"type": "change",
"z": "d8426a64.e2a948",
"name": "",
"rules": [
{
"t": "set",
"p": "tempcontrol",
"pt": "global",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 423.16668701171875,
"y": 392,
"wires": [
[]
]
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment