From 47c83956d54f613e61aa14607292e6f577bb483a Mon Sep 17 00:00:00 2001 From: Noah Baron Date: Fri, 1 Jan 2021 15:52:32 -0800 Subject: [PATCH] Improved UI for Calibrating --- flow.json | 2796 +++++++++++++++++++++++++++++------------------------ 1 file changed, 1515 insertions(+), 1281 deletions(-) diff --git a/flow.json b/flow.json index 5e7275f..c03bfee 100644 --- a/flow.json +++ b/flow.json @@ -78,7 +78,7 @@ "id": "6acae0b0.a184", "type": "ui_group", "z": "", - "name": "Calibration (Specific Gravity)", + "name": "Specific Gravity Calibration", "tab": "75f710f5.16d2e", "order": 2, "disp": true, @@ -291,7 +291,7 @@ "id": "c12bcb12.dbd0d8", "type": "ui_group", "z": "", - "name": "Calibration (Temperature)", + "name": "Temperature Calibration", "tab": "75f710f5.16d2e", "order": 4, "disp": true, @@ -561,8 +561,8 @@ "crontab": "", "once": true, "onceDelay": "0.1", - "x": 410, - "y": 240, + "x": 490, + "y": 260, "wires": [ [ "c0f36d.ab686c9", @@ -579,8 +579,8 @@ "property": "payload", "action": "", "pretty": false, - "x": 730, - "y": 100, + "x": 810, + "y": 120, "wires": [ [ "d504d607.384f48" @@ -596,8 +596,8 @@ "ret": "obj", "url": "", "tls": "", - "x": 3620, - "y": 140, + "x": 3700, + "y": 160, "wires": [ [ "6cbfa171.d2106", @@ -697,8 +697,8 @@ "from": "", "to": "", "reg": false, - "x": 1090, - "y": 100, + "x": 1170, + "y": 120, "wires": [ [ "7c18d8fe.188168" @@ -723,8 +723,8 @@ "checkall": "true", "repair": false, "outputs": 1, - "x": 970, - "y": 100, + "x": 1050, + "y": 120, "wires": [ [ "7f2f1fbf.e1098" @@ -746,8 +746,8 @@ "mode": "text", "delay": "0", "topic": "", - "x": 4015, - "y": 509, + "x": 4095, + "y": 529, "wires": [ [ "6040e73e.fa2088", @@ -763,8 +763,8 @@ "func": "var color = flow.get('colordropdownSelect')||\"\";\nvar beerArray = msg.payload.split(\",\");\nif (beerArray[1] === undefined){\n beerArray[1] = true;\n flow.set(color + \"-URL\",\"\");\n}\nflow.set(color + \"-Beer\",beerArray);\n//node.warn(beerArray);\n\nif (beerArray[1] === true){\n msg.payload = beerArray[0];\n msg.topic = \"Beer name set for \" + color;\n} else {\n msg.payload = beerArray[0] + \",\" + beerArray[1];\n msg.topic = \"[Beer name],[cloud ID] set for \" + color;\n}\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 4237, - "y": 508, + "x": 4317, + "y": 528, "wires": [ [ "2f84bf9f.847b6" @@ -779,8 +779,8 @@ "func": "//get color-mac combo\nvar IDbyMAC = flow.get('IDbyMAC')||false;\nif (IDbyMAC) {\nmsg.payload.Color = msg.payload.Color + \":\" + msg.payload.mac;\nmsg.payload.displayColor = msg.payload.Color.split(\":\");\nmsg.payload.IDbyMAC = true;\n} else {\n msg.payload.displayColor = [msg.payload.Color];\n msg.payload.IDbyMAC = false;\n}\n//set beer name and local name status\nvar beerArray = flow.get(msg.payload.Color + \"-Beer\")||[\"Untitled\",true];\nmsg.payload.Beer = beerArray;\n//set dropdown options\nvar options = flow.get('options')||[];\nvar color = msg.payload.Color;\nif (options.indexOf(color) === -1){ //check if Tilt color has been seen\n options.push(color);\n options.sort();\n //node.warn(options);\n flow.set('options',options);\n node.send([null, {'payload': options}]);\n}\n//set SG cal points\nvar actualSGArray = flow.get('actualSGpoints-' + msg.payload.Color)||[];\nvar uncalSGArray = flow.get('uncalSGpoints-' + msg.payload.Color)||[];\nmsg.payload.actualSGPoints = actualSGArray.toString();\nmsg.payload.unCalSGPoints = uncalSGArray.toString();\n//set Temp cal points\nvar actualTempArray = flow.get('actualTemppoints-' + msg.payload.Color)||[];\nvar uncalTempArray = flow.get('uncalTemppoints-' + msg.payload.Color)||[];\nmsg.payload.actualTempPoints = actualTempArray.toString();\nmsg.payload.unCalTempPoints = uncalTempArray.toString();\n//add timeStamp parameter\nmsg.payload.timeStamp = Date.now();\nvar date = new Date();\n//add Timepoint parameter\nvar timeZone = date.getTimezoneOffset()/24/60;\nmsg.payload.formatteddate = date.toLocaleString();\nmsg.payload.Timepoint = msg.payload.timeStamp / 1000 / 60 / 60 / 24 + 25569 - timeZone;\n//add SG parameter, account for extra precision if needed\nmsg.payload.fermunits = flow.get('fermdisplayUnits')||'';\nif (msg.payload.minor > 2000){\nmsg.payload.SG = msg.payload.minor / 10000;\nmsg.payload.major /= 10;\nmsg.payload.hd = true;\n}else{\nmsg.payload.SG = msg.payload.minor / 1000;\nmsg.payload.hd = false;\n}\n//add Temp parameter\nmsg.payload.Temp = msg.payload.major;\nmsg.payload.tempunits = flow.get('displayUnits')||\"°F\";\n//Google Sheet URL for displaying link in display\nmsg.payload.doclongurl = flow.get(msg.payload.Color + '-URL')||\"\";\nmsg.topic = msg.payload.Color;\nmsg.filename = \"/home/pi/\" + msg.payload.Color + \".json\";\n//get custom cloud URL if default cloud URL set to undefined\nmsg.payload.customcloudURL = flow.get('cloudURL-' + msg.payload.Color);\n//set global cloud settings\nmsg.payload.defaultcloudURL = flow.get('cloudURL')||['https://script.google.com/macros/s/AKfycbwNXh6rEWoULd0vxWxDylG_PJwQwe0dn5hdtSkuC4k3D9AXBSA/exec',true];\nmsg.payload.logCloudDataCheck = flow.get('logCloudDataCheck')||true;\nmsg.payload.logLocalDataCheck = flow.get('logLocalDataCheck');\nmsg.payload.localloggingInterval = flow.get('localloggingInterval')||15;\nmsg.payload.loggingInterval = flow.get('loggingInterval')||15;\nmsg.payload.minRSSI = flow.get('minRSSI');\nmsg.payload.alphaSG = flow.get('alphaSG');\nmsg.payload.alphaTemp = flow.get('alphaTemp');\nmsg.payload.numberSamples = flow.get('numberSamples');\nmsg.payload.smoothSwitch = flow.get('smoothSwitch');\nreturn [ msg, null ];", "outputs": 2, "noerr": 0, - "x": 1240, - "y": 120, + "x": 1320, + "y": 140, "wires": [ [ "b90d01ad.44d08", @@ -805,8 +805,8 @@ "storeOutMessages": true, "fwdInMessages": true, "templateScope": "local", - "x": 2750, - "y": 120, + "x": 2830, + "y": 140, "wires": [ [ "394a5d3d.92fa72", @@ -828,8 +828,8 @@ "storeOutMessages": true, "fwdInMessages": true, "templateScope": "local", - "x": 2750, - "y": 280, + "x": 2830, + "y": 300, "wires": [ [ "1ee5d27c.fa4e8e", @@ -849,8 +849,8 @@ "crontab": "", "once": false, "onceDelay": "", - "x": 430, - "y": 20, + "x": 510, + "y": 40, "wires": [ [ "9d251f5a.10bdc" @@ -876,8 +876,8 @@ "from": "", "to": "", "reg": false, - "x": 1990, - "y": 120, + "x": 2070, + "y": 140, "wires": [ [ "5006138a.18932c" @@ -895,8 +895,8 @@ "repeat": "1", "crontab": "", "once": false, - "x": 2160, - "y": 120, + "x": 2240, + "y": 140, "wires": [ [ "9628a72.af07d58" @@ -916,8 +916,8 @@ "storeOutMessages": true, "fwdInMessages": true, "templateScope": "local", - "x": 2750, - "y": 320, + "x": 2830, + "y": 340, "wires": [ [ "1ee5d27c.fa4e8e", @@ -1062,8 +1062,8 @@ "checkall": "false", "repair": false, "outputs": 25, - "x": 1760, - "y": 340, + "x": 1840, + "y": 360, "wires": [ [ "64f10179.474c9" @@ -1161,8 +1161,8 @@ "from": "", "to": "", "reg": false, - "x": 1990, - "y": 280, + "x": 2070, + "y": 300, "wires": [ [] ] @@ -1186,8 +1186,8 @@ "from": "", "to": "", "reg": false, - "x": 1990, - "y": 360, + "x": 2070, + "y": 380, "wires": [ [] ] @@ -1211,8 +1211,8 @@ "from": "", "to": "", "reg": false, - "x": 1990, - "y": 320, + "x": 2070, + "y": 340, "wires": [ [] ] @@ -1228,8 +1228,8 @@ "repeat": "1", "crontab": "", "once": false, - "x": 2160, - "y": 280, + "x": 2240, + "y": 300, "wires": [ [ "97228e52.47232" @@ -1247,8 +1247,8 @@ "repeat": "1", "crontab": "", "once": false, - "x": 2160, - "y": 320, + "x": 2240, + "y": 340, "wires": [ [ "87e70118.323b3" @@ -1274,8 +1274,8 @@ "from": "", "to": "", "reg": false, - "x": 2350, - "y": 120, + "x": 2430, + "y": 140, "wires": [ [ "14d297fb.15dbc8" @@ -1290,8 +1290,8 @@ "func": "//this function block requires msg.payload.SG, msg.payload.Temp, msg.payload.actualSGPoints, msg.payload.actualTempPoints(a comma separated string of the actual values), msg.payload.unCalSGPoints, and msg.payload.unCalTempPoints (a comma separated string of the measured raw values)\nfunction linearInterpolation (x, x0, y0, x1, y1) {\n var a = (y1 - y0) / (x1 - x0);\n var b = -a * x0 + y0;\n return a * x + b;\n}\n//calculate calibrated SG by linear interpolation of calibration points\nvar actualSGPoints = [];\nvar unCalSGPoints = [];\nvar unCalSGPointsTemp = [];\nvar SG = msg.payload.SG;\nactualSGPoints = msg.payload.actualSGPoints.split(\",\");\nunCalSGPoints = msg.payload.unCalSGPoints.split(\",\");\nunCalSGPointsTemp = msg.payload.unCalSGPoints.split(\",\");\n//ensure uncal value always between two numbers\nunCalSGPointsTemp.push(-0.001, SG, Number.MAX_VALUE);\nunCalSGPoints.push(-0.001, Number.MAX_VALUE);\nactualSGPoints.push(-0.001, Number.MAX_VALUE);\nunCalSGPointsTemp.sort(function(a, b){return a-b;});\nunCalSGPoints.sort(function(a, b){return a-b;});\nactualSGPoints.sort(function(a, b){return a-b;});\nvar indexSG = unCalSGPointsTemp.indexOf(SG);\nvar calSG = linearInterpolation (Number(SG), Number(unCalSGPoints[indexSG-1]), Number(actualSGPoints[indexSG-1]), Number(unCalSGPoints[indexSG]), Number(actualSGPoints[indexSG]));\nmsg.payload.uncalSG = SG;\nmsg.payload.uncalPlato = 1111.14 * msg.payload.uncalSG - 630.272 * msg.payload.uncalSG * msg.payload.uncalSG + 135.997 * msg.payload.uncalSG * msg.payload.uncalSG * msg.payload.uncalSG - 616.868;\nmsg.payload.uncalBrix = (((182.4601 * msg.payload.uncalSG - 775.6821) * msg.payload.uncalSG + 1262.7794) * msg.payload.uncalSG - 669.5622);\nmsg.payload.SG = calSG;\nmsg.payload.Plato = 1111.14 * msg.payload.SG - 630.272 * msg.payload.SG * msg.payload.SG + 135.997 * msg.payload.SG * msg.payload.SG * msg.payload.SG - 616.868;\nmsg.payload.Brix = (((182.4601 * msg.payload.SG - 775.6821) * msg.payload.SG + 1262.7794) * msg.payload.SG - 669.5622);\nswitch (msg.payload.fermunits){\n case \"\" : if (msg.payload.hd){msg.payload.ferm = msg.payload.SG.toFixed(4);\n msg.payload.uncalferm = msg.payload.uncalSG.toFixed(4);\n }\n if (!msg.payload.hd){msg.payload.ferm = msg.payload.SG.toFixed(3);\n msg.payload.uncalferm = msg.payload.uncalSG.toFixed(3);\n }\n break;\n case \"°P\" : if (msg.payload.hd){msg.payload.ferm = msg.payload.Plato.toFixed(2);\n msg.payload.uncalferm = msg.payload.uncalPlato.toFixed(2); \n }\n if (!msg.payload.hd){msg.payload.ferm = msg.payload.Plato.toFixed(1);\n msg.payload.uncalferm = msg.payload.uncalPlato.toFixed(1); \n }\n break;\n case \"°Bx\": if (msg.payload.hd){msg.payload.ferm = msg.payload.Brix.toFixed(2);\n msg.payload.uncalferm = msg.payload.uncalBrix.toFixed(2);\n }\n if (!msg.payload.hd){msg.payload.ferm = msg.payload.Brix.toFixed(1);\n msg.payload.uncalferm = msg.payload.uncalBrix.toFixed(1);\n }\n}\n\n//calculate calibrated Temp by linear interpolation of calibration points\nvar actualTempPoints = [];\nvar unCalTempPoints = [];\nvar unCalTempPointsTemp = [];\nvar Temp = msg.payload.Temp;\nif (msg.payload.tempunits === \"°C\"){\n Temp -= 32;\n Temp *= 0.5555;\n}\nactualTempPoints = msg.payload.actualTempPoints.split(\",\");\nunCalTempPoints = msg.payload.unCalTempPoints.split(\",\");\nunCalTempPointsTemp = msg.payload.unCalTempPoints.split(\",\");\n//ensure uncal value always between two numbers\nunCalTempPointsTemp.push(-999, Temp, Number.MAX_VALUE);\nunCalTempPoints.push(-999, Number.MAX_VALUE);\nactualTempPoints.push(-999, Number.MAX_VALUE);\nunCalTempPointsTemp.sort(function(a, b){return a-b;});\nunCalTempPoints.sort(function(a, b){return a-b;});\nactualTempPoints.sort(function(a, b){return a-b;});\n//node.warn(actualTempPoints);\nvar indexTemp = unCalTempPointsTemp.indexOf(Temp);\nvar calTemp = linearInterpolation (Number(Temp), Number(unCalTempPoints[indexTemp-1]), Number(actualTempPoints[indexTemp-1]), Number(unCalTempPoints[indexTemp]), Number(actualTempPoints[indexTemp]));\nif (Number.isNaN(calTemp)){\n calTemp = 0;\n}\nmsg.payload.uncalTemp = Temp.toFixed(1);\nmsg.payload.displayuncalTemp = Temp.toFixed(1);\nmsg.payload.displayTemp = calTemp.toFixed(1);\nif (msg.payload.tempunits === \"°C\"){\n calTemp *= 1.8;\n calTemp += 32;\n msg.payload.Temp = calTemp.toFixed(1);\n}else{\nmsg.payload.Temp = calTemp.toFixed(1);\n}\nreturn msg;", "outputs": "1", "noerr": 0, - "x": 1590, - "y": 120, + "x": 1670, + "y": 140, "wires": [ [ "c4b0f249.af093" @@ -1320,8 +1320,8 @@ ], "payload": "", "topic": "", - "x": 1490, - "y": 1040, + "x": 1570, + "y": 1060, "wires": [ [ "6aa75852.1e3068", @@ -1337,8 +1337,8 @@ "func": "var color = flow.get('colordropdownSelect')||undefined;\nif (color !== undefined){\n var beerArray = flow.get(color + \"-Beer\")||[\"\",true];\n if (beerArray[1] === true){\n msg.payload = beerArray[0];\n }\n else {\n msg.payload = beerArray;\n }\n} else {\n msg.enabled = false;\n}\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 3000, - "y": 1140, + "x": 3080, + "y": 1160, "wires": [ [ "656f0cf9.e79cd4" @@ -1353,8 +1353,8 @@ "func": "var color = flow.get('colordropdownSelect')||\"\";\nvar comment = msg.payload;\nflow.set(color + \"-Comment\",comment);\nflow.set('lastpost-' + color,0);\nflow.set('lastlocalpost-' + color,0);\nmsg.payload = \"Sending: \" + comment;\nmsg.topic = \"TILT | \" + color;\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 2406.9999237060547, - "y": 1219.9999895095825, + "x": 2486.9999237060547, + "y": 1239.9999895095825, "wires": [ [ "8dec8962.63e398" @@ -1367,8 +1367,8 @@ "z": "a564595f.642818", "name": "Store latest and update every x seconds", "info": "Saves iBeacon scans to flow database and reads back at 1 second intervals. Allows read out to continue to display last reading even if out of range.", - "x": 2064.5, - "y": 21, + "x": 2144.5, + "y": 41, "wires": [] }, { @@ -1379,8 +1379,8 @@ "func": "var postEnabled = (flow.get('logCloudDataCheck'))||false;\nvar interval = flow.get('loggingInterval')||15;\ninterval *= 60000;\nif (postEnabled && msg.payload.Color !== undefined){\n var lastPost = flow.get('lastpost-' + msg.payload.Color)||0;\n if (msg.payload.timeStamp - lastPost > interval){\n flow.set('lastpost-' + msg.payload.Color,msg.payload.timeStamp);\n //node.warn(msg.payload.Color + ' triggered');\n //node.warn(msg.payload.timeStamp - lastPost);\n msg.payload.Comment = flow.get(msg.payload.Color + \"-Comment\")||\"\";\n msg.payload.Beer = flow.get(msg.payload.Color + \"-Beer\")||[\"Untitled\",true];\n msg.topic = msg.payload.Color;\n if (msg.payload.Beer[1] === true){\n msg.payload.Beer = msg.payload.Beer[0];\n }\n //msg.headers = {};\n //msg.headers['content-type'] = 'application/x-www-form-urlencoded; charset=utf-8';\n var payloadEncoded = encodeURI(\"Timepoint=\" + msg.payload.Timepoint + \"&Temp=\" + msg.payload.Temp + \"&SG=\" + msg.payload.SG + \"&Beer=\" + msg.payload.Beer + \"&Color=\" + msg.payload.Color + \"&Comment=\" + msg.payload.Comment);\n if (flow.get('cloudURL')[1] === true){\n var defaultCloudURL = flow.get('cloudURL')[0];\n node.send({ headers : { 'content-type' : 'application/x-www-form-urlencoded; charset=utf-8' }, url : defaultCloudURL, payload : payloadEncoded, cloudwait : 'Contacting Default Cloud URL...
(allow up to 30 seconds)' });\n }\n else{\n var cloudURLs = flow.get('cloudURL-' + msg.payload.Color)||'none';\n if (cloudURLs != 'none'){\n var cloudURLsArray = cloudURLs.split(',');\n for (var i = 0; i < cloudURLsArray.length; i++){\n node.send({ headers : { 'content-type' : 'application/x-www-form-urlencoded; charset=utf-8' }, url : cloudURLsArray[i], payload : payloadEncoded, cloudwait : 'Contacting Cloud URL ' + (i + 1) + '...
(allow up to 30 seconds)' });\n }\n }\n }\n}\n}", "outputs": 1, "noerr": 0, - "x": 3097.5, - "y": 226, + "x": 3177.5, + "y": 246, "wires": [ [ "bac24b5.6a220b8" @@ -1401,8 +1401,8 @@ "mode": "text", "delay": "0", "topic": "", - "x": 1910, - "y": 1240, + "x": 1990, + "y": 1260, "wires": [ [ "c79f0193.2a7c7" @@ -1431,8 +1431,8 @@ "offvalueType": "bool", "officon": "", "offcolor": "", - "x": 2051.9999237060547, - "y": 1383.9999895095825, + "x": 2131.9999237060547, + "y": 1403.9999895095825, "wires": [ [ "bed68eaf.abdc3" @@ -1447,8 +1447,8 @@ "func": "var color = flow.get('colordropdownSelect');\nflow.set(\"cloudURL-\" + color,msg.payload);\nmsg.topic = \"Custom cloud URL set for \" + color;\nvar cloudURLs = msg.payload;\nvar cloudURLsList = cloudURLs.replace(/,/g,'
');\nmsg.payload = cloudURLsList;\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 2105.500156402588, - "y": 1305.000060081482, + "x": 2185.500156402588, + "y": 1325.000060081482, "wires": [ [ "ecffbfac.2fc53" @@ -1463,8 +1463,8 @@ "func": "var color = flow.get('colordropdownSelect')||\"\";\nflow.set('logCloudDataCheck',msg.payload);\nflow.set('lastpost-' + color,0);\nmsg.topic = \"TILT | \" + color;\nif (msg.payload){\nmsg.payload = \"Logging request sent. Waiting for response.\";\n}\nelse {\n msg.payload = \"Logging disabled.\";\n}\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 2334.9999237060547, - "y": 1372.9999895095825, + "x": 2414.9999237060547, + "y": 1392.9999895095825, "wires": [ [ "8dec8962.63e398" @@ -1476,11 +1476,11 @@ "type": "function", "z": "a564595f.642818", "name": "set Pre-cal SG Value", - "func": "flow.set('uncalSGpoint',Number(msg.payload.uncalSG).toFixed(4));", + "func": "flow.set('uncalSGpoint',Number(msg.payload).toFixed(4));", "outputs": 1, "noerr": 0, - "x": 2518.4999237060547, - "y": 1430.9999895095825, + "x": 2860, + "y": 1460, "wires": [ [] ] @@ -1493,14 +1493,13 @@ "func": "flow.set('colordropdownSelect',msg.payload);\nmsg.payload = \"\";\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 1970, - "y": 1140, + "x": 2050, + "y": 1160, "wires": [ [ "971574e0.783ba8", "df1c3ed0.bd3a9", - "de92b02f.5ebe1", - "5933654f.572e0c" + "de92b02f.5ebe1" ] ] }, @@ -1509,16 +1508,19 @@ "type": "function", "z": "a564595f.642818", "name": "Get Current SG", - "func": "var options = flow.get('options')||[];\nvar color = msg.payload;\nvar displayNumber = options.indexOf(color) + 1;\nmsg.payload = flow.get(\"storage-\" + displayNumber.toString());\nif (msg.payload !== undefined){\nreturn msg;\n}", - "outputs": 1, + "func": "if (msg.payload == \"disabled\") {\n context.set(\"autoUpdate\", \"disabled\");\n}\nif (msg.payload == \"enabled\") {\n context.set(\"autoUpdate\", \"enabled\");\n}\nvar autoUpdate = context.get(\"autoUpdate\")||\"enabled\";\nif (autoUpdate == \"enabled\"){\nvar options = flow.get('options')||[];\nvar color = msg.payload;\nvar displayNumber = options.indexOf(color) + 1;\nmsg.payload = flow.get(\"storage-\" + displayNumber.toString());\nif (msg.payload !== undefined){\nvar msg1 = {};\nvar msg2 = {};\nmsg1.payload = msg.payload.uncalSG.toFixed(4);\nmsg2.payload = msg.payload.SG.toFixed(4);\nreturn [msg1,msg2];\n}\n}", + "outputs": 2, "noerr": 0, - "x": 2078.4999237060547, - "y": 1470.9999895095825, + "x": 2180, + "y": 1500, "wires": [ [ - "777f1a14.1b3e44", - "ecfbe772.ba4cb8", - "713dd3f6.8af61c" + "26d12db4.df7f82", + "777f1a14.1b3e44" + ], + [ + "8756395a.c6f6e8", + "84ffe685.150d58" ] ] }, @@ -1527,15 +1529,13 @@ "type": "function", "z": "a564595f.642818", "name": "set Actual SG Value", - "func": "var value = Number(msg.payload);\nflow.set('actualSGpoint',value.toFixed(4));\nmsg.payload = flow.get('colordropdownSelect');\nreturn msg;", + "func": "var value = Number(msg.payload);\nflow.set('actualSGpoint',value.toFixed(4));\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 2138.4999237060547, - "y": 1730.9999895095825, + "x": 2850, + "y": 1520, "wires": [ - [ - "6c6270ad.ae742" - ] + [] ] }, { @@ -1557,8 +1557,8 @@ "from": "", "to": "", "reg": false, - "x": 1990, - "y": 160, + "x": 2070, + "y": 180, "wires": [ [] ] @@ -1576,8 +1576,8 @@ "storeOutMessages": true, "fwdInMessages": true, "templateScope": "local", - "x": 2750, - "y": 160, + "x": 2830, + "y": 180, "wires": [ [ "1ee5d27c.fa4e8e", @@ -1604,8 +1604,8 @@ "from": "", "to": "", "reg": false, - "x": 1990, - "y": 200, + "x": 2070, + "y": 220, "wires": [ [] ] @@ -1623,8 +1623,8 @@ "storeOutMessages": true, "fwdInMessages": true, "templateScope": "local", - "x": 2750, - "y": 200, + "x": 2830, + "y": 220, "wires": [ [ "1ee5d27c.fa4e8e", @@ -1644,8 +1644,8 @@ "crontab": "", "once": false, "onceDelay": "", - "x": 2160, - "y": 200, + "x": 2240, + "y": 220, "wires": [ [ "455abe60.6afd4" @@ -1663,8 +1663,8 @@ "repeat": "1", "crontab": "", "once": false, - "x": 2160, - "y": 160, + "x": 2240, + "y": 180, "wires": [ [ "b4de88bb.e0e148" @@ -1679,8 +1679,8 @@ "func": "if(msg.payload === undefined){\n msg.payload = {};\n msg.show = \"hidden\";\n return msg; \n}\nvar displayTimeout = flow.get('displayTimeout')||120000;\n//set msg.topic for use in displaying the correct color\nmsg.topic = msg.payload.Color;\n//reorder list if a Tilt disconnects\nif (msg.payload.clock - msg.payload.timeStamp > displayTimeout){\n flow.set('storage-1',undefined);\n flow.set('storage-2',undefined);\n flow.set('storage-3',undefined);\n flow.set('storage-4',undefined);\n flow.set('storage-5',undefined);\n flow.set('storage-6',undefined);\n flow.set('storage-7',undefined);\n flow.set('storage-8',undefined);\n flow.set('storage-9',undefined);\n flow.set('storage-10',undefined);\n flow.set('storage-11',undefined);\n flow.set('storage-12',undefined);\n flow.set('storage-13',undefined);\n flow.set('storage-14',undefined);\n flow.set('storage-15',undefined);\n flow.set('storage-16',undefined);\n flow.set('storage-17',undefined);\n flow.set('storage-18',undefined);\n flow.set('storage-19',undefined);\n flow.set('storage-20',undefined);\n flow.set('storage-21',undefined);\n flow.set('storage-22',undefined);\n flow.set('storage-23',undefined);\n flow.set('storage-24',undefined);\n flow.set('storage-25',undefined);\n flow.set('options',[]);\n if (msg.topic === flow.get('colordropdownSelect')){\n flow.set('colordropdownSelect',undefined);\n }\n msg.show = \"hidden\";\n return msg;\n}\nelse{\n msg.show = \"visible\";\n return msg;\n}", "outputs": 1, "noerr": 0, - "x": 2530, - "y": 120, + "x": 2610, + "y": 140, "wires": [ [ "1aee8aa4.c92885" @@ -1691,60 +1691,15 @@ "id": "6c6270ad.ae742", "type": "function", "z": "a564595f.642818", - "name": "Add SG Cal Point", - "func": "var color = msg.payload;\nvar uncalSGcalPoint = flow.get('uncalSGpoint')||0;\nvar actualSGcalPoint = flow.get('actualSGpoint')||0;\nvar uncalpointsArray = flow.get('uncalSGpoints-' + color)||[];\nvar actualpointsArray = flow.get('actualSGpoints-' + color)||[];\nuncalpointsArray.push(uncalSGcalPoint);\nuncalpointsArray.sort(function(a, b){return a-b;});\nflow.set('uncalSGpoints-' + color,uncalpointsArray);\nactualpointsArray.push(actualSGcalPoint);\nactualpointsArray.sort(function(a, b){return a-b;});\nflow.set('actualSGpoints-' + color,actualpointsArray);\nvar msg1 = {payload:uncalpointsArray.toString()};\nvar msg2 = {payload:actualpointsArray.toString()};\nreturn [msg1, msg2];", - "outputs": "2", - "noerr": 0, - "x": 2442.9999237060547, - "y": 1736.9999895095825, - "wires": [ - [ - "1be76b3b.e111e5" - ], - [ - "e29d71bb.f0e81" - ] - ] - }, - { - "id": "63c7bb7c.317274", - "type": "ui_button", - "z": "a564595f.642818", - "name": "", - "group": "6acae0b0.a184", - "order": 5, - "width": 0, - "height": 0, - "passthru": false, - "label": "Clear Calibration", - "color": "", - "bgcolor": "", - "icon": "", - "payload": "colordropdownSelect", - "payloadType": "flow", - "topic": "", - "x": 2210.9999237060547, - "y": 1856.9999895095825, - "wires": [ - [ - "e38fab7c.6f34e8" - ] - ] - }, - { - "id": "e38fab7c.6f34e8", - "type": "function", - "z": "a564595f.642818", - "name": "clear calibration", - "func": "var color = msg.payload;\nvar uncalpointsArray = flow.set('uncalSGpoints-' + color,[]);\nvar actualpointsArray = flow.set('actualSGpoints-' + color,[]);\nmsg.payload = \"\";\nreturn msg;", + "name": "Add SG Cal Points", + "func": "var color = msg.payload;\nif (msg.topic == \"clear calibration\"){\n flow.set('uncalSGpoints-' + color,[]);\n flow.set('actualSGpoints-' + color,[]);\n}else{\nvar uncalSGcalPoint = flow.get('uncalSGpoint')||0;\nvar actualSGcalPoint = flow.get('actualSGpoint')||0;\nif (msg.topic == \"calibrate in water\"){\n actualSGcalPoint = \"1.0000\";\n}\nvar uncalpointsArray = flow.get('uncalSGpoints-' + color)||[];\nvar actualpointsArray = flow.get('actualSGpoints-' + color)||[];\nuncalpointsArray.push(uncalSGcalPoint);\nuncalpointsArray.sort(function(a, b){return a-b;});\nflow.set('uncalSGpoints-' + color,uncalpointsArray);\nactualpointsArray.push(actualSGcalPoint);\nactualpointsArray.sort(function(a, b){return a-b;});\nflow.set('actualSGpoints-' + color,actualpointsArray);\n}\nmsg.topic = color;\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 2422.9999237060547, - "y": 1857.9999895095825, + "x": 3030, + "y": 1760, "wires": [ [ - "1be76b3b.e111e5", - "e29d71bb.f0e81" + "3b195e06.c8f962" ] ] }, @@ -1753,17 +1708,15 @@ "type": "function", "z": "a564595f.642818", "name": "update display", - "func": "var color = flow.get('colordropdownSelect')||\"\";\nvar uncalpointsArray = flow.get('uncalSGpoints-' + color)||[];\nvar actualpointsArray = flow.get('actualSGpoints-' + color)||[];\nvar msg1 = {payload:uncalpointsArray};\nvar msg2 = {payload:actualpointsArray};\nreturn [msg1, msg2];", - "outputs": "2", + "func": "msg.topic = flow.get('colordropdownSelect')||\"\";\nreturn msg;", + "outputs": 1, "noerr": 0, - "x": 2221.9999237060547, - "y": 1793.9999895095825, + "x": 2460, + "y": 1860, "wires": [ [ - "1be76b3b.e111e5" - ], - [ - "e29d71bb.f0e81" + "3b195e06.c8f962", + "518cb266.0001dc" ] ] }, @@ -1782,8 +1735,8 @@ "randomLast": "5", "randomUnits": "seconds", "drop": false, - "x": 3335, - "y": 183, + "x": 3415, + "y": 203, "wires": [ [ "6cbfa171.d2106", @@ -1811,8 +1764,8 @@ "from": "", "to": "", "reg": false, - "x": 2350, - "y": 160, + "x": 2430, + "y": 180, "wires": [ [ "c9e125df.66b318" @@ -1827,8 +1780,8 @@ "func": "if(msg.payload === undefined){\n msg.payload = {};\n msg.show = \"hidden\";\n return msg; \n}\nvar displayTimeout = flow.get('displayTimeout')||120000;\n//set msg.topic for use in displaying the correct color\nmsg.topic = msg.payload.Color;\n//reorder list if a Tilt disconnects\nif (msg.payload.clock - msg.payload.timeStamp > displayTimeout){\n flow.set('storage-1',undefined);\n flow.set('storage-2',undefined);\n flow.set('storage-3',undefined);\n flow.set('storage-4',undefined);\n flow.set('storage-5',undefined);\n flow.set('storage-6',undefined);\n flow.set('storage-7',undefined);\n flow.set('storage-8',undefined);\n flow.set('storage-9',undefined);\n flow.set('storage-10',undefined);\n flow.set('storage-11',undefined);\n flow.set('storage-12',undefined);\n flow.set('storage-13',undefined);\n flow.set('storage-14',undefined);\n flow.set('storage-15',undefined);\n flow.set('storage-16',undefined);\n flow.set('storage-17',undefined);\n flow.set('storage-18',undefined);\n flow.set('storage-19',undefined);\n flow.set('storage-20',undefined);\n flow.set('storage-21',undefined);\n flow.set('storage-22',undefined);\n flow.set('storage-23',undefined);\n flow.set('storage-24',undefined);\n flow.set('storage-25',undefined);\n flow.set('options',[]);\n if (msg.topic === flow.get('colordropdownSelect')){\n flow.set('colordropdownSelect',undefined);\n }\n msg.show = \"hidden\";\n return msg;\n}\nelse{\n msg.show = \"visible\";\n return msg;\n}", "outputs": 1, "noerr": 0, - "x": 2530, - "y": 160, + "x": 2610, + "y": 180, "wires": [ [ "4dbe6177.1028" @@ -1854,8 +1807,8 @@ "from": "", "to": "", "reg": false, - "x": 2350, - "y": 200, + "x": 2430, + "y": 220, "wires": [ [ "3fc07c6.f563084" @@ -1870,8 +1823,8 @@ "func": "if(msg.payload === undefined){\n msg.payload = {};\n msg.show = \"hidden\";\n return msg; \n}\nvar displayTimeout = flow.get('displayTimeout')||120000;\n//set msg.topic for use in displaying the correct color\nmsg.topic = msg.payload.Color;\n//reorder list if a Tilt disconnects\nif (msg.payload.clock - msg.payload.timeStamp > displayTimeout){\n flow.set('storage-1',undefined);\n flow.set('storage-2',undefined);\n flow.set('storage-3',undefined);\n flow.set('storage-4',undefined);\n flow.set('storage-5',undefined);\n flow.set('storage-6',undefined);\n flow.set('storage-7',undefined);\n flow.set('storage-8',undefined);\n flow.set('storage-9',undefined);\n flow.set('storage-10',undefined);\n flow.set('storage-11',undefined);\n flow.set('storage-12',undefined);\n flow.set('storage-13',undefined);\n flow.set('storage-14',undefined);\n flow.set('storage-15',undefined);\n flow.set('storage-16',undefined);\n flow.set('storage-17',undefined);\n flow.set('storage-18',undefined);\n flow.set('storage-19',undefined);\n flow.set('storage-20',undefined);\n flow.set('storage-21',undefined);\n flow.set('storage-22',undefined);\n flow.set('storage-23',undefined);\n flow.set('storage-24',undefined);\n flow.set('storage-25',undefined);\n flow.set('options',[]);\n if (msg.topic === flow.get('colordropdownSelect')){\n flow.set('colordropdownSelect',undefined);\n }\n msg.show = \"hidden\";\n return msg;\n}\nelse{\n msg.show = \"visible\";\n return msg;\n}", "outputs": 1, "noerr": 0, - "x": 2530, - "y": 200, + "x": 2610, + "y": 220, "wires": [ [ "7c6f1c01.297234" @@ -1897,8 +1850,8 @@ "from": "", "to": "", "reg": false, - "x": 2350, - "y": 280, + "x": 2430, + "y": 300, "wires": [ [ "a6fc7026.3943f" @@ -1913,8 +1866,8 @@ "func": "if(msg.payload === undefined){\n msg.payload = {};\n msg.show = \"hidden\";\n return msg; \n}\nvar displayTimeout = flow.get('displayTimeout')||120000;\n//set msg.topic for use in displaying the correct color\nmsg.topic = msg.payload.Color;\n//reorder list if a Tilt disconnects\nif (msg.payload.clock - msg.payload.timeStamp > displayTimeout){\n flow.set('storage-1',undefined);\n flow.set('storage-2',undefined);\n flow.set('storage-3',undefined);\n flow.set('storage-4',undefined);\n flow.set('storage-5',undefined);\n flow.set('storage-6',undefined);\n flow.set('storage-7',undefined);\n flow.set('storage-8',undefined);\n flow.set('storage-9',undefined);\n flow.set('storage-10',undefined);\n flow.set('storage-11',undefined);\n flow.set('storage-12',undefined);\n flow.set('storage-13',undefined);\n flow.set('storage-14',undefined);\n flow.set('storage-15',undefined);\n flow.set('storage-16',undefined);\n flow.set('storage-17',undefined);\n flow.set('storage-18',undefined);\n flow.set('storage-19',undefined);\n flow.set('storage-20',undefined);\n flow.set('storage-21',undefined);\n flow.set('storage-22',undefined);\n flow.set('storage-23',undefined);\n flow.set('storage-24',undefined);\n flow.set('storage-25',undefined);\n flow.set('options',[]);\n if (msg.topic === flow.get('colordropdownSelect')){\n flow.set('colordropdownSelect',undefined);\n }\n msg.show = \"hidden\";\n return msg;\n}\nelse{\n msg.show = \"visible\";\n return msg;\n}", "outputs": 1, "noerr": 0, - "x": 2530, - "y": 280, + "x": 2610, + "y": 300, "wires": [ [ "79bac478.35317c" @@ -1940,8 +1893,8 @@ "from": "", "to": "", "reg": false, - "x": 2350, - "y": 320, + "x": 2430, + "y": 340, "wires": [ [ "822668cd.451b98" @@ -1956,8 +1909,8 @@ "func": "if(msg.payload === undefined){\n msg.payload = {};\n msg.show = \"hidden\";\n return msg; \n}\nvar displayTimeout = flow.get('displayTimeout')||120000;\n//set msg.topic for use in displaying the correct color\nmsg.topic = msg.payload.Color;\n//reorder list if a Tilt disconnects\nif (msg.payload.clock - msg.payload.timeStamp > displayTimeout){\n flow.set('storage-1',undefined);\n flow.set('storage-2',undefined);\n flow.set('storage-3',undefined);\n flow.set('storage-4',undefined);\n flow.set('storage-5',undefined);\n flow.set('storage-6',undefined);\n flow.set('storage-7',undefined);\n flow.set('storage-8',undefined);\n flow.set('storage-9',undefined);\n flow.set('storage-10',undefined);\n flow.set('storage-11',undefined);\n flow.set('storage-12',undefined);\n flow.set('storage-13',undefined);\n flow.set('storage-14',undefined);\n flow.set('storage-15',undefined);\n flow.set('storage-16',undefined);\n flow.set('storage-17',undefined);\n flow.set('storage-18',undefined);\n flow.set('storage-19',undefined);\n flow.set('storage-20',undefined);\n flow.set('storage-21',undefined);\n flow.set('storage-22',undefined);\n flow.set('storage-23',undefined);\n flow.set('storage-24',undefined);\n flow.set('storage-25',undefined);\n flow.set('options',[]);\n if (msg.topic === flow.get('colordropdownSelect')){\n flow.set('colordropdownSelect',undefined);\n }\n msg.show = \"hidden\";\n return msg;\n}\nelse{\n msg.show = \"visible\";\n return msg;\n}", "outputs": 1, "noerr": 0, - "x": 2530, - "y": 320, + "x": 2610, + "y": 340, "wires": [ [ "e0d6a855.d4e018" @@ -1977,8 +1930,8 @@ "storeOutMessages": true, "fwdInMessages": true, "templateScope": "local", - "x": 2750, - "y": 240, + "x": 2830, + "y": 260, "wires": [ [ "1ee5d27c.fa4e8e", @@ -2005,8 +1958,8 @@ "from": "", "to": "", "reg": false, - "x": 2350, - "y": 240, + "x": 2430, + "y": 260, "wires": [ [ "10fa6d83.b3b1b2" @@ -2021,8 +1974,8 @@ "func": "if(msg.payload === undefined){\n msg.payload = {};\n msg.show = \"hidden\";\n return msg; \n}\nvar displayTimeout = flow.get('displayTimeout')||120000;\n//set msg.topic for use in displaying the correct color\nmsg.topic = msg.payload.Color;\n//reorder list if a Tilt disconnects\nif (msg.payload.clock - msg.payload.timeStamp > displayTimeout){\n flow.set('storage-1',undefined);\n flow.set('storage-2',undefined);\n flow.set('storage-3',undefined);\n flow.set('storage-4',undefined);\n flow.set('storage-5',undefined);\n flow.set('storage-6',undefined);\n flow.set('storage-7',undefined);\n flow.set('storage-8',undefined);\n flow.set('storage-9',undefined);\n flow.set('storage-10',undefined);\n flow.set('storage-11',undefined);\n flow.set('storage-12',undefined);\n flow.set('storage-13',undefined);\n flow.set('storage-14',undefined);\n flow.set('storage-15',undefined);\n flow.set('storage-16',undefined);\n flow.set('storage-17',undefined);\n flow.set('storage-18',undefined);\n flow.set('storage-19',undefined);\n flow.set('storage-20',undefined);\n flow.set('storage-21',undefined);\n flow.set('storage-22',undefined);\n flow.set('storage-23',undefined);\n flow.set('storage-24',undefined);\n flow.set('storage-25',undefined);\n flow.set('options',[]);\n if (msg.topic === flow.get('colordropdownSelect')){\n flow.set('colordropdownSelect',undefined);\n }\n msg.show = \"hidden\";\n return msg;\n}\nelse{\n msg.show = \"visible\";\n return msg;\n}", "outputs": 1, "noerr": 0, - "x": 2530, - "y": 240, + "x": 2610, + "y": 260, "wires": [ [ "dd81e411.1cdd78" @@ -2041,8 +1994,8 @@ "crontab": "", "once": false, "onceDelay": "", - "x": 2160, - "y": 240, + "x": 2240, + "y": 260, "wires": [ [ "29f2062c.9eafea" @@ -2062,8 +2015,8 @@ "storeOutMessages": true, "fwdInMessages": true, "templateScope": "local", - "x": 2750, - "y": 400, + "x": 2830, + "y": 420, "wires": [ [ "1ee5d27c.fa4e8e", @@ -2082,8 +2035,8 @@ "repeat": "1", "crontab": "", "once": false, - "x": 2160, - "y": 400, + "x": 2240, + "y": 420, "wires": [ [ "49c2c87.03bfc38" @@ -2109,8 +2062,8 @@ "from": "", "to": "", "reg": false, - "x": 2350, - "y": 400, + "x": 2430, + "y": 420, "wires": [ [ "ba5663bf.b7cd6" @@ -2125,8 +2078,8 @@ "func": "if(msg.payload === undefined){\n msg.payload = {};\n msg.show = \"hidden\";\n return msg; \n}\nvar displayTimeout = flow.get('displayTimeout')||120000;\n//set msg.topic for use in displaying the correct color\nmsg.topic = msg.payload.Color;\n//reorder list if a Tilt disconnects\nif (msg.payload.clock - msg.payload.timeStamp > displayTimeout){\n flow.set('storage-1',undefined);\n flow.set('storage-2',undefined);\n flow.set('storage-3',undefined);\n flow.set('storage-4',undefined);\n flow.set('storage-5',undefined);\n flow.set('storage-6',undefined);\n flow.set('storage-7',undefined);\n flow.set('storage-8',undefined);\n flow.set('storage-9',undefined);\n flow.set('storage-10',undefined);\n flow.set('storage-11',undefined);\n flow.set('storage-12',undefined);\n flow.set('storage-13',undefined);\n flow.set('storage-14',undefined);\n flow.set('storage-15',undefined);\n flow.set('storage-16',undefined);\n flow.set('storage-17',undefined);\n flow.set('storage-18',undefined);\n flow.set('storage-19',undefined);\n flow.set('storage-20',undefined);\n flow.set('storage-21',undefined);\n flow.set('storage-22',undefined);\n flow.set('storage-23',undefined);\n flow.set('storage-24',undefined);\n flow.set('storage-25',undefined);\n flow.set('options',[]);\n if (msg.topic === flow.get('colordropdownSelect')){\n flow.set('colordropdownSelect',undefined);\n }\n msg.show = \"hidden\";\n return msg;\n}\nelse{\n msg.show = \"visible\";\n return msg;\n}", "outputs": 1, "noerr": 0, - "x": 2530, - "y": 400, + "x": 2610, + "y": 420, "wires": [ [ "228b94fc.188afc" @@ -2146,8 +2099,8 @@ "storeOutMessages": true, "fwdInMessages": true, "templateScope": "local", - "x": 2750, - "y": 360, + "x": 2830, + "y": 380, "wires": [ [ "1ee5d27c.fa4e8e", @@ -2174,8 +2127,8 @@ "from": "", "to": "", "reg": false, - "x": 2350, - "y": 360, + "x": 2430, + "y": 380, "wires": [ [ "68f079f0.789e18" @@ -2190,8 +2143,8 @@ "func": "if(msg.payload === undefined){\n msg.payload = {};\n msg.show = \"hidden\";\n return msg; \n}\nvar displayTimeout = flow.get('displayTimeout')||120000;\n//set msg.topic for use in displaying the correct color\nmsg.topic = msg.payload.Color;\n//reorder list if a Tilt disconnects\nif (msg.payload.clock - msg.payload.timeStamp > displayTimeout){\n flow.set('storage-1',undefined);\n flow.set('storage-2',undefined);\n flow.set('storage-3',undefined);\n flow.set('storage-4',undefined);\n flow.set('storage-5',undefined);\n flow.set('storage-6',undefined);\n flow.set('storage-7',undefined);\n flow.set('storage-8',undefined);\n flow.set('storage-9',undefined);\n flow.set('storage-10',undefined);\n flow.set('storage-11',undefined);\n flow.set('storage-12',undefined);\n flow.set('storage-13',undefined);\n flow.set('storage-14',undefined);\n flow.set('storage-15',undefined);\n flow.set('storage-16',undefined);\n flow.set('storage-17',undefined);\n flow.set('storage-18',undefined);\n flow.set('storage-19',undefined);\n flow.set('storage-20',undefined);\n flow.set('storage-21',undefined);\n flow.set('storage-22',undefined);\n flow.set('storage-23',undefined);\n flow.set('storage-24',undefined);\n flow.set('storage-25',undefined);\n flow.set('options',[]);\n if (msg.topic === flow.get('colordropdownSelect')){\n flow.set('colordropdownSelect',undefined);\n }\n msg.show = \"hidden\";\n return msg;\n}\nelse{\n msg.show = \"visible\";\n return msg;\n}", "outputs": 1, "noerr": 0, - "x": 2530, - "y": 360, + "x": 2610, + "y": 380, "wires": [ [ "2cbc023f.86f2de" @@ -2209,8 +2162,8 @@ "repeat": "1", "crontab": "", "once": false, - "x": 2163.5, - "y": 357, + "x": 2243.5, + "y": 377, "wires": [ [ "8e49f6ea.8fa718" @@ -2230,8 +2183,8 @@ "storeOutMessages": false, "fwdInMessages": true, "templateScope": "local", - "x": 4010, - "y": 580, + "x": 4090, + "y": 600, "wires": [ [] ] @@ -2244,8 +2197,8 @@ "func": "if (msg.payload.beername !== undefined){\n if (msg.payload.beername.indexOf(\",\") > -1){\n beerArray = msg.payload.beername.split(\",\");\n //node.warn(msg.payload.beername[1]);\n flow.set(msg.payload.tiltcolor + \"-Beer\",beerArray);\n //node.warn(flow.get(msg.payload.tiltcolor + \"-Beer\"));\n flow.set(msg.payload.tiltcolor + \"-Comment\",\"\");\n if (msg.payload.doclongurl !== undefined) {\n flow.set(msg.payload.tiltcolor + \"-URL\",' | View Cloud Log');\n }\n msg.payload = beerArray;\n return msg;\n }\n}", "outputs": 1, "noerr": 0, - "x": 3895, - "y": 155, + "x": 3975, + "y": 175, "wires": [ [ "656f0cf9.e79cd4" @@ -2264,8 +2217,8 @@ "cancel": "", "topic": "", "name": "", - "x": 2607.4999237060547, - "y": 1314.9999895095825, + "x": 2687.4999237060547, + "y": 1334.9999895095825, "wires": [] }, { @@ -2287,8 +2240,8 @@ "from": "", "to": "", "reg": false, - "x": 1990, - "y": 240, + "x": 2070, + "y": 260, "wires": [ [] ] @@ -2312,8 +2265,8 @@ "from": "", "to": "", "reg": false, - "x": 1990, - "y": 400, + "x": 2070, + "y": 420, "wires": [ [] ] @@ -2332,8 +2285,8 @@ "mode": "text", "delay": "0", "topic": "", - "x": 2220, - "y": 1180, + "x": 2300, + "y": 1200, "wires": [ [ "e899ac8f.ec903" @@ -2348,8 +2301,8 @@ "func": "var color = flow.get('colordropdownSelect')||\"\";\n//delete cloud wait message\nif (msg.payload.tiltcolor === color){\n msg.cloudwait = \"\";\n msg.cloudlink = flow.get(color + \"-URL\");\n}\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 3758, - "y": 414, + "x": 3838, + "y": 434, "wires": [ [ "7799f0b1.ee4b8", @@ -2379,8 +2332,8 @@ "offvalueType": "bool", "officon": "", "offcolor": "", - "x": 1370, - "y": 1260, + "x": 1450, + "y": 1280, "wires": [ [ "d599e3c9.1ae09" @@ -2402,8 +2355,8 @@ "min": "5", "max": "60", "step": "5", - "x": 2322.9999237060547, - "y": 1408.9999895095825, + "x": 2402.9999237060547, + "y": 1428.9999895095825, "wires": [ [ "e95c8a86.0f73c8", @@ -2423,8 +2376,8 @@ "label": "Minutes:", "format": "{{msg.payload}}", "layout": "row-left", - "x": 2718.4999237060547, - "y": 1410.9999895095825, + "x": 2600, + "y": 1440, "wires": [] }, { @@ -2435,8 +2388,8 @@ "func": "flow.set('loggingInterval',msg.payload);", "outputs": 1, "noerr": 0, - "x": 2586.4999237060547, - "y": 1369.9999895095825, + "x": 2666.4999237060547, + "y": 1389.9999895095825, "wires": [ [] ] @@ -2450,8 +2403,8 @@ "appendNewline": true, "createDir": false, "overwriteFile": "false", - "x": 3469.5007934570312, - "y": 331.00007247924805, + "x": 3549.5007934570312, + "y": 351.00007247924805, "wires": [ [] ] @@ -2461,8 +2414,8 @@ "type": "http response", "z": "a564595f.642818", "name": "Show Local Data", - "x": 3480.5, - "y": 375, + "x": 3560.5, + "y": 395, "wires": [] }, { @@ -2474,8 +2427,8 @@ "method": "get", "upload": false, "swaggerDoc": "", - "x": 3080.5, - "y": 374, + "x": 3160.5, + "y": 394, "wires": [ [ "898ef56a.365648" @@ -2490,8 +2443,8 @@ "filename": "/home/pi/log.csv", "format": "", "sendError": false, - "x": 3271.5, - "y": 372, + "x": 3351.5, + "y": 392, "wires": [ [ "6af4a20b.f5f3cc" @@ -2510,8 +2463,8 @@ "label": "Minimum Minutes:", "format": "{{msg.payload}}", "layout": "row-left", - "x": 2308.4999237060547, - "y": 1590.9999895095825, + "x": 2030, + "y": 1780, "wires": [] }, { @@ -2520,17 +2473,19 @@ "z": "a564595f.642818", "name": "", "label": "Time Interval", + "tooltip": "", "group": "82607108.c5be8", "order": 2, "width": 0, "height": 0, "passthru": true, + "outs": "all", "topic": "", "min": ".1", "max": "60", "step": ".1", - "x": 2088.4999237060547, - "y": 1570.9999895095825, + "x": 1830, + "y": 1740, "wires": [ [ "2cabe65a.14f1ba", @@ -2546,8 +2501,8 @@ "func": "flow.set('localloggingInterval',msg.payload);", "outputs": 1, "noerr": 0, - "x": 2288.4999237060547, - "y": 1550.9999895095825, + "x": 2010, + "y": 1700, "wires": [ [] ] @@ -2560,8 +2515,8 @@ "func": "var postEnabled = (flow.get('logLocalDataCheck'));\nvar interval = flow.get('localloggingInterval')||15;\ninterval *= 60000;\nif (postEnabled && msg.payload.Color !== undefined){\n var lastPost = flow.get('lastlocalpost-' + msg.payload.Color)||0;\n if (msg.payload.timeStamp - lastPost > interval){\n msg.payload.Comment = flow.get(msg.payload.Color + \"-Comment\")||\"\";\n msg.payload.Beer = flow.get(msg.payload.Color + \"-Beer\")||[\"Untitled\",true];\n msg.topic = msg.payload.Color;\n var date = new Date().toLocaleString();\n date = date.replace(\",\",\" \");\n //unsigned bonus byte\n var uint8 = new Uint8Array(1);\n uint8[0] = msg.payload.tx_power;\n msg.payload.tx_power = uint8[0];\n flow.set('lastlocalpost-' + msg.payload.Color,msg.payload.timeStamp);\n msg.payload = date + \",\" + msg.payload.Timepoint + \",\" + msg.payload.Temp + \",\" + msg.payload.SG + \",\" + msg.payload.Beer[0] + \",\" + msg.payload.Color + \",\" + msg.payload.Comment + \",\" + msg.payload.rssi + \",\" + msg.payload.tx_power;\n return msg;\n}\n}", "outputs": 1, "noerr": 0, - "x": 3080, - "y": 320, + "x": 3160, + "y": 340, "wires": [ [ "dcc41bde.fc7208", @@ -2577,8 +2532,8 @@ "func": "var color = flow.get('colordropdownSelect')||\"\";\nflow.set('logLocalDataCheck',msg.payload);\nflow.set('lastlocalpost-' + color,0);\nmsg.topic = \"TILT | \" + color;\nif (msg.payload){\nmsg.payload = \"Logging to Tilt Pi enabled.\";\n}\nelse {\n msg.payload = \"Logging disabled.\"\n}\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 2507.4999237060547, - "y": 1646.9999895095825, + "x": 2550, + "y": 1700, "wires": [ [ "cd2573a4.64137" @@ -2607,8 +2562,8 @@ "offvalueType": "bool", "officon": "", "offcolor": "", - "x": 2222.4999237060547, - "y": 1643.9999895095825, + "x": 2300, + "y": 1700, "wires": [ [ "2316593.5ec70a6" @@ -2627,8 +2582,8 @@ "cancel": "", "topic": "", "name": "", - "x": 2729.4999237060547, - "y": 1645.9999895095825, + "x": 2790, + "y": 1700, "wires": [] }, { @@ -2643,8 +2598,8 @@ "label": "", "format": "{{msg.payload}}", "layout": "row-left", - "x": 3852.5, - "y": 291, + "x": 3932.5, + "y": 311, "wires": [] }, { @@ -2658,8 +2613,8 @@ "timer": "5", "oldrc": false, "name": "", - "x": 3270, - "y": 260, + "x": 3350, + "y": 280, "wires": [ [ "5c5d0dab.293cc4" @@ -2679,8 +2634,8 @@ "arraySpltType": "len", "stream": false, "addname": "", - "x": 3415, - "y": 253, + "x": 3495, + "y": 273, "wires": [ [ "7317b5bb.adcf1c" @@ -2703,8 +2658,8 @@ ], "checkall": "true", "outputs": 1, - "x": 3558, - "y": 286, + "x": 3638, + "y": 306, "wires": [ [ "ae037878.ee52b8" @@ -2732,8 +2687,8 @@ "from": "", "to": "", "reg": false, - "x": 3703.5, - "y": 290, + "x": 3783.5, + "y": 310, "wires": [ [ "644a5410.3ea0bc" @@ -2749,8 +2704,8 @@ "appendNewline": true, "createDir": false, "overwriteFile": "true", - "x": 3316.5, - "y": 474, + "x": 3396.5, + "y": 494, "wires": [ [] ] @@ -2766,14 +2721,15 @@ "height": 0, "passthru": true, "label": "Delete Log", + "tooltip": "", "color": "white", - "bgcolor": "red", + "bgcolor": "#FF5733", "icon": "", "payload": "Time,Timepoint,Temp,SG,Beer,Color,Comment,RSSI,Uptime", "payloadType": "str", "topic": "", - "x": 3067.5, - "y": 477, + "x": 3147.5, + "y": 497, "wires": [ [ "dcc41bde.fc7208", @@ -2802,159 +2758,58 @@ ], "payload": "", "topic": "", - "x": 1460, - "y": 920, + "x": 1540, + "y": 980, "wires": [ [ - "6aa75852.1e3068" + "6aa75852.1e3068", + "3eb6f3c4.588d1c", + "d6de2020.56974" ] ] }, { - "id": "d9ea777.f3c9388", - "type": "ui_text_input", + "id": "f9e2fc12.8340c", + "type": "inject", "z": "a564595f.642818", - "name": "", - "label": "Enter Actual (known) point:", - "group": "6acae0b0.a184", - "order": 2, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": "0", + "name": "Logging Interval", "topic": "", - "x": 1827.4999237060547, - "y": 1727.9999895095825, + "payload": "loggingInterval", + "payloadType": "flow", + "repeat": "15", + "crontab": "", + "once": false, + "x": 2108.4999237060547, + "y": 1450.9999895095825, "wires": [ [ - "84ffe685.150d58" + "88a2c98f.f38b08" ] ] }, { - "id": "ecfbe772.ba4cb8", - "type": "ui_text", - "z": "a564595f.642818", - "group": "6acae0b0.a184", - "order": 1, - "width": 0, - "height": 0, - "name": "", - "label": "Pre-calibrated Specific Gravity:", - "format": "{{msg.payload.uncalSG | number:4}}", - "layout": "row-spread", - "x": 2428.4999237060547, - "y": 1470.9999895095825, - "wires": [] - }, - { - "id": "9bdc1db3.4ceaa", - "type": "inject", + "id": "b13cb5ba.f355b8", + "type": "exec", "z": "a564595f.642818", - "name": "Get Color Selection", - "topic": "", - "payload": "colordropdownSelect", - "payloadType": "flow", - "repeat": "2", - "crontab": "", - "once": false, - "x": 1834.4999237060547, - "y": 1488.9999895095825, + "command": "sudo reboot", + "addpay": false, + "append": "", + "useSpawn": false, + "timer": "", + "name": "Reboot", + "x": 900, + "y": 2900, "wires": [ [ - "3eb6f3c4.588d1c", - "d6de2020.56974" - ] + "2a36a03c.47d1f" + ], + [], + [] ] }, { - "id": "1be76b3b.e111e5", - "type": "ui_text_input", - "z": "a564595f.642818", - "name": "", - "label": "Edit Pre-calibrated (Tilt) Points:", - "tooltip": "", - "group": "6acae0b0.a184", - "order": 3, - "width": 0, - "height": 0, - "passthru": false, - "mode": "text", - "delay": "0", - "topic": "", - "x": 2794.4999237060547, - "y": 1776.9999895095825, - "wires": [ - [ - "88f0f33d.110ab" - ] - ] - }, - { - "id": "e29d71bb.f0e81", - "type": "ui_text_input", - "z": "a564595f.642818", - "name": "", - "label": "Edit Actual Points:", - "group": "6acae0b0.a184", - "order": 4, - "width": 0, - "height": 0, - "passthru": false, - "mode": "text", - "delay": "0", - "topic": "", - "x": 2766.4999237060547, - "y": 1843.9999895095825, - "wires": [ - [ - "b36a946.3813e68" - ] - ] - }, - { - "id": "f9e2fc12.8340c", - "type": "inject", - "z": "a564595f.642818", - "name": "Logging Interval", - "topic": "", - "payload": "loggingInterval", - "payloadType": "flow", - "repeat": "15", - "crontab": "", - "once": false, - "x": 2028.4999237060547, - "y": 1430.9999895095825, - "wires": [ - [ - "88a2c98f.f38b08" - ] - ] - }, - { - "id": "b13cb5ba.f355b8", - "type": "exec", - "z": "a564595f.642818", - "command": "sudo reboot", - "addpay": false, - "append": "", - "useSpawn": false, - "timer": "", - "name": "Reboot", - "x": 820, - "y": 2880, - "wires": [ - [ - "2a36a03c.47d1f" - ], - [], - [] - ] - }, - { - "id": "a85e96c5.56cc58", - "type": "ui_button", + "id": "a85e96c5.56cc58", + "type": "ui_button", "z": "a564595f.642818", "name": "", "group": "7e458eda.984cd", @@ -2969,8 +2824,8 @@ "payload": "now", "payloadType": "str", "topic": "", - "x": 620, - "y": 2880, + "x": 700, + "y": 2900, "wires": [ [ "b13cb5ba.f355b8" @@ -2989,8 +2844,8 @@ "cancel": "", "topic": "", "name": "", - "x": 1070, - "y": 2860, + "x": 1150, + "y": 2880, "wires": [] }, { @@ -3001,8 +2856,8 @@ "func": "var options = [\"Africa/Harare\",\"Africa/Lusaka\",\"Africa/Johannesburg\",\"Indian/Mayotte\",\"Asia/Aden\",\"Pacific/Apia\",\"Pacific/Wallis\",\"Pacific/Efate\",\"Asia/Ho_Chi_Minh\",\"America/St_Thomas\",\"America/Tortola\",\"America/Caracas\",\"America/St_Vincent\",\"Europe/Vatican\",\"Asia/Samarkand\",\"Asia/Tashkent\",\"America/Montevideo\",\"America/Adak\",\"America/Anchorage\",\"America/Boise\",\"America/Chicago\",\"America/Denver\",\"America/Detroit\",\"America/Indiana/Indianapolis\",\"America/Indiana/Knox\",\"America/Indiana/Marengo\",\"America/Indiana/Petersburg\",\"America/Indiana/Tell_City\",\"America/Indiana/Vevay\",\"America/Indiana/Vincennes\",\"America/Indiana/Winamac\",\"America/Juneau\",\"America/Kentucky/Louisville\",\"America/Kentucky/Monticello\",\"America/Los_Angeles\",\"America/Menominee\",\"America/Metlakatla\",\"America/New_York\",\"America/Nome\",\"America/North_Dakota/Beulah\",\"America/North_Dakota/Center\",\"America/North_Dakota/New_Salem\",\"America/Phoenix\",\"America/Sitka\",\"America/Yakutat\",\"Pacific/Honolulu\",\"Pacific/Midway\",\"Pacific/Wake\",\"Africa/Kampala\",\"Europe/Kiev\",\"Europe/Uzhgorod\",\"Europe/Zaporozhye\",\"Africa/Dar_es_Salaam\",\"Asia/Taipei\",\"Pacific/Funafuti\",\"America/Port_of_Spain\",\"Europe/Istanbul\",\"Pacific/Tongatapu\",\"Africa/Tunis\",\"Asia/Ashgabat\",\"Asia/Dili\",\"Pacific/Fakaofo\",\"Asia/Dushanbe\",\"Asia/Bangkok\",\"Africa/Lome\",\"Indian/Kerguelen\",\"Africa/Ndjamena\",\"America/Grand_Turk\",\"Africa/Mbabane\",\"Asia/Damascus\",\"America/Lower_Princes\",\"America/El_Salvador\",\"Africa/Sao_Tome\",\"Africa/Juba\",\"America/Paramaribo\",\"Africa/Mogadishu\",\"Africa/Dakar\",\"Europe/San_Marino\",\"Africa/Freetown\",\"Europe/Bratislava\",\"Arctic/Longyearbyen\",\"Europe/Ljubljana\",\"Atlantic/St_Helena\",\"Asia/Singapore\",\"Europe/Stockholm\",\"Africa/Khartoum\",\"Indian/Mahe\",\"Pacific/Guadalcanal\",\"Asia/Riyadh\",\"Africa/Kigali\",\"Asia/Anadyr\",\"Asia/Barnaul\",\"Asia/Chita\",\"Asia/Irkutsk\",\"Asia/Kamchatka\",\"Asia/Khandyga\",\"Asia/Krasnoyarsk\",\"Asia/Magadan\",\"Asia/Novokuznetsk\",\"Asia/Novosibirsk\",\"Asia/Omsk\",\"Asia/Sakhalin\",\"Asia/Srednekolymsk\",\"Asia/Tomsk\",\"Asia/Ust-Nera\",\"Asia/Vladivostok\",\"Asia/Yakutsk\",\"Asia/Yekaterinburg\",\"Europe/Astrakhan\",\"Europe/Kaliningrad\",\"Europe/Kirov\",\"Europe/Moscow\",\"Europe/Samara\",\"Europe/Saratov\",\"Europe/Simferopol\",\"Europe/Ulyanovsk\",\"Europe/Volgograd\",\"Europe/Belgrade\",\"Europe/Bucharest\",\"Indian/Reunion\",\"Asia/Qatar\",\"America/Asuncion\",\"Pacific/Palau\",\"Atlantic/Azores\",\"Atlantic/Madeira\",\"Europe/Lisbon\",\"Asia/Gaza\",\"Asia/Hebron\",\"America/Puerto_Rico\",\"Pacific/Pitcairn\",\"America/Miquelon\",\"Europe/Warsaw\",\"Asia/Karachi\",\"Asia/Manila\",\"Pacific/Bougainville\",\"Pacific/Port_Moresby\",\"Pacific/Gambier\",\"Pacific/Marquesas\",\"Pacific/Tahiti\",\"America/Lima\",\"America/Panama\",\"Asia/Muscat\",\"Pacific/Auckland\",\"Pacific/Chatham\",\"Pacific/Niue\",\"Pacific/Nauru\",\"Asia/Kathmandu\",\"Europe/Oslo\",\"Europe/Amsterdam\",\"America/Managua\",\"Africa/Lagos\",\"Pacific/Norfolk\",\"Africa/Niamey\",\"Pacific/Noumea\",\"Africa/Windhoek\",\"Africa/Maputo\",\"Asia/Kuala_Lumpur\",\"Asia/Kuching\",\"America/Bahia_Banderas\",\"America/Cancun\",\"America/Chihuahua\",\"America/Hermosillo\",\"America/Matamoros\",\"America/Mazatlan\",\"America/Merida\",\"America/Mexico_City\",\"America/Monterrey\",\"America/Ojinaga\",\"America/Tijuana\",\"Africa/Blantyre\",\"Indian/Maldives\",\"Indian/Mauritius\",\"Europe/Malta\",\"America/Montserrat\",\"Africa/Nouakchott\",\"America/Martinique\",\"Pacific/Saipan\",\"Asia/Macau\",\"Asia/Choibalsan\",\"Asia/Hovd\",\"Asia/Ulaanbaatar\",\"Asia/Yangon\",\"Africa/Bamako\",\"Europe/Skopje\",\"Pacific/Kwajalein\",\"Pacific/Majuro\",\"Indian/Antananarivo\",\"America/Marigot\",\"Europe/Podgorica\",\"Europe/Chisinau\",\"Europe/Monaco\",\"Africa/Casablanca\",\"Africa/Tripoli\",\"Europe/Riga\",\"Europe/Luxembourg\",\"Europe/Vilnius\",\"Africa/Maseru\",\"Africa/Monrovia\",\"Asia/Colombo\",\"Europe/Vaduz\",\"America/St_Lucia\",\"Asia/Beirut\",\"Asia/Vientiane\",\"Asia/Almaty\",\"Asia/Aqtau\",\"Asia/Aqtobe\",\"Asia/Atyrau\",\"Asia/Oral\",\"Asia/Qyzylorda\",\"America/Cayman\",\"Asia/Kuwait\",\"Asia/Seoul\",\"Asia/Pyongyang\",\"America/St_Kitts\",\"Indian/Comoro\",\"Pacific/Enderbury\",\"Pacific/Kiritimati\",\"Pacific/Tarawa\",\"Asia/Phnom_Penh\",\"Asia/Bishkek\",\"Africa/Nairobi\",\"Asia/Tokyo\",\"Asia/Amman\",\"America/Jamaica\",\"Europe/Jersey\",\"Europe/Rome\",\"Atlantic/Reykjavik\",\"Asia/Tehran\",\"Asia/Baghdad\",\"Indian/Chagos\",\"Asia/Kolkata\",\"Europe/Isle_of_Man\",\"Asia/Jerusalem\",\"Europe/Dublin\",\"Asia/Jakarta\",\"Asia/Jayapura\",\"Asia/Makassar\",\"Asia/Pontianak\",\"Europe/Budapest\",\"America/Port-au-Prince\",\"Europe/Zagreb\",\"America/Tegucigalpa\",\"Asia/Hong_Kong\",\"America/Guyana\",\"Africa/Bissau\",\"Pacific/Guam\",\"America/Guatemala\",\"Atlantic/South_Georgia\",\"Europe/Athens\",\"Africa/Malabo\",\"America/Guadeloupe\",\"Africa/Conakry\",\"Africa/Banjul\",\"America/Danmarkshavn\",\"America/Godthab\",\"America/Scoresbysund\",\"America/Thule\",\"Europe/Gibraltar\",\"Africa/Accra\",\"Europe/Guernsey\",\"America/Cayenne\",\"Asia/Tbilisi\",\"America/Grenada\",\"Europe/London\",\"Africa/Libreville\",\"Europe/Paris\",\"Atlantic/Faroe\",\"Pacific/Chuuk\",\"Pacific/Kosrae\",\"Pacific/Pohnpei\",\"Atlantic/Stanley\",\"Pacific/Fiji\",\"Europe/Helsinki\",\"Africa/Addis_Ababa\",\"Africa/Ceuta\",\"Atlantic/Canary\",\"Europe/Madrid\",\"Africa/Asmara\",\"Africa/El_Aaiun\",\"Africa/Cairo\",\"Europe/Tallinn\",\"America/Guayaquil\",\"Pacific/Galapagos\",\"Africa/Algiers\",\"America/Santo_Domingo\",\"America/Dominica\",\"Europe/Copenhagen\",\"Africa/Djibouti\",\"Europe/Berlin\",\"Europe/Busingen\",\"Europe/Prague\",\"Asia/Famagusta\",\"Asia/Nicosia\",\"Indian/Christmas\",\"America/Curacao\",\"Atlantic/Cape_Verde\",\"America/Havana\",\"America/Costa_Rica\",\"America/Bogota\",\"Asia/Shanghai\",\"Asia/Urumqi\",\"Africa/Douala\",\"America/Punta_Arenas\",\"America/Santiago\",\"Pacific/Easter\",\"Pacific/Rarotonga\",\"Africa/Abidjan\",\"Europe/Zurich\",\"Africa/Brazzaville\",\"Africa/Bangui\",\"Africa/Kinshasa\",\"Africa/Lubumbashi\",\"Indian/Cocos\",\"America/Atikokan\",\"America/Blanc-Sablon\",\"America/Cambridge_Bay\",\"America/Creston\",\"America/Dawson\",\"America/Dawson_Creek\",\"America/Edmonton\",\"America/Fort_Nelson\",\"America/Glace_Bay\",\"America/Goose_Bay\",\"America/Halifax\",\"America/Inuvik\",\"America/Iqaluit\",\"America/Moncton\",\"America/Nipigon\",\"America/Pangnirtung\",\"America/Rainy_River\",\"America/Rankin_Inlet\",\"America/Regina\",\"America/Resolute\",\"America/St_Johns\",\"America/Swift_Current\",\"America/Thunder_Bay\",\"America/Toronto\",\"America/Vancouver\",\"America/Whitehorse\",\"America/Winnipeg\",\"America/Yellowknife\",\"America/Belize\",\"Europe/Minsk\",\"Africa/Gaborone\",\"Asia/Thimphu\",\"America/Nassau\",\"America/Araguaina\",\"America/Bahia\",\"America/Belem\",\"America/Boa_Vista\",\"America/Campo_Grande\",\"America/Cuiaba\",\"America/Eirunepe\",\"America/Fortaleza\",\"America/Maceio\",\"America/Manaus\",\"America/Noronha\",\"America/Porto_Velho\",\"America/Recife\",\"America/Rio_Branco\",\"America/Santarem\",\"America/Sao_Paulo\",\"America/Kralendijk\",\"America/La_Paz\",\"Asia/Brunei\",\"Atlantic/Bermuda\",\"America/St_Barthelemy\",\"Africa/Porto-Novo\",\"Africa/Bujumbura\",\"Asia/Bahrain\",\"Europe/Sofia\",\"Africa/Ouagadougou\",\"Europe/Brussels\",\"Asia/Dhaka\",\"America/Barbados\",\"Europe/Sarajevo\",\"Asia/Baku\",\"Europe/Mariehamn\",\"America/Aruba\",\"Antarctica/Macquarie\",\"Australia/Adelaide\",\"Australia/Brisbane\",\"Australia/Broken_Hill\",\"Australia/Currie\",\"Australia/Darwin\",\"Australia/Eucla\",\"Australia/Hobart\",\"Australia/Lindeman\",\"Australia/Lord_Howe\",\"Australia/Melbourne\",\"Australia/Perth\",\"Australia/Sydney\",\"Europe/Vienna\",\"Pacific/Pago_Pago\",\"America/Argentina/Buenos_Aires\",\"America/Argentina/Catamarca\",\"America/Argentina/Cordoba\",\"America/Argentina/Jujuy\",\"America/Argentina/La_Rioja\",\"America/Argentina/Mendoza\",\"America/Argentina/Rio_Gallegos\",\"America/Argentina/Salta\",\"America/Argentina/San_Juan\",\"America/Argentina/San_Luis\",\"America/Argentina/Tucuman\",\"America/Argentina/Ushuaia\",\"Antarctica/Casey\",\"Antarctica/Davis\",\"Antarctica/DumontDUrville\",\"Antarctica/Mawson\",\"Antarctica/McMurdo\",\"Antarctica/Palmer\",\"Antarctica/Rothera\",\"Antarctica/Syowa\",\"Antarctica/Troll\",\"Antarctica/Vostok\",\"Africa/Luanda\",\"Asia/Yerevan\",\"Europe/Tirane\",\"America/Anguilla\",\"America/Antigua\",\"Asia/Kabul\",\"Asia/Dubai\",\"Europe/Andorra\",\"Africa/Asmera\",\"Africa/Timbuktu\",\"America/Argentina/ComodRivadavia\",\"America/Atka\",\"America/Buenos_Aires\",\"America/Catamarca\",\"America/Coral_Harbour\",\"America/Cordoba\",\"America/Ensenada\",\"America/Fort_Wayne\",\"America/Indianapolis\",\"America/Jujuy\",\"America/Knox_IN\",\"America/Louisville\",\"America/Mendoza\",\"America/Montreal\",\"America/Porto_Acre\",\"America/Rosario\",\"America/Santa_Isabel\",\"America/Shiprock\",\"America/Virgin\",\"Antarctica/South_Pole\",\"Asia/Ashkhabad\",\"Asia/Calcutta\",\"Asia/Chongqing\",\"Asia/Chungking\",\"Asia/Dacca\",\"Asia/Harbin\",\"Asia/Istanbul\",\"Asia/Kashgar\",\"Asia/Katmandu\",\"Asia/Macao\",\"Asia/Rangoon\",\"Asia/Saigon\",\"Asia/Tel_Aviv\",\"Asia/Thimbu\",\"Asia/Ujung_Pandang\",\"Asia/Ulan_Bator\",\"Atlantic/Faeroe\",\"Atlantic/Jan_Mayen\",\"Australia/ACT\",\"Australia/Canberra\",\"Australia/LHI\",\"Australia/North\",\"Australia/NSW\",\"Australia/Queensland\",\"Australia/South\",\"Australia/Tasmania\",\"Australia/Victoria\",\"Australia/West\",\"Australia/Yancowinna\",\"Brazil/Acre\",\"Brazil/DeNoronha\",\"Brazil/East\",\"Brazil/West\",\"Canada/Atlantic\",\"Canada/Central\",\"Canada/East-Saskatchewan\",\"Canada/Eastern\",\"Canada/Mountain\",\"Canada/Newfoundland\",\"Canada/Pacific\",\"Canada/Saskatchewan\",\"Canada/Yukon\",\"CET\",\"Chile/Continental\",\"Chile/EasterIsland\",\"CST6CDT\",\"Cuba\",\"EET\",\"Egypt\",\"Eire\",\"EST\",\"EST5EDT\",\"Etc/GMT\",\"Etc/GMT+0\",\"Etc/GMT+1\",\"Etc/GMT+10\",\"Etc/GMT+11\",\"Etc/GMT+12\",\"Etc/GMT+2\",\"Etc/GMT+3\",\"Etc/GMT+4\",\"Etc/GMT+5\",\"Etc/GMT+6\",\"Etc/GMT+7\",\"Etc/GMT+8\",\"Etc/GMT+9\",\"Etc/GMT-0\",\"Etc/GMT-1\",\"Etc/GMT-10\",\"Etc/GMT-11\",\"Etc/GMT-12\",\"Etc/GMT-13\",\"Etc/GMT-14\",\"Etc/GMT-2\",\"Etc/GMT-3\",\"Etc/GMT-4\",\"Etc/GMT-5\",\"Etc/GMT-6\",\"Etc/GMT-7\",\"Etc/GMT-8\",\"Etc/GMT-9\",\"Etc/GMT0\",\"Etc/Greenwich\",\"Etc/UCT\",\"Etc/Universal\",\"Etc/UTC\",\"Etc/Zulu\",\"Europe/Belfast\",\"Europe/Nicosia\",\"Europe/Tiraspol\",\"GB\",\"GB-Eire\",\"GMT\",\"GMT+0\",\"GMT-0\",\"GMT0\",\"Greenwich\",\"Hongkong\",\"HST\",\"Iceland\",\"Iran\",\"Israel\",\"Jamaica\",\"Japan\",\"Kwajalein\",\"Libya\",\"MET\",\"Mexico/BajaNorte\",\"Mexico/BajaSur\",\"Mexico/General\",\"MST\",\"MST7MDT\",\"Navajo\",\"NZ\",\"NZ-CHAT\",\"Pacific/Johnston\",\"Pacific/Ponape\",\"Pacific/Samoa\",\"Pacific/Truk\",\"Pacific/Yap\",\"Poland\",\"Portugal\",\"PRC\",\"PST8PDT\",\"ROC\",\"ROK\",\"Singapore\",\"Turkey\",\"UCT\",\"Universal\",\"US/Alaska\",\"US/Aleutian\",\"US/Arizona\",\"US/Central\",\"US/East-Indiana\",\"US/Eastern\",\"US/Hawaii\",\"US/Indiana-Starke\",\"US/Michigan\",\"US/Mountain\",\"US/Pacific\",\"US/Pacific-New\",\"US/Samoa\",\"UTC\",\"W-SU\",\"WET\",\"Zulu\"];\nmsg.options = options.sort();\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 1010, - "y": 2320, + "x": 1090, + "y": 2340, "wires": [ [ "9bb86c18.f0deb" @@ -3030,8 +2885,8 @@ ], "payload": "", "topic": "", - "x": 1462, - "y": 2314, + "x": 1542, + "y": 2334, "wires": [ [ "a6b43763.a12aa8", @@ -3039,27 +2894,6 @@ ] ] }, - { - "id": "f49b2576.99e1d8", - "type": "inject", - "z": "a564595f.642818", - "name": "", - "topic": "", - "payload": "", - "payloadType": "str", - "repeat": "", - "crontab": "", - "once": true, - "onceDelay": "2", - "x": 455, - "y": 2317, - "wires": [ - [ - "9fa076ac.17f568", - "a1357f50.ee57a" - ] - ] - }, { "id": "a1357f50.ee57a", "type": "file in", @@ -3068,8 +2902,8 @@ "filename": "/etc/timezone", "format": "utf8", "sendError": true, - "x": 1016, - "y": 2413, + "x": 1096, + "y": 2433, "wires": [ [ "6547f655.0621e8" @@ -3084,8 +2918,8 @@ "func": "msg.payload = msg.payload.replace(/(\\r\\n|\\n|\\r)/gm,\"\");\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 1223, - "y": 2412, + "x": 1303, + "y": 2432, "wires": [ [ "9bb86c18.f0deb" @@ -3109,8 +2943,8 @@ "payload": "tz", "payloadType": "flow", "topic": "", - "x": 1019, - "y": 2478, + "x": 1099, + "y": 2498, "wires": [ [ "c542fa3.77cb308" @@ -3128,8 +2962,8 @@ "timer": "", "oldrc": false, "name": "set timezone sym link", - "x": 1240, - "y": 2480, + "x": 1320, + "y": 2500, "wires": [ [], [], @@ -3150,8 +2984,8 @@ "cancel": "", "topic": "", "name": "", - "x": 2010, - "y": 2500, + "x": 2090, + "y": 2520, "wires": [] }, { @@ -3180,8 +3014,8 @@ "from": "", "to": "", "reg": false, - "x": 1820, - "y": 2460, + "x": 1900, + "y": 2480, "wires": [ [ "8ee3b7e3.1833a8", @@ -3201,8 +3035,8 @@ "label": "", "format": "{{msg.payload}}", "layout": "col-center", - "x": 1970, - "y": 2440, + "x": 2050, + "y": 2460, "wires": [] }, { @@ -3219,8 +3053,8 @@ "mode": "text", "delay": "0", "topic": "", - "x": 1253.4999237060547, - "y": 1392.9999895095825, + "x": 1333.4999237060547, + "y": 1412.9999895095825, "wires": [ [ "e899ac8f.ec903", @@ -3248,8 +3082,8 @@ "from": "", "to": "", "reg": false, - "x": 1632.9999237060547, - "y": 1433.9999895095825, + "x": 1712.9999237060547, + "y": 1453.9999895095825, "wires": [ [ "dc8e0ec5.550d", @@ -3268,8 +3102,8 @@ "timer": "", "oldrc": false, "name": "hostname", - "x": 720, - "y": 2600, + "x": 800, + "y": 2620, "wires": [ [ "deb9c4fc.20c098" @@ -3290,8 +3124,8 @@ "crontab": "", "once": true, "onceDelay": "10", - "x": 531, - "y": 2599.5, + "x": 611, + "y": 2619.5, "wires": [ [ "7496a044.dd719" @@ -3310,8 +3144,8 @@ "label": "Tilt Pi Local Address", "format": "{{msg.payload}}", "layout": "col-center", - "x": 1268, - "y": 2605, + "x": 1348, + "y": 2625, "wires": [] }, { @@ -3336,8 +3170,8 @@ "offvalueType": "str", "officon": "", "offcolor": "", - "x": 2314.0002632141113, - "y": 2390.0005922317505, + "x": 2394.0002632141113, + "y": 2410.0005922317505, "wires": [ [ "b58e5805.5d5928" @@ -3352,8 +3186,8 @@ "func": "if (msg.payload === \"°C\"){\nflow.set('tempUnits',[-32,0.555]);\nflow.set('displayUnits',\"°C\");\nreturn msg;\n}\nif (msg.payload === \"°F\"){\nflow.set('tempUnits',[0,1]);\nflow.set('displayUnits',\"°F\");\nreturn msg;\n}", "outputs": "1", "noerr": 0, - "x": 2567.99991607666, - "y": 2355.0002250671387, + "x": 2647.99991607666, + "y": 2375.0002250671387, "wires": [ [ "5312bf4.09fd44", @@ -3371,8 +3205,8 @@ "useSpawn": false, "timer": "", "name": "Shutdown", - "x": 810, - "y": 2820, + "x": 890, + "y": 2840, "wires": [ [ "f2bdbc36.5644d" @@ -3398,8 +3232,8 @@ "payload": "now", "payloadType": "str", "topic": "", - "x": 610, - "y": 2840, + "x": 690, + "y": 2860, "wires": [ [ "5a69b142.f96b6" @@ -3418,8 +3252,8 @@ "cancel": "", "topic": "", "name": "", - "x": 1070, - "y": 2820, + "x": 1150, + "y": 2840, "wires": [] }, { @@ -3430,8 +3264,8 @@ "func": "//prevent excessive cloud logs\nmsg.payload = '';\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 1282.9999237060547, - "y": 1552.9999895095825, + "x": 1362.9999237060547, + "y": 1572.9999895095825, "wires": [ [ "1dc3fc9e.e1f193" @@ -3453,8 +3287,8 @@ "randomLast": "5", "randomUnits": "seconds", "drop": false, - "x": 1388.9999237060547, - "y": 1462.9999895095825, + "x": 1468.9999237060547, + "y": 1482.9999895095825, "wires": [ [ "510190df.5876c" @@ -3472,8 +3306,8 @@ "timer": "", "oldrc": false, "name": "Download Update from GitHub", - "x": 1030, - "y": 2720, + "x": 1110, + "y": 2740, "wires": [ [], [], @@ -3500,8 +3334,8 @@ "payload": "", "payloadType": "str", "topic": "", - "x": 630, - "y": 2720, + "x": 710, + "y": 2740, "wires": [ [ "35b035bf.c8c96a" @@ -3516,8 +3350,8 @@ "func": "if (msg.payload.code === 0){\n return msg;\n}\n", "outputs": 1, "noerr": 0, - "x": 1280, - "y": 2720, + "x": 1360, + "y": 2740, "wires": [ [ "b0fab2cd.d77d4" @@ -3535,42 +3369,14 @@ "timer": "", "oldrc": false, "name": "Update App", - "x": 1450, - "y": 2720, + "x": 1530, + "y": 2740, "wires": [ [], [], [] ] }, - { - "id": "88f0f33d.110ab", - "type": "function", - "z": "a564595f.642818", - "name": "Set Uncal Calibration Array", - "func": "var color = flow.get('colordropdownSelect')||\"\";\nvar uncalArray = msg.payload.split(\",\");\nflow.set('uncalSGpoints-' + color,uncalArray);", - "outputs": 1, - "noerr": 0, - "x": 3127.9999237060547, - "y": 1773.9999895095825, - "wires": [ - [] - ] - }, - { - "id": "b36a946.3813e68", - "type": "function", - "z": "a564595f.642818", - "name": "Set Actual Calibration Array", - "func": "var color = flow.get('colordropdownSelect')||\"\";\nvar uncalArray = msg.payload.split(\",\");\nflow.set('actualSGpoints-' + color,uncalArray);", - "outputs": 1, - "noerr": 0, - "x": 3126.4999237060547, - "y": 1833.9999895095825, - "wires": [ - [] - ] - }, { "id": "640f9404.72d27c", "type": "file in", @@ -3579,8 +3385,8 @@ "filename": "", "format": "utf8", "sendError": false, - "x": 2920.5, - "y": 21, + "x": 3000.5, + "y": 41, "wires": [ [ "68ec71d.2dec29" @@ -3595,8 +3401,8 @@ "func": "flow.set('cloudURL',[\"https://script.google.com/macros/s/AKfycbwNXh6rEWoULd0vxWxDylG_PJwQwe0dn5hdtSkuC4k3D9AXBSA/exec\",true]);\nflow.set(msg.payload.Color + \"-Comment\",msg.payload.Comment);\nflow.set('logCloudDataCheck',true);\nflow.set('loggingInterval',15);\nflow.set(msg.payload.Color + \"-Beer\",msg.payload.Beer);\n//initialize local logging\nflow.set('logLocalDataCheck',true);\nflow.set('localloggingInterval',15);\nmsg2 = {};\nmsg2.payload = \"Time,Timepoint,Temp,SG,Beer,Color,Comment,RSSI,Uptime\";\n//post now\nflow.set('lastpost-' + msg.payload.Color,0);\nreturn [msg,msg2];", "outputs": "2", "noerr": 0, - "x": 3026.5, - "y": 132, + "x": 3106.5, + "y": 152, "wires": [ [ "cdf7a5f1.e44358" @@ -3617,8 +3423,8 @@ "repeat": "", "crontab": "", "once": true, - "x": 2314, - "y": 20, + "x": 2394, + "y": 40, "wires": [ [ "5006138a.18932c" @@ -3636,8 +3442,8 @@ "timer": "", "oldrc": false, "name": "Remove Config File", - "x": 3460, - "y": 27.5, + "x": 3540, + "y": 47.5, "wires": [ [], [], @@ -3652,8 +3458,8 @@ "func": "//get custom cloud URL if previously set\nvar color = flow.get('colordropdownSelect');\nif (msg.payload === true){\n flow.set(\"cloudURL\",[\"https://script.google.com/macros/s/AKfycbwNXh6rEWoULd0vxWxDylG_PJwQwe0dn5hdtSkuC4k3D9AXBSA/exec\",true]);\n msg.payload = flow.get(\"cloudURL\")[0]; \n}\nif (msg.payload === false){\n flow.set(\"cloudURL\",[\"https://script.google.com/macros/s/AKfycbwNXh6rEWoULd0vxWxDylG_PJwQwe0dn5hdtSkuC4k3D9AXBSA/exec\",false]);\n msg.payload = flow.get(\"cloudURL-\" + color)||\"Not set for \" + color;\n }\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 1650, - "y": 1280, + "x": 1730, + "y": 1300, "wires": [ [ "edb75c90.8414" @@ -3672,8 +3478,8 @@ "cancel": "", "topic": "", "name": "Cloud URL Status", - "x": 2370, - "y": 1280, + "x": 2450, + "y": 1300, "wires": [] }, { @@ -3685,8 +3491,8 @@ "method": "get", "upload": false, "swaggerDoc": "", - "x": 3980, - "y": 900, + "x": 4060, + "y": 920, "wires": [ [ "dc9ecd32.25037" @@ -3702,8 +3508,8 @@ "format": "utf8", "chunk": false, "sendError": false, - "x": 4334.21842956543, - "y": 905.031304359436, + "x": 4414.21842956543, + "y": 925.031304359436, "wires": [ [ "7b788221.059a2c" @@ -3719,8 +3525,8 @@ "headers": { "Access-Control-Allow-Origin": "*" }, - "x": 4626.111217498779, - "y": 905.0694370269775, + "x": 4706.111217498779, + "y": 925.0694370269775, "wires": [] }, { @@ -3732,8 +3538,8 @@ "format": "utf8", "chunk": false, "sendError": false, - "x": 1220, - "y": 260, + "x": 1300, + "y": 280, "wires": [ [ "543d2dd7.2fe974" @@ -3746,8 +3552,8 @@ "z": "a564595f.642818", "name": "", "pretty": false, - "x": 1350, - "y": 260, + "x": 1430, + "y": 280, "wires": [ [ "a2f14292.5b0f3", @@ -3763,8 +3569,8 @@ "func": "if (msg.payload !== undefined){\nflow.set(msg.payload.Color + '-Beer',msg.payload.Beer);\nflow.set('actualSGpoints-' + msg.payload.Color,msg.payload.actualSGPoints);\nflow.set('uncalSGpoints-' + msg.payload.Color,msg.payload.unCalSGPoints);\nflow.set('actualTemppoints-' + msg.payload.Color,msg.payload.actualTempPoints);\nflow.set('uncalTemppoints-' + msg.payload.Color,msg.payload.unCalTempPoints);\n//node.warn(msg.payload.defaultCloudURL);\nflow.set('cloudURL-' + msg.payload.Color,msg.payload.customcloudURL);\n}\n//after last tilt (pink) settings restored, start scanning\nelse if (msg.filename === 0){//ls command completed\n msg.payload = \"python3 -u -m aioblescan -T\";\n return msg;\n }", "outputs": "1", "noerr": 0, - "x": 1500, - "y": 300, + "x": 1580, + "y": 320, "wires": [ [ "9d251f5a.10bdc" @@ -3779,8 +3585,8 @@ "func": "//only updates if custom Cloud URLs are in use\nvar check = flow.get('cloudURL')[1]||false;\nif (check === true){\n}else{\n return msg;\n}\n", "outputs": 1, "noerr": 0, - "x": 1060, - "y": 1260, + "x": 1140, + "y": 1280, "wires": [ [ "b1836d66.f976c" @@ -3799,8 +3605,8 @@ "cancel": "", "topic": "", "name": "Beer Name Status", - "x": 4475.181529998779, - "y": 507.5486431121826, + "x": 4555.181529998779, + "y": 527.5486431121826, "wires": [] }, { @@ -3812,8 +3618,8 @@ "appendNewline": false, "createDir": false, "overwriteFile": "true", - "x": 1769.0565185546875, - "y": 20, + "x": 1849.0565185546875, + "y": 40, "wires": [ [] ] @@ -3826,8 +3632,8 @@ "func": "if (msg.req.params.color === undefined){\n msg.req.params.color = \"global\";\n}\nmsg.filename = \"/home/pi/\" + msg.req.params.color;\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 4169.642906188965, - "y": 902.8828468322754, + "x": 4249.642906188965, + "y": 922.8828468322754, "wires": [ [ "bdb5caad.d3dba8" @@ -3849,8 +3655,8 @@ "randomLast": "5", "randomUnits": "seconds", "drop": true, - "x": 1520.746826171875, - "y": 32.618064880371094, + "x": 1600.746826171875, + "y": 52.618064880371094, "wires": [ [ "c6fd016d.ab4a7", @@ -3864,8 +3670,8 @@ "z": "a564595f.642818", "name": "", "pretty": false, - "x": 4472.655807495117, - "y": 904.7291736602783, + "x": 4552.655807495117, + "y": 924.7291736602783, "wires": [ [ "60f15c0d.04a0b4" @@ -3880,8 +3686,8 @@ "func": "//set default dropdown item if undefined\nmsg.options = msg.payload||[\"NONE\"];\nmsg.payload = flow.get('colordropdownSelect')||msg.options[0];\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 910, - "y": 860, + "x": 990, + "y": 880, "wires": [ [ "93d9202c.d9c1e", @@ -3890,356 +3696,133 @@ ] }, { - "id": "f0097da4.edc54", - "type": "function", - "z": "a564595f.642818", - "name": "set Actual Temp Value", - "func": "var value = Number(msg.payload);\nflow.set('actualTemppoint',value.toFixed(1));\nmsg.payload = flow.get('colordropdownSelect');\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 2138.4999237060547, - "y": 1950.9999895095825, - "wires": [ - [ - "a9cf2c6b.4d7f9" - ] - ] - }, - { - "id": "a9cf2c6b.4d7f9", + "id": "d6de2020.56974", "type": "function", "z": "a564595f.642818", - "name": "Add Temp Cal Point", - "func": "var color = msg.payload;\nvar uncalTempcalPoint = flow.get('uncalTemppoint')||0;\nvar actualTempcalPoint = flow.get('actualTemppoint')||0;\nvar uncalpointsArray = flow.get('uncalTemppoints-' + color)||[];\nvar actualpointsArray = flow.get('actualTemppoints-' + color)||[];\nuncalpointsArray.push(uncalTempcalPoint);\nuncalpointsArray.sort(function(a, b){return a-b;});\nflow.set('uncalTemppoints-' + color,uncalpointsArray);\nactualpointsArray.push(actualTempcalPoint);\nactualpointsArray.sort(function(a, b){return a-b;});\nflow.set('actualTemppoints-' + color,actualpointsArray);\nvar msg1 = {payload:uncalpointsArray.toString()};\nvar msg2 = {payload:actualpointsArray.toString()};\nreturn [msg1, msg2];", - "outputs": "2", + "name": "Get Current Temp", + "func": "if (msg.payload == \"disabled\") {\n context.set(\"autoUpdate\", \"disabled\");\n}\nif (msg.payload == \"enabled\") {\n context.set(\"autoUpdate\", \"enabled\");\n}\nvar autoUpdate = context.get(\"autoUpdate\")||\"enabled\";\nif (autoUpdate == \"enabled\"){\nvar options = flow.get('options')||[];\nvar color = msg.payload;\nvar displayNumber = options.indexOf(color) + 1;\nmsg.payload = flow.get(\"storage-\" + displayNumber.toString());\nif (msg.payload !== undefined){\nvar msg1 = {};\nvar msg2 = {};\nmsg1.payload = Number(msg.payload.displayuncalTemp).toFixed(1);\nmsg2.payload = Number(msg.payload.displayTemp).toFixed(1);\nreturn [msg1,msg2];\n}\n}", + "outputs": 2, "noerr": 0, - "x": 2452.9999237060547, - "y": 1956.9999895095825, + "x": 2150, + "y": 1580, "wires": [ [ - "10bda9c0.3dcf66" + "67b168fa.e90078", + "ee2ae6f4.9089f8" ], [ - "d521fc1b.3653a" - ] - ] - }, - { - "id": "17e6c4c8.0d7e1b", - "type": "ui_button", - "z": "a564595f.642818", - "name": "", - "group": "c12bcb12.dbd0d8", - "order": 5, - "width": 0, - "height": 0, - "passthru": false, - "label": "Clear Calibration", - "color": "", - "bgcolor": "", - "icon": "", - "payload": "colordropdownSelect", - "payloadType": "flow", - "topic": "", - "x": 2210.9999237060547, - "y": 2076.9999895095825, - "wires": [ - [ - "721c929.10edb6c" + "1381f934.df5b27", + "37e5d681.345a7a" ] ] }, { - "id": "721c929.10edb6c", + "id": "67b168fa.e90078", "type": "function", "z": "a564595f.642818", - "name": "clear calibration", - "func": "var color = msg.payload;\nvar uncalpointsArray = flow.set('uncalTemppoints-' + color,[]);\nvar actualpointsArray = flow.set('actualTemppoints-' + color,[]);\nmsg.payload = \"\";\nreturn msg;", + "name": "set Pre-cal Temp Value", + "func": "flow.set('uncalTemppoint',Number(msg.payload).toFixed(1));", "outputs": 1, "noerr": 0, - "x": 2422.9999237060547, - "y": 2077.9999895095825, + "x": 2880, + "y": 1600, "wires": [ - [ - "10bda9c0.3dcf66", - "d521fc1b.3653a" - ] + [] ] }, { - "id": "5933654f.572e0c", + "id": "15afce7c.5604d2", "type": "function", "z": "a564595f.642818", - "name": "update display", - "func": "var color = flow.get('colordropdownSelect')||\"\";\nvar uncalpointsArray = flow.get('uncalTemppoints-' + color)||\"\";\nvar actualpointsArray = flow.get('actualTemppoints-' + color)||\"\";\nvar msg1 = {payload:uncalpointsArray};\nvar msg2 = {payload:actualpointsArray};\nreturn [msg1, msg2];", - "outputs": "2", + "name": "Change Ferm Units", + "func": "if (msg.payload === \"sg\"){\nflow.set('fermdisplayUnits',\"\");\nnode.send([{'payload':'sg'},{'payload':false},{'payload':false}]);\n}\nif (msg.payload === \"plato\"){\nflow.set('fermdisplayUnits',\"°P\");\nnode.send([{'payload':false},{'payload':'plato'},{'payload':false}]);\n}\nif (msg.payload === \"brix\"){\nflow.set('fermdisplayUnits',\"°Bx\");\nnode.send([{'payload':false},{'payload':false},{'payload':'brix'}]);\n}", + "outputs": "3", "noerr": 0, - "x": 2221.9999237060547, - "y": 2013.9999895095825, + "x": 2684, + "y": 2543.0002098083496, "wires": [ [ - "10bda9c0.3dcf66" + "d66a9036.7565" + ], + [ + "88a56bea.b66268" ], [ - "d521fc1b.3653a" + "3c18b104.de8f2e" ] ] }, { - "id": "4b7531fb.46829", - "type": "ui_text_input", + "id": "88a56bea.b66268", + "type": "ui_switch", "z": "a564595f.642818", "name": "", - "label": "Enter Actual (known) point:", - "group": "c12bcb12.dbd0d8", - "order": 2, + "label": "Plato", + "group": "b0619070.ac95d", + "order": 4, "width": 0, "height": 0, - "passthru": true, - "mode": "text", - "delay": "0", + "passthru": false, + "decouple": "true", "topic": "", - "x": 1827.4999237060547, - "y": 1947.9999895095825, + "style": "", + "onvalue": "plato", + "onvalueType": "str", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "x": 2505.000690460205, + "y": 2632.5001878738403, "wires": [ [ - "f0097da4.edc54" + "15afce7c.5604d2" ] ] }, { - "id": "10bda9c0.3dcf66", - "type": "ui_text_input", + "id": "3c18b104.de8f2e", + "type": "ui_switch", "z": "a564595f.642818", "name": "", - "label": "Edit Pre-calibrated (Tilt) Points", - "tooltip": "", - "group": "c12bcb12.dbd0d8", - "order": 3, + "label": "Brix", + "group": "b0619070.ac95d", + "order": 5, "width": 0, "height": 0, "passthru": false, - "mode": "text", - "delay": "0", + "decouple": "true", "topic": "", - "x": 2794.4999237060547, - "y": 1996.9999895095825, + "style": "", + "onvalue": "brix", + "onvalueType": "str", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "x": 2509.750312805176, + "y": 2719.75013923645, "wires": [ [ - "a5ca25c7.fd8c98" + "15afce7c.5604d2" ] ] }, { - "id": "d521fc1b.3653a", - "type": "ui_text_input", - "z": "a564595f.642818", - "name": "", - "label": " Edit Actual Points", - "group": "c12bcb12.dbd0d8", - "order": 4, - "width": 0, - "height": 0, - "passthru": false, - "mode": "text", - "delay": "0", - "topic": "", - "x": 2766.4999237060547, - "y": 2063.9999895095825, - "wires": [ - [ - "19ca9195.29599e" - ] - ] - }, - { - "id": "a5ca25c7.fd8c98", - "type": "function", - "z": "a564595f.642818", - "name": "Set Uncal Calibration Array", - "func": "var color = flow.get('colordropdownSelect')||\"\";\nvar uncalArray = msg.payload.split(\",\");\nflow.set('uncalTemppoints-' + color,uncalArray);", - "outputs": 1, - "noerr": 0, - "x": 3127.9999237060547, - "y": 1993.9999895095825, - "wires": [ - [] - ] - }, - { - "id": "19ca9195.29599e", - "type": "function", - "z": "a564595f.642818", - "name": "Set Actual Calibration Array", - "func": "var color = flow.get('colordropdownSelect')||\"\";\nvar uncalArray = msg.payload.split(\",\");\nflow.set('actualTemppoints-' + color,uncalArray);", - "outputs": 1, - "noerr": 0, - "x": 3126.4999237060547, - "y": 2053.9999895095825, - "wires": [ - [] - ] - }, - { - "id": "d6de2020.56974", - "type": "function", - "z": "a564595f.642818", - "name": "Get Current Temp", - "func": "var options = flow.get('options')||[];\nvar color = msg.payload;\nvar displayNumber = options.indexOf(color) + 1;\nmsg.payload = flow.get(\"storage-\" + displayNumber.toString());\nif (msg.payload !== undefined){\nreturn msg;\n}", - "outputs": 1, - "noerr": 0, - "x": 2088.4999237060547, - "y": 1510.9999895095825, - "wires": [ - [ - "854dec23.fee5f", - "67b168fa.e90078", - "675094a4.49a26c" - ] - ] - }, - { - "id": "854dec23.fee5f", - "type": "ui_text", - "z": "a564595f.642818", - "group": "c12bcb12.dbd0d8", - "order": 1, - "width": 0, - "height": 0, - "name": "", - "label": "Pre-calibrated Temperature:", - "format": "{{msg.payload.displayuncalTemp | number:1}}{{msg.payload.tempunits}}", - "layout": "row-spread", - "x": 2618.4999237060547, - "y": 1530.9999895095825, - "wires": [] - }, - { - "id": "67b168fa.e90078", - "type": "function", - "z": "a564595f.642818", - "name": "set Pre-cal Temp Value", - "func": "flow.set('uncalTemppoint',Number(msg.payload.displayuncalTemp).toFixed(1));", - "outputs": 1, - "noerr": 0, - "x": 2598.4999237060547, - "y": 1590.9999895095825, - "wires": [ - [] - ] - }, - { - "id": "15afce7c.5604d2", - "type": "function", - "z": "a564595f.642818", - "name": "Change Ferm Units", - "func": "if (msg.payload === \"sg\"){\nflow.set('fermdisplayUnits',\"\");\nnode.send([{'payload':'sg'},{'payload':false},{'payload':false}]);\n}\nif (msg.payload === \"plato\"){\nflow.set('fermdisplayUnits',\"°P\");\nnode.send([{'payload':false},{'payload':'plato'},{'payload':false}]);\n}\nif (msg.payload === \"brix\"){\nflow.set('fermdisplayUnits',\"°Bx\");\nnode.send([{'payload':false},{'payload':false},{'payload':'brix'}]);\n}", - "outputs": "3", - "noerr": 0, - "x": 2604, - "y": 2523.0002098083496, - "wires": [ - [ - "d66a9036.7565" - ], - [ - "88a56bea.b66268" - ], - [ - "3c18b104.de8f2e" - ] - ] - }, - { - "id": "88a56bea.b66268", - "type": "ui_switch", - "z": "a564595f.642818", - "name": "", - "label": "Plato", - "group": "b0619070.ac95d", - "order": 4, - "width": 0, - "height": 0, - "passthru": false, - "decouple": "true", - "topic": "", - "style": "", - "onvalue": "plato", - "onvalueType": "str", - "onicon": "", - "oncolor": "", - "offvalue": "false", - "offvalueType": "bool", - "officon": "", - "offcolor": "", - "x": 2425.000690460205, - "y": 2612.5001878738403, - "wires": [ - [ - "15afce7c.5604d2" - ] - ] - }, - { - "id": "3c18b104.de8f2e", - "type": "ui_switch", - "z": "a564595f.642818", - "name": "", - "label": "Brix", - "group": "b0619070.ac95d", - "order": 5, - "width": 0, - "height": 0, - "passthru": false, - "decouple": "true", - "topic": "", - "style": "", - "onvalue": "brix", - "onvalueType": "str", - "onicon": "", - "oncolor": "", - "offvalue": "false", - "offvalueType": "bool", - "officon": "", - "offcolor": "", - "x": 2429.750312805176, - "y": 2699.75013923645, - "wires": [ - [ - "15afce7c.5604d2" - ] - ] - }, - { - "id": "2bb152f1.d1cbee", - "type": "inject", - "z": "a564595f.642818", - "name": "Local Logging Interval", - "topic": "", - "payload": "localloggingInterval", - "payloadType": "flow", - "repeat": "15", - "crontab": "", - "once": false, - "x": 1855.295280456543, - "y": 1571.0105066299438, - "wires": [ - [ - "7b1370e2.6e8c9" - ] - ] - }, - { - "id": "c0f36d.ab686c9", - "type": "file in", + "id": "c0f36d.ab686c9", + "type": "file in", "z": "a564595f.642818", "name": "", "filename": "/home/pi/global.json", "format": "utf8", "chunk": false, "sendError": false, - "x": 580, - "y": 380, + "x": 660, + "y": 400, "wires": [ [ "aa94ced8.4cb66" @@ -4252,8 +3835,8 @@ "z": "a564595f.642818", "name": "", "pretty": false, - "x": 930, - "y": 380, + "x": 1010, + "y": 400, "wires": [ [ "59df1198.a2519" @@ -4268,8 +3851,8 @@ "func": "flow.set('logCloudDataCheck',msg.payload.logCloudDataCheck);\nnode.send([null,{'payload':msg.payload.logCloudDataCheck},null]);\nflow.set('logLocalDataCheck',msg.payload.logLocalDataCheck);\nnode.send([null,null,{'payload':msg.payload.logLocalDataCheck}]);\nflow.set('localloggingInterval',msg.payload.localloggingInterval);\nflow.set('loggingInterval',msg.payload.loggingInterval);\nflow.set('cloudURL',msg.payload.defaultcloudURL);\nnode.send([{'payload':msg.payload.defaultcloudURL[1]},null,null]);\nflow.set('fermdisplayUnits',msg.payload.fermunits);\nflow.set('displayUnits',msg.payload.tempunits);\nflow.set('minRSSI',msg.payload.minRSSI);\nflow.set('IDbyMAC',msg.payload.IDbyMAC);\nflow.set('alphaSG', msg.payload.alphaSG||100);\nflow.set('alphaTemp', msg.payload.alphaTemp||100);\nflow.set('numberSamples', msg.payload.numberSamples||0.5);\nflow.set('smoothSwitch', msg.payload.smoothSwitch||false);\n//return msg;", "outputs": "3", "noerr": 0, - "x": 1080, - "y": 380, + "x": 1160, + "y": 400, "wires": [ [ "b1836d66.f976c" @@ -4291,8 +3874,8 @@ "appendNewline": false, "createDir": false, "overwriteFile": "true", - "x": 1758.239501953125, - "y": 68.01043319702148, + "x": 1838.239501953125, + "y": 88.01043319702148, "wires": [ [] ] @@ -4306,8 +3889,8 @@ "method": "get", "upload": false, "swaggerDoc": "", - "x": 3966.9335861206055, - "y": 965.8784227371216, + "x": 4046.9335861206055, + "y": 985.8784227371216, "wires": [ [ "dc9ecd32.25037" @@ -4336,8 +3919,8 @@ "offvalueType": "bool", "officon": "", "offcolor": "", - "x": 2532.688522338867, - "y": 2422.262928009033, + "x": 2612.688522338867, + "y": 2442.262928009033, "wires": [ [ "15afce7c.5604d2" @@ -4366,8 +3949,8 @@ "offvalueType": "str", "officon": "", "offcolor": "", - "x": 2320.3509521484375, - "y": 2316.010766029358, + "x": 2400.3509521484375, + "y": 2336.010766029358, "wires": [ [ "b58e5805.5d5928" @@ -4387,8 +3970,8 @@ "storeOutMessages": true, "fwdInMessages": true, "templateScope": "local", - "x": 3100, - "y": 420, + "x": 3180, + "y": 440, "wires": [ [] ] @@ -4405,8 +3988,8 @@ "crontab": "", "once": true, "onceDelay": "2", - "x": 1910, - "y": 2360, + "x": 1990, + "y": 2380, "wires": [ [ "fd49eb70.32ff38" @@ -4425,8 +4008,8 @@ "crontab": "", "once": true, "onceDelay": "2", - "x": 2050, - "y": 2640, + "x": 2130, + "y": 2660, "wires": [ [ "3c9890f9.04d5f" @@ -4441,8 +4024,8 @@ "func": "msg.payload = flow.get(msg.payload);\nif (msg.payload === \"\"){\n msg.payload = \"sg\";\n}\nif (msg.payload === \"°P\"){\n msg.payload = \"plato\";\n}\nif (msg.payload === \"°Bx\"){\n msg.payload = \"brix\";\n}\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 2239.6248779296875, - "y": 2631.4583740234375, + "x": 2319.6248779296875, + "y": 2651.4583740234375, "wires": [ [ "88a56bea.b66268", @@ -4459,8 +4042,8 @@ "func": "var previous = context.get('watchedData-' + msg.payload.Color)||\"\";\n//changes in settings/measurements below trigger a backup\nvar current = \nmsg.payload.Beer + \nmsg.payload.unCalSGPoints +\nmsg.payload.actualSGPoints +\nmsg.payload.actualTempPoints +\nmsg.payload.unCalTempPoints +\nmsg.payload.fermunits +\nmsg.payload.tempunits +\nmsg.payload.defaultcloudURL +\nmsg.payload.customcloudURL +\nmsg.payload.logCloudDataCheck +\nmsg.payload.logLocalDataCheck +\nmsg.payload.localloggingInterval +\nmsg.payload.loggingInterval +\nmsg.payload.minRSSI +\nmsg.payload.IDbyMAC +\nmsg.payload.alphaSG +\nmsg.payload.alphaTemp +\nmsg.payload.numberSamples +\nmsg.payload.smoothSwitch;\nif (current !== previous){\n //node.warn(current);\n //node.warn(previous);\n context.set('watchedData-' + msg.payload.Color,current);\n return msg;\n}", "outputs": 1, "noerr": 0, - "x": 1314.8472900390625, - "y": 35.68404006958008, + "x": 1394.8472900390625, + "y": 55.68404006958008, "wires": [ [ "6a77b965.400cc8" @@ -4482,8 +4065,8 @@ "min": "-105", "max": "-35", "step": 1, - "x": 890, - "y": 2920, + "x": 970, + "y": 2940, "wires": [ [ "99ac3bca.7a1868" @@ -4509,8 +4092,8 @@ "from": "", "to": "", "reg": false, - "x": 1070, - "y": 2920, + "x": 1150, + "y": 2940, "wires": [ [ "3505363e.8a498a" @@ -4529,8 +4112,8 @@ "label": "Minimum RSSI in dBm", "format": "{{msg.payload}}", "layout": "row-spread", - "x": 1300, - "y": 2920, + "x": 1380, + "y": 2940, "wires": [] }, { @@ -4541,8 +4124,8 @@ "func": "var previous = context.get('data-' + msg.topic)||[];\nvar currentArray = msg.payload.split(\",\");\nvar current = currentArray[2] + currentArray[3] + currentArray[4] + currentArray[6];\nvar time = context.get('time-' + msg.topic)||Date.now();\n//node.warn(current);\n//node.warn(Date.now() - time);\nif (previous !== current || Date.now() - time > 900000 ){\n context.set('time-' + msg.topic,Date.now());\n context.set('data-' + msg.topic,current);\n //only clear comment if cloud logging not checked\n if (!flow.get('logCloudDataCheck')){\n flow.set(msg.topic + \"-Comment\",\"\");\n }\n return msg;\n}\n\n", "outputs": 1, "noerr": 0, - "x": 3280.96915435791, - "y": 318.01389932632446, + "x": 3360.96915435791, + "y": 338.01389932632446, "wires": [ [ "2f5685a6.76e34a" @@ -4556,8 +4139,8 @@ "name": "watch for USB drive", "files": "/dev", "recursive": "", - "x": 495, - "y": 3090.0626363754272, + "x": 575, + "y": 3110.0626363754272, "wires": [ [ "bc55cff6.44c8d" @@ -4581,8 +4164,8 @@ ], "checkall": "false", "outputs": 1, - "x": 686.5242309570312, - "y": 3032.2256088256836, + "x": 766.5242309570312, + "y": 3052.2256088256836, "wires": [ [ "27555620.4af91a" @@ -4600,8 +4183,8 @@ "timer": "", "oldrc": false, "name": "mount usb drive", - "x": 1215.6322784423828, - "y": 3093.7571334838867, + "x": 1295.6322784423828, + "y": 3113.7571334838867, "wires": [ [], [ @@ -4623,8 +4206,8 @@ "timer": "", "oldrc": false, "name": "", - "x": 1813.8790435791016, - "y": 3089.706090927124, + "x": 1893.8790435791016, + "y": 3109.706090927124, "wires": [ [], [ @@ -4643,8 +4226,8 @@ "func": "var device = msg.payload;\nmsg.payload = \"sudo mount -o uid=pi,gid=pi \" + device.substring(0,8) + \"1 /mnt/usb\";\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 1097.4063987731934, - "y": 3028.469259262085, + "x": 1177.4063987731934, + "y": 3048.469259262085, "wires": [ [ "32967fe2.78f" @@ -4659,8 +4242,8 @@ "scope": [ "2836e0e1.4ea9c" ], - "x": 3594.517433166504, - "y": 184.9272117614746, + "x": 3674.517433166504, + "y": 204.9272117614746, "wires": [ [ "ffdc5060.780ca" @@ -4678,8 +4261,8 @@ "timer": "", "oldrc": false, "name": "", - "x": 1513.684310913086, - "y": 3089.6776008605957, + "x": 1593.684310913086, + "y": 3109.6776008605957, "wires": [ [], [ @@ -4698,8 +4281,8 @@ "func": "if (msg.payload.code === 0){\n return msg;\n}\n", "outputs": 1, "noerr": 0, - "x": 1326.4617309570312, - "y": 3194.011266708374, + "x": 1406.4617309570312, + "y": 3214.011266708374, "wires": [ [ "c10d9b6d.0b1098" @@ -4714,8 +4297,8 @@ "func": "if (msg.payload.code === 0){\n return msg;\n}\n", "outputs": 1, "noerr": 0, - "x": 1706.1284408569336, - "y": 3169.010994911194, + "x": 1786.1284408569336, + "y": 3189.010994911194, "wires": [ [ "c83e4803.8db528" @@ -4730,8 +4313,8 @@ "func": "node.send({'payload':'sudo chown -R pi:pi /mnt/usb'});\nnode.send({'payload':'sudo chmod -R 775 /mnt/usb'});\nnode.send({'payload':'sudo setfacl -Rdm g:pi:rwx /mnt/usb'});\nnode.send({'payload':'sudo setfacl -Rm g:pi:rwx /mnt/usb'});", "outputs": 1, "noerr": 0, - "x": 980.5173492431641, - "y": 3343.125386238098, + "x": 1060.517349243164, + "y": 3363.125386238098, "wires": [ [ "1c2730c3.d43b4f" @@ -4749,8 +4332,8 @@ "timer": "", "oldrc": false, "name": "", - "x": 684.5208587646484, - "y": 3161.4202003479004, + "x": 764.5208587646484, + "y": 3181.4202003479004, "wires": [ [], [], @@ -4767,8 +4350,8 @@ "func": "if (msg.payload.code === 0){\n return msg;\n}\n", "outputs": 1, "noerr": 0, - "x": 824.0174713134766, - "y": 3255.12242603302, + "x": 904.0174713134766, + "y": 3275.12242603302, "wires": [ [ "11f93581.985a8a" @@ -4786,8 +4369,8 @@ "repeat": "", "crontab": "", "once": true, - "x": 475, - "y": 3159.0731925964355, + "x": 555, + "y": 3179.0731925964355, "wires": [ [ "34b160f1.5b1ee" @@ -4805,8 +4388,8 @@ "timer": "", "oldrc": false, "name": "", - "x": 1329.0173301696777, - "y": 3339.1218185424805, + "x": 1409.0173301696777, + "y": 3359.1218185424805, "wires": [ [], [], @@ -4828,8 +4411,8 @@ "randomLast": "5", "randomUnits": "seconds", "drop": false, - "x": 1178.5139389038086, - "y": 3340.732711791992, + "x": 1258.5139389038086, + "y": 3360.732711791992, "wires": [ [ "235307e4.347e18" @@ -4844,8 +4427,8 @@ "scope": [ "c0f36d.ab686c9" ], - "x": 420, - "y": 520, + "x": 500, + "y": 540, "wires": [ [ "410f235c.c1f2ac" @@ -4871,8 +4454,8 @@ "from": "", "to": "", "reg": false, - "x": 630, - "y": 520, + "x": 710, + "y": 540, "wires": [ [ "31588cca.783d84" @@ -4887,8 +4470,8 @@ "scope": [ "c0f36d.ab686c9" ], - "x": 480, - "y": 2980, + "x": 560, + "y": 3000, "wires": [ [ "6ccc73b5.86205c" @@ -4914,8 +4497,8 @@ "from": "", "to": "", "reg": false, - "x": 660, - "y": 2980, + "x": 740, + "y": 3000, "wires": [ [ "a4d1964e.cb4f78" @@ -4934,8 +4517,8 @@ "cancel": "", "topic": "", "name": "", - "x": 3967.999954223633, - "y": 206.00000953674316, + "x": 4047.999954223633, + "y": 226.00000953674316, "wires": [] }, { @@ -4949,8 +4532,8 @@ "syntax": "mustache", "template": "Alert: {{error.message}}", "output": "str", - "x": 3780.6319465637207, - "y": 196.31249809265137, + "x": 3860.6319465637207, + "y": 216.31249809265137, "wires": [ [ "34ef6654.47916a" @@ -4965,8 +4548,8 @@ "func": "var minRSSI = flow.get('minRSSI');\nif (msg.payload.rssi >= minRSSI){\n return msg;\n}", "outputs": 1, "noerr": 0, - "x": 850, - "y": 100, + "x": 930, + "y": 120, "wires": [ [ "e5652ef0.acaaf" @@ -4985,8 +4568,8 @@ "label": "Download via USB", "format": "{{msg.payload}}", "layout": "col-center", - "x": 2270.250030517578, - "y": 3036.5000343322754, + "x": 2350.250030517578, + "y": 3056.5000343322754, "wires": [] }, { @@ -5004,8 +4587,8 @@ "randomLast": "5", "randomUnits": "seconds", "drop": true, - "x": 898.5, - "y": 3019, + "x": 978.5, + "y": 3039, "wires": [ [ "c80707fb.c9ff98", @@ -5024,8 +4607,8 @@ "repeat": "30", "crontab": "", "once": true, - "x": 1794.375, - "y": 2945, + "x": 1874.375, + "y": 2965, "wires": [ [ "eef04124.0438f" @@ -5040,8 +4623,8 @@ "func": "if (msg.payload.code === 0){\n msg.payload = \"Success, remove USB drive.\";\n return msg;\n}\n", "outputs": 1, "noerr": 0, - "x": 2046.2500228881836, - "y": 3101.2500343322754, + "x": 2126.2500228881836, + "y": 3121.2500343322754, "wires": [ [ "eef04124.0438f" @@ -5056,8 +4639,8 @@ "func": "msg.payload = msg.payload.substring(0,8) + \"1 detected\";\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 1353.125015258789, - "y": 2983.7500343322754, + "x": 1433.125015258789, + "y": 3003.7500343322754, "wires": [ [ "eef04124.0438f" @@ -5070,8 +4653,8 @@ "z": "a564595f.642818", "name": "", "pretty": false, - "x": 3067.5, - "y": 20, + "x": 3147.5, + "y": 40, "wires": [ [ "3c8572c8.6a4b1e", @@ -5087,8 +4670,8 @@ "func": "var ipAddress = flow.get('ipaddress')||\"http://tiltpi.local:1880/ui\";\nflow.set(msg.payload.Color + \"-Comment\",ipAddress);\nflow.set('lastpost-' + msg.payload.Color,0);", "outputs": 1, "noerr": 0, - "x": 3353, - "y": 112, + "x": 3433, + "y": 132, "wires": [ [] ] @@ -5108,8 +4691,8 @@ "randomLast": "5", "randomUnits": "seconds", "drop": false, - "x": 3184.5, - "y": 112, + "x": 3264.5, + "y": 132, "wires": [ [ "780b4fd0.c274b" @@ -5125,8 +4708,8 @@ "8dc4fe46.fc364", "cdc2a491.47b908" ], - "x": 690, - "y": 200, + "x": 770, + "y": 220, "wires": [ [] ] @@ -5139,8 +4722,8 @@ "scope": [ "640f9404.72d27c" ], - "x": 3624, - "y": 48, + "x": 3704, + "y": 68, "wires": [ [] ] @@ -5153,8 +4736,8 @@ "func": "//check if system starting up and Tilts are in range.\nif (msg.payload === \"boot\"){\ncontext.set('startup',true);\n}else{\ncontext.set('tilt',true);\n}\n//contine startup if Tilt detected\nif (context.get('startup') && context.get('tilt')){\n//initializes settings file for each color\nvar colors = [\"red\",\"green\",\"black\",\"purple\",\"orange\",\"blue\",\"yellow\",\"pink\"];\nvar arrayLength = colors.length;\nfor (var i = 0; i < arrayLength; i++) {\n node.send({filename:\"/boot/cloud_log_\" + colors[i] + \".json\"});\n}\ncontext.set('startup',false);\n}", "outputs": 1, "noerr": 0, - "x": 2529, - "y": 20, + "x": 2609, + "y": 40, "wires": [ [ "a81ac973.c7f1a8" @@ -5176,8 +4759,8 @@ "randomLast": "5", "randomUnits": "seconds", "drop": false, - "x": 2740, - "y": 20, + "x": 2820, + "y": 40, "wires": [ [ "640f9404.72d27c" @@ -5199,8 +4782,8 @@ "randomLast": "5", "randomUnits": "seconds", "drop": false, - "x": 980, - "y": 300, + "x": 1060, + "y": 320, "wires": [ [ "a2f14292.5b0f3", @@ -5218,8 +4801,8 @@ "console": false, "tostatus": false, "complete": "true", - "x": 3870, - "y": 80, + "x": 3950, + "y": 100, "wires": [] }, { @@ -5237,8 +4820,8 @@ "randomLast": "5", "randomUnits": "seconds", "drop": false, - "x": 770, - "y": 380, + "x": 850, + "y": 400, "wires": [ [ "326af4b8.42494c" @@ -5264,8 +4847,8 @@ "from": "", "to": "", "reg": false, - "x": 3247.5, - "y": 22, + "x": 3327.5, + "y": 42, "wires": [ [ "7b880cec.674314" @@ -5280,8 +4863,8 @@ "func": "msg.payload = flow.get(msg.payload);\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 2132, - "y": 2364, + "x": 2212, + "y": 2384, "wires": [ [ "5312bf4.09fd44", @@ -5300,8 +4883,8 @@ "timer": "", "oldrc": false, "name": "", - "x": 678.25, - "y": 2523.500026702881, + "x": 758.25, + "y": 2543.500026702881, "wires": [ [ "437432fd.79dbbc" @@ -5324,8 +4907,8 @@ "mode": "text", "delay": "0", "topic": "", - "x": 934.0000076293945, - "y": 2529.250026702881, + "x": 1014.0000076293945, + "y": 2549.250026702881, "wires": [ [ "f8a4aa49.743c88" @@ -5343,8 +4926,8 @@ "timer": "", "oldrc": false, "name": "", - "x": 1280, - "y": 2560, + "x": 1360, + "y": 2580, "wires": [ [ "673f8112.35a61" @@ -5366,8 +4949,8 @@ "repeat": "60", "crontab": "", "once": true, - "x": 497.5, - "y": 2513.750026702881, + "x": 577.5, + "y": 2533.750026702881, "wires": [ [ "e5905320.33efc" @@ -5382,8 +4965,8 @@ "func": "msg.topic = \"System Time Updated\";\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 1450, - "y": 2520, + "x": 1530, + "y": 2540, "wires": [ [ "8ee3b7e3.1833a8" @@ -5398,8 +4981,8 @@ "func": "var ipAddress = msg.payload.ipv4;\nmsg.payload = \"http://\" + ipAddress.trim() + \":1880/ui\"\nflow.set('ipaddress',msg.payload);\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 1030, - "y": 2600, + "x": 1110, + "y": 2620, "wires": [ [ "a4a5a7ed.d59958" @@ -5418,8 +5001,8 @@ "ret": "\\n", "temp": "ipv4,ipv6", "skip": 0, - "x": 870, - "y": 2600, + "x": 950, + "y": 2620, "wires": [ [ "375008fe.27a988" @@ -5435,8 +5018,8 @@ "appendNewline": false, "createDir": false, "overwriteFile": "true", - "x": 1650, - "y": 2280, + "x": 1730, + "y": 2300, "wires": [ [] ] @@ -5449,8 +5032,8 @@ "func": "flow.set(\"tz\",\"/usr/share/zoneinfo/\" + msg.payload);\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 1660, - "y": 2320, + "x": 1740, + "y": 2340, "wires": [ [] ] @@ -5466,8 +5049,8 @@ "timer": "", "oldrc": false, "name": "copy timezone file (for jessie)", - "x": 1480, - "y": 2420, + "x": 1560, + "y": 2440, "wires": [ [], [], @@ -5487,8 +5070,8 @@ "timer": "", "oldrc": false, "name": "scan control", - "x": 570, - "y": 100, + "x": 650, + "y": 120, "wires": [ [ "8dc4fe46.fc364" @@ -5510,8 +5093,8 @@ "console": false, "tostatus": false, "complete": "payload", - "x": 2950, - "y": 80, + "x": 3030, + "y": 100, "wires": [] }, { @@ -5524,8 +5107,8 @@ "console": false, "tostatus": false, "complete": "payload", - "x": 810, - "y": 40, + "x": 890, + "y": 60, "wires": [] }, { @@ -5542,8 +5125,8 @@ "reset": "", "bytopic": "all", "name": "Reset", - "x": 590, - "y": 20, + "x": 670, + "y": 40, "wires": [ [ "9d251f5a.10bdc" @@ -5562,8 +5145,8 @@ "crontab": "", "once": true, "onceDelay": "2", - "x": 500, - "y": 2920, + "x": 580, + "y": 2940, "wires": [ [ "e5c9eaf5.b44748" @@ -5578,46 +5161,14 @@ "func": "msg.payload = flow.get(msg.payload);\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 670, - "y": 2920, + "x": 750, + "y": 2940, "wires": [ [ "a4d1964e.cb4f78" ] ] }, - { - "id": "713dd3f6.8af61c", - "type": "ui_text", - "z": "a564595f.642818", - "group": "6acae0b0.a184", - "order": 1, - "width": 0, - "height": 0, - "name": "", - "label": "Calibrated Specific Gravity:", - "format": "{{msg.payload.SG | number:4}}", - "layout": "row-spread", - "x": 2420, - "y": 1500, - "wires": [] - }, - { - "id": "675094a4.49a26c", - "type": "ui_text", - "z": "a564595f.642818", - "group": "c12bcb12.dbd0d8", - "order": 1, - "width": 0, - "height": 0, - "name": "", - "label": "Calibrated Temperature:", - "format": "{{msg.payload.displayTemp | number:1}}{{msg.payload.tempunits}}", - "layout": "row-spread", - "x": 2608.4999237060547, - "y": 1550.9999895095825, - "wires": [] - }, { "id": "2c407f92.0b22b", "type": "exec", @@ -5629,8 +5180,8 @@ "timer": "", "oldrc": false, "name": "Reduce Baud", - "x": 1720, - "y": 2600, + "x": 1800, + "y": 2620, "wires": [ [], [], @@ -5650,8 +5201,8 @@ "timer": "", "oldrc": false, "name": "Restore Baud", - "x": 1720, - "y": 2660, + "x": 1800, + "y": 2680, "wires": [ [], [], @@ -5677,8 +5228,8 @@ "payload": "", "payloadType": "date", "topic": "", - "x": 1500, - "y": 2600, + "x": 1580, + "y": 2620, "wires": [ [ "2c407f92.0b22b" @@ -5702,8 +5253,8 @@ "payload": "", "payloadType": "date", "topic": "", - "x": 1480, - "y": 2660, + "x": 1560, + "y": 2680, "wires": [ [ "6b927b9c.f1c794" @@ -5722,8 +5273,8 @@ "label": "Current Version: {{msg.label}}", "format": "{{msg.payload}}", "layout": "col-center", - "x": 2250, - "y": 2840, + "x": 2330, + "y": 2860, "wires": [] }, { @@ -5740,8 +5291,8 @@ "reset": "", "bytopic": "all", "name": "Reset Result", - "x": 3610, - "y": 580, + "x": 3690, + "y": 600, "wires": [ [ "b94e4a26.8805b8" @@ -5774,8 +5325,8 @@ "from": "", "to": "", "reg": false, - "x": 3780, - "y": 580, + "x": 3860, + "y": 600, "wires": [ [ "df1ac3a9.c4472" @@ -5792,8 +5343,8 @@ "console": false, "tostatus": false, "complete": "true", - "x": 3850, - "y": 40, + "x": 3930, + "y": 60, "wires": [] }, { @@ -5804,8 +5355,8 @@ "func": "// true marks tiltpi as developer mode \n// dev-mode: true allows custom update source\n//var devEnabled = true; // dev-mode enabled\nvar devEnabled = false; // dev-mode disabled\nflow.set('dev-mode',devEnabled); \n\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 770, - "y": 2680, + "x": 850, + "y": 2700, "wires": [ [ "f089aeab.e0832" @@ -5820,8 +5371,8 @@ "func": "// replace this url with your custom publicly resolved github source\nvar customUrl = \"https://raw.githubusercontent.com/baronbrew/TILTpi/Aioblescan/flow.json\";\n//var customUrl = \"https://raw.githubusercontent.com/baronbrew/tiltpi/tiltpi-dev/flow.json\";\nvar customReleases = \"https://api.github.com/repos/baronbrew/tiltpi/releases\";\nflow.set('custom-update-url', customUrl);\nflow.set('custom-update-release-url', customReleases);\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 980, - "y": 2680, + "x": 1060, + "y": 2700, "wires": [ [] ] @@ -5834,8 +5385,8 @@ "func": "// disabled use of master due to broken builds on later raspberry pi images\n//var defaultUrl = \"https://raw.githubusercontent.com/baronbrew/TILTpi/master/flow.json\";\nvar defaultUrl = \"https://raw.githubusercontent.com/baronbrew/TILTpi/Aioblescan/flow.json\";\n\nvar customUrl = flow.get('custom-update-url');\n\nif (flow.get('dev-mode') && customUrl) {\n msg.payload = customUrl;\n} else {\n msg.payload = defaultUrl;\n}\n\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 800, - "y": 2720, + "x": 880, + "y": 2740, "wires": [ [ "13f0085a.0d5178" @@ -5854,8 +5405,8 @@ "crontab": "", "once": true, "onceDelay": "", - "x": 580, - "y": 2680, + "x": 660, + "y": 2700, "wires": [ [ "b434dd22.03a0f" @@ -5870,8 +5421,8 @@ "func": "// use github releases API to fetch latest release details\nvar defaultReleases = \"https://api.github.com/repos/baronbrew/TILTpi/releases/latest\";\nvar customReleases = flow.get('custom-update-release-url') + \"/latest\";\n\nif (flow.get('dev-mode') && customReleases) {\n msg.url = customReleases;\n} else {\n msg.url = defaultReleases;\n}\n\nmsg.headers = {\n \"User-Agent\": \"node-red;tiltpi\"\n}\n\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 1750, - "y": 2800, + "x": 1830, + "y": 2820, "wires": [ [ "e5ef4db6.33ad1" @@ -5890,8 +5441,8 @@ "crontab": "", "once": true, "onceDelay": "", - "x": 1560, - "y": 2800, + "x": 1640, + "y": 2820, "wires": [ [ "28059b08.d92734" @@ -5910,8 +5461,8 @@ "label": "{{msg.label}}", "format": "{{msg.payload}}", "layout": "col-center", - "x": 2480, - "y": 2800, + "x": 2560, + "y": 2820, "wires": [] }, { @@ -5922,8 +5473,8 @@ "func": "var status = msg.statusCode;\nvar resp = msg.payload;\n\nvar msg = {};\nif (status == 200 && resp !== []) {\n var latest = flow.get(\"version\");\n if (resp.name == latest.name) {\n msg.enabled = false;\n msg.label = \"\";\n msg.payload = \"Running most current version.\";\n } else {\n msg.enabled = true;\n msg.label = \"Latest Update: \" + resp.name;\n msg.payload = resp.body;\n }\n} else {\n msg.enabled = false;\n msg.label = \"Lastest Update: Unknown\";\n msg.payload = \"Failed to retrieve latest release information. Check internet connectivity.\"\n}\n\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 2330, - "y": 2800, + "x": 2410, + "y": 2820, "wires": [ [ "a1089058.b969" @@ -5939,8 +5490,8 @@ "ret": "obj", "url": "", "tls": "", - "x": 2150, - "y": 2800, + "x": 2230, + "y": 2820, "wires": [ [ "9ae6ebe8.91e128" @@ -5962,8 +5513,8 @@ "randomLast": "5", "randomUnits": "seconds", "drop": false, - "x": 1940, - "y": 2800, + "x": 2020, + "y": 2820, "wires": [ [ "a5a85aba.a9d748" @@ -5982,8 +5533,8 @@ "crontab": "", "once": true, "onceDelay": "8", - "x": 1900, - "y": 2840, + "x": 1980, + "y": 2860, "wires": [ [ "edb8b308.bde27" @@ -5995,11 +5546,11 @@ "type": "function", "z": "a564595f.642818", "name": "release info", - "func": "var release = {\n name: \"v.2.7\",\n notes: \"Optionally use Tilt MAC address to identify Tilts along with color. Optionally smooth Tilt measurements\"\n}\nflow.set(\"version\", release);\n\nmsg.label = release.name;\nmsg.payload = release.notes;\nreturn msg;", + "func": "var release = {\n name: \"v.2.7.1\",\n notes: \"UI improvements for calibrating\"\n}\nflow.set(\"version\", release);\n\nmsg.label = release.name;\nmsg.payload = release.notes;\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 2070, - "y": 2840, + "x": 2150, + "y": 2860, "wires": [ [ "47d6079b.2ae9c8" @@ -6016,8 +5567,8 @@ "console": false, "tostatus": false, "complete": "false", - "x": 1560, - "y": 220, + "x": 1640, + "y": 240, "wires": [] }, { @@ -6030,8 +5581,8 @@ "console": false, "tostatus": false, "complete": "false", - "x": 4260, - "y": 400, + "x": 4340, + "y": 420, "wires": [] }, { @@ -6053,8 +5604,8 @@ "from": "", "to": "", "reg": false, - "x": 1990, - "y": 440, + "x": 2070, + "y": 460, "wires": [ [] ] @@ -6078,8 +5629,8 @@ "from": "", "to": "", "reg": false, - "x": 1990, - "y": 480, + "x": 2070, + "y": 500, "wires": [ [] ] @@ -6103,8 +5654,8 @@ "from": "", "to": "", "reg": false, - "x": 1990, - "y": 520, + "x": 2070, + "y": 540, "wires": [ [] ] @@ -6128,8 +5679,8 @@ "from": "", "to": "", "reg": false, - "x": 1990, - "y": 560, + "x": 2070, + "y": 580, "wires": [ [] ] @@ -6153,8 +5704,8 @@ "from": "", "to": "", "reg": false, - "x": 1990, - "y": 620, + "x": 2070, + "y": 640, "wires": [ [] ] @@ -6178,8 +5729,8 @@ "from": "", "to": "", "reg": false, - "x": 1990, - "y": 660, + "x": 2070, + "y": 680, "wires": [ [] ] @@ -6203,8 +5754,8 @@ "from": "", "to": "", "reg": false, - "x": 1990, - "y": 700, + "x": 2070, + "y": 720, "wires": [ [] ] @@ -6228,8 +5779,8 @@ "from": "", "to": "", "reg": false, - "x": 1990, - "y": 740, + "x": 2070, + "y": 760, "wires": [ [] ] @@ -6253,8 +5804,8 @@ "from": "", "to": "", "reg": false, - "x": 1990, - "y": 780, + "x": 2070, + "y": 800, "wires": [ [] ] @@ -6278,8 +5829,8 @@ "from": "", "to": "", "reg": false, - "x": 1990, - "y": 820, + "x": 2070, + "y": 840, "wires": [ [] ] @@ -6303,8 +5854,8 @@ "from": "", "to": "", "reg": false, - "x": 1990, - "y": 860, + "x": 2070, + "y": 880, "wires": [ [] ] @@ -6328,8 +5879,8 @@ "from": "", "to": "", "reg": false, - "x": 1990, - "y": 900, + "x": 2070, + "y": 920, "wires": [ [] ] @@ -6346,8 +5897,8 @@ "crontab": "", "once": false, "onceDelay": "", - "x": 2160, - "y": 440, + "x": 2240, + "y": 460, "wires": [ [ "647d71c4.628e8" @@ -6373,8 +5924,8 @@ "from": "", "to": "", "reg": false, - "x": 2350, - "y": 440, + "x": 2430, + "y": 460, "wires": [ [ "23acb7c8.0f4fa8" @@ -6389,8 +5940,8 @@ "func": "if(msg.payload === undefined){\n msg.payload = {};\n msg.show = \"hidden\";\n return msg; \n}\nvar displayTimeout = flow.get('displayTimeout')||120000;\n//set msg.topic for use in displaying the correct color\nmsg.topic = msg.payload.Color;\n//reorder list if a Tilt disconnects\nif (msg.payload.clock - msg.payload.timeStamp > displayTimeout){\n flow.set('storage-1',undefined);\n flow.set('storage-2',undefined);\n flow.set('storage-3',undefined);\n flow.set('storage-4',undefined);\n flow.set('storage-5',undefined);\n flow.set('storage-6',undefined);\n flow.set('storage-7',undefined);\n flow.set('storage-8',undefined);\n flow.set('storage-9',undefined);\n flow.set('storage-10',undefined);\n flow.set('storage-11',undefined);\n flow.set('storage-12',undefined);\n flow.set('storage-13',undefined);\n flow.set('storage-14',undefined);\n flow.set('storage-15',undefined);\n flow.set('storage-16',undefined);\n flow.set('storage-17',undefined);\n flow.set('storage-18',undefined);\n flow.set('storage-19',undefined);\n flow.set('storage-20',undefined);\n flow.set('storage-21',undefined);\n flow.set('storage-22',undefined);\n flow.set('storage-23',undefined);\n flow.set('storage-24',undefined);\n flow.set('storage-25',undefined);\n flow.set('options',[]);\n if (msg.topic === flow.get('colordropdownSelect')){\n flow.set('colordropdownSelect',undefined);\n }\n msg.show = \"hidden\";\n return msg;\n}\nelse{\n msg.show = \"visible\";\n return msg;\n}", "outputs": 1, "noerr": 0, - "x": 2530, - "y": 440, + "x": 2610, + "y": 460, "wires": [ [ "b0c871ee.825fa" @@ -6410,8 +5961,8 @@ "storeOutMessages": true, "fwdInMessages": true, "templateScope": "local", - "x": 2750, - "y": 440, + "x": 2830, + "y": 460, "wires": [ [ "1ee5d27c.fa4e8e", @@ -6432,8 +5983,8 @@ "storeOutMessages": true, "fwdInMessages": true, "templateScope": "local", - "x": 2750, - "y": 480, + "x": 2830, + "y": 500, "wires": [ [ "1ee5d27c.fa4e8e", @@ -6449,8 +6000,8 @@ "func": "if(msg.payload === undefined){\n msg.payload = {};\n msg.show = \"hidden\";\n return msg; \n}\nvar displayTimeout = flow.get('displayTimeout')||120000;\n//set msg.topic for use in displaying the correct color\nmsg.topic = msg.payload.Color;\n//reorder list if a Tilt disconnects\nif (msg.payload.clock - msg.payload.timeStamp > displayTimeout){\n flow.set('storage-1',undefined);\n flow.set('storage-2',undefined);\n flow.set('storage-3',undefined);\n flow.set('storage-4',undefined);\n flow.set('storage-5',undefined);\n flow.set('storage-6',undefined);\n flow.set('storage-7',undefined);\n flow.set('storage-8',undefined);\n flow.set('storage-9',undefined);\n flow.set('storage-10',undefined);\n flow.set('storage-11',undefined);\n flow.set('storage-12',undefined);\n flow.set('storage-13',undefined);\n flow.set('storage-14',undefined);\n flow.set('storage-15',undefined);\n flow.set('storage-16',undefined);\n flow.set('storage-17',undefined);\n flow.set('storage-18',undefined);\n flow.set('storage-19',undefined);\n flow.set('storage-20',undefined);\n flow.set('storage-21',undefined);\n flow.set('storage-22',undefined);\n flow.set('storage-23',undefined);\n flow.set('storage-24',undefined);\n flow.set('storage-25',undefined);\n flow.set('options',[]);\n if (msg.topic === flow.get('colordropdownSelect')){\n flow.set('colordropdownSelect',undefined);\n }\n msg.show = \"hidden\";\n return msg;\n}\nelse{\n msg.show = \"visible\";\n return msg;\n}", "outputs": 1, "noerr": 0, - "x": 2530, - "y": 480, + "x": 2610, + "y": 500, "wires": [ [ "1b07d15a.22721f" @@ -6476,8 +6027,8 @@ "from": "", "to": "", "reg": false, - "x": 2350, - "y": 480, + "x": 2430, + "y": 500, "wires": [ [ "69c80d48.ff3944" @@ -6496,8 +6047,8 @@ "crontab": "", "once": false, "onceDelay": "", - "x": 2160, - "y": 480, + "x": 2240, + "y": 500, "wires": [ [ "a388c3a2.eac4d" @@ -6517,8 +6068,8 @@ "storeOutMessages": true, "fwdInMessages": true, "templateScope": "local", - "x": 2750, - "y": 520, + "x": 2830, + "y": 540, "wires": [ [ "1ee5d27c.fa4e8e", @@ -6534,8 +6085,8 @@ "func": "if(msg.payload === undefined){\n msg.payload = {};\n msg.show = \"hidden\";\n return msg; \n}\nvar displayTimeout = flow.get('displayTimeout')||120000;\n//set msg.topic for use in displaying the correct color\nmsg.topic = msg.payload.Color;\n//reorder list if a Tilt disconnects\nif (msg.payload.clock - msg.payload.timeStamp > displayTimeout){\n flow.set('storage-1',undefined);\n flow.set('storage-2',undefined);\n flow.set('storage-3',undefined);\n flow.set('storage-4',undefined);\n flow.set('storage-5',undefined);\n flow.set('storage-6',undefined);\n flow.set('storage-7',undefined);\n flow.set('storage-8',undefined);\n flow.set('storage-9',undefined);\n flow.set('storage-10',undefined);\n flow.set('storage-11',undefined);\n flow.set('storage-12',undefined);\n flow.set('storage-13',undefined);\n flow.set('storage-14',undefined);\n flow.set('storage-15',undefined);\n flow.set('storage-16',undefined);\n flow.set('storage-17',undefined);\n flow.set('storage-18',undefined);\n flow.set('storage-19',undefined);\n flow.set('storage-20',undefined);\n flow.set('storage-21',undefined);\n flow.set('storage-22',undefined);\n flow.set('storage-23',undefined);\n flow.set('storage-24',undefined);\n flow.set('storage-25',undefined);\n flow.set('options',[]);\n if (msg.topic === flow.get('colordropdownSelect')){\n flow.set('colordropdownSelect',undefined);\n }\n msg.show = \"hidden\";\n return msg;\n}\nelse{\n msg.show = \"visible\";\n return msg;\n}", "outputs": 1, "noerr": 0, - "x": 2530, - "y": 520, + "x": 2610, + "y": 540, "wires": [ [ "d85b1a06.40d7c8" @@ -6561,8 +6112,8 @@ "from": "", "to": "", "reg": false, - "x": 2350, - "y": 520, + "x": 2430, + "y": 540, "wires": [ [ "9292de64.9ae" @@ -6581,8 +6132,8 @@ "crontab": "", "once": false, "onceDelay": "", - "x": 2160, - "y": 520, + "x": 2240, + "y": 540, "wires": [ [ "720fd272.1a56cc" @@ -6602,8 +6153,8 @@ "storeOutMessages": true, "fwdInMessages": true, "templateScope": "local", - "x": 2750, - "y": 560, + "x": 2830, + "y": 580, "wires": [ [ "1ee5d27c.fa4e8e", @@ -6619,8 +6170,8 @@ "func": "if(msg.payload === undefined){\n msg.payload = {};\n msg.show = \"hidden\";\n return msg; \n}\nvar displayTimeout = flow.get('displayTimeout')||120000;\n//set msg.topic for use in displaying the correct color\nmsg.topic = msg.payload.Color;\n//reorder list if a Tilt disconnects\nif (msg.payload.clock - msg.payload.timeStamp > displayTimeout){\n flow.set('storage-1',undefined);\n flow.set('storage-2',undefined);\n flow.set('storage-3',undefined);\n flow.set('storage-4',undefined);\n flow.set('storage-5',undefined);\n flow.set('storage-6',undefined);\n flow.set('storage-7',undefined);\n flow.set('storage-8',undefined);\n flow.set('storage-9',undefined);\n flow.set('storage-10',undefined);\n flow.set('storage-11',undefined);\n flow.set('storage-12',undefined);\n flow.set('storage-13',undefined);\n flow.set('storage-14',undefined);\n flow.set('storage-15',undefined);\n flow.set('storage-16',undefined);\n flow.set('storage-17',undefined);\n flow.set('storage-18',undefined);\n flow.set('storage-19',undefined);\n flow.set('storage-20',undefined);\n flow.set('storage-21',undefined);\n flow.set('storage-22',undefined);\n flow.set('storage-23',undefined);\n flow.set('storage-24',undefined);\n flow.set('storage-25',undefined);\n flow.set('options',[]);\n if (msg.topic === flow.get('colordropdownSelect')){\n flow.set('colordropdownSelect',undefined);\n }\n msg.show = \"hidden\";\n return msg;\n}\nelse{\n msg.show = \"visible\";\n return msg;\n}", "outputs": 1, "noerr": 0, - "x": 2530, - "y": 560, + "x": 2610, + "y": 580, "wires": [ [ "c3e65142.1abc1" @@ -6646,8 +6197,8 @@ "from": "", "to": "", "reg": false, - "x": 2350, - "y": 560, + "x": 2430, + "y": 580, "wires": [ [ "4b54d3d8.c7a56c" @@ -6666,8 +6217,8 @@ "crontab": "", "once": false, "onceDelay": "", - "x": 2160, - "y": 560, + "x": 2240, + "y": 580, "wires": [ [ "99a8c422.9a5d18" @@ -6687,8 +6238,8 @@ "storeOutMessages": true, "fwdInMessages": true, "templateScope": "local", - "x": 2750, - "y": 620, + "x": 2830, + "y": 640, "wires": [ [ "1ee5d27c.fa4e8e", @@ -6704,8 +6255,8 @@ "func": "if(msg.payload === undefined){\n msg.payload = {};\n msg.show = \"hidden\";\n return msg; \n}\nvar displayTimeout = flow.get('displayTimeout')||120000;\n//set msg.topic for use in displaying the correct color\nmsg.topic = msg.payload.Color;\n//reorder list if a Tilt disconnects\nif (msg.payload.clock - msg.payload.timeStamp > displayTimeout){\n flow.set('storage-1',undefined);\n flow.set('storage-2',undefined);\n flow.set('storage-3',undefined);\n flow.set('storage-4',undefined);\n flow.set('storage-5',undefined);\n flow.set('storage-6',undefined);\n flow.set('storage-7',undefined);\n flow.set('storage-8',undefined);\n flow.set('storage-9',undefined);\n flow.set('storage-10',undefined);\n flow.set('storage-11',undefined);\n flow.set('storage-12',undefined);\n flow.set('storage-13',undefined);\n flow.set('storage-14',undefined);\n flow.set('storage-15',undefined);\n flow.set('storage-16',undefined);\n flow.set('storage-17',undefined);\n flow.set('storage-18',undefined);\n flow.set('storage-19',undefined);\n flow.set('storage-20',undefined);\n flow.set('storage-21',undefined);\n flow.set('storage-22',undefined);\n flow.set('storage-23',undefined);\n flow.set('storage-24',undefined);\n flow.set('storage-25',undefined);\n flow.set('options',[]);\n if (msg.topic === flow.get('colordropdownSelect')){\n flow.set('colordropdownSelect',undefined);\n }\n msg.show = \"hidden\";\n return msg;\n}\nelse{\n msg.show = \"visible\";\n return msg;\n}", "outputs": 1, "noerr": 0, - "x": 2530, - "y": 620, + "x": 2610, + "y": 640, "wires": [ [ "b7987897.334ee8" @@ -6731,8 +6282,8 @@ "from": "", "to": "", "reg": false, - "x": 2350, - "y": 620, + "x": 2430, + "y": 640, "wires": [ [ "6fbf3d7b.557c44" @@ -6751,8 +6302,8 @@ "crontab": "", "once": false, "onceDelay": "", - "x": 2160, - "y": 620, + "x": 2240, + "y": 640, "wires": [ [ "4d34d92a.daacb8" @@ -6772,8 +6323,8 @@ "storeOutMessages": true, "fwdInMessages": true, "templateScope": "local", - "x": 2750, - "y": 660, + "x": 2830, + "y": 680, "wires": [ [ "1ee5d27c.fa4e8e", @@ -6789,8 +6340,8 @@ "func": "if(msg.payload === undefined){\n msg.payload = {};\n msg.show = \"hidden\";\n return msg; \n}\nvar displayTimeout = flow.get('displayTimeout')||120000;\n//set msg.topic for use in displaying the correct color\nmsg.topic = msg.payload.Color;\n//reorder list if a Tilt disconnects\nif (msg.payload.clock - msg.payload.timeStamp > displayTimeout){\n flow.set('storage-1',undefined);\n flow.set('storage-2',undefined);\n flow.set('storage-3',undefined);\n flow.set('storage-4',undefined);\n flow.set('storage-5',undefined);\n flow.set('storage-6',undefined);\n flow.set('storage-7',undefined);\n flow.set('storage-8',undefined);\n flow.set('storage-9',undefined);\n flow.set('storage-10',undefined);\n flow.set('storage-11',undefined);\n flow.set('storage-12',undefined);\n flow.set('storage-13',undefined);\n flow.set('storage-14',undefined);\n flow.set('storage-15',undefined);\n flow.set('storage-16',undefined);\n flow.set('storage-17',undefined);\n flow.set('storage-18',undefined);\n flow.set('storage-19',undefined);\n flow.set('storage-20',undefined);\n flow.set('storage-21',undefined);\n flow.set('storage-22',undefined);\n flow.set('storage-23',undefined);\n flow.set('storage-24',undefined);\n flow.set('storage-25',undefined);\n flow.set('options',[]);\n if (msg.topic === flow.get('colordropdownSelect')){\n flow.set('colordropdownSelect',undefined);\n }\n msg.show = \"hidden\";\n return msg;\n}\nelse{\n msg.show = \"visible\";\n return msg;\n}", "outputs": 1, "noerr": 0, - "x": 2530, - "y": 660, + "x": 2610, + "y": 680, "wires": [ [ "50c01cc7.5c7ce4" @@ -6816,8 +6367,8 @@ "from": "", "to": "", "reg": false, - "x": 2350, - "y": 660, + "x": 2430, + "y": 680, "wires": [ [ "adb9f508.09beb8" @@ -6836,8 +6387,8 @@ "crontab": "", "once": false, "onceDelay": "", - "x": 2160, - "y": 660, + "x": 2240, + "y": 680, "wires": [ [ "bf999e86.007a" @@ -6857,8 +6408,8 @@ "storeOutMessages": true, "fwdInMessages": true, "templateScope": "local", - "x": 2750, - "y": 700, + "x": 2830, + "y": 720, "wires": [ [ "1ee5d27c.fa4e8e", @@ -6874,8 +6425,8 @@ "func": "if(msg.payload === undefined){\n msg.payload = {};\n msg.show = \"hidden\";\n return msg; \n}\nvar displayTimeout = flow.get('displayTimeout')||120000;\n//set msg.topic for use in displaying the correct color\nmsg.topic = msg.payload.Color;\n//reorder list if a Tilt disconnects\nif (msg.payload.clock - msg.payload.timeStamp > displayTimeout){\n flow.set('storage-1',undefined);\n flow.set('storage-2',undefined);\n flow.set('storage-3',undefined);\n flow.set('storage-4',undefined);\n flow.set('storage-5',undefined);\n flow.set('storage-6',undefined);\n flow.set('storage-7',undefined);\n flow.set('storage-8',undefined);\n flow.set('storage-9',undefined);\n flow.set('storage-10',undefined);\n flow.set('storage-11',undefined);\n flow.set('storage-12',undefined);\n flow.set('storage-13',undefined);\n flow.set('storage-14',undefined);\n flow.set('storage-15',undefined);\n flow.set('storage-16',undefined);\n flow.set('storage-17',undefined);\n flow.set('storage-18',undefined);\n flow.set('storage-19',undefined);\n flow.set('storage-20',undefined);\n flow.set('storage-21',undefined);\n flow.set('storage-22',undefined);\n flow.set('storage-23',undefined);\n flow.set('storage-24',undefined);\n flow.set('storage-25',undefined);\n flow.set('options',[]);\n if (msg.topic === flow.get('colordropdownSelect')){\n flow.set('colordropdownSelect',undefined);\n }\n msg.show = \"hidden\";\n return msg;\n}\nelse{\n msg.show = \"visible\";\n return msg;\n}", "outputs": 1, "noerr": 0, - "x": 2530, - "y": 700, + "x": 2610, + "y": 720, "wires": [ [ "96fc73f7.4aedf" @@ -6901,8 +6452,8 @@ "from": "", "to": "", "reg": false, - "x": 2350, - "y": 700, + "x": 2430, + "y": 720, "wires": [ [ "56b1aaf6.963794" @@ -6921,8 +6472,8 @@ "crontab": "", "once": false, "onceDelay": "", - "x": 2160, - "y": 700, + "x": 2240, + "y": 720, "wires": [ [ "302c41e1.93c55e" @@ -6942,8 +6493,8 @@ "storeOutMessages": true, "fwdInMessages": true, "templateScope": "local", - "x": 2750, - "y": 740, + "x": 2830, + "y": 760, "wires": [ [ "1ee5d27c.fa4e8e", @@ -6959,8 +6510,8 @@ "func": "if(msg.payload === undefined){\n msg.payload = {};\n msg.show = \"hidden\";\n return msg; \n}\nvar displayTimeout = flow.get('displayTimeout')||120000;\n//set msg.topic for use in displaying the correct color\nmsg.topic = msg.payload.Color;\n//reorder list if a Tilt disconnects\nif (msg.payload.clock - msg.payload.timeStamp > displayTimeout){\n flow.set('storage-1',undefined);\n flow.set('storage-2',undefined);\n flow.set('storage-3',undefined);\n flow.set('storage-4',undefined);\n flow.set('storage-5',undefined);\n flow.set('storage-6',undefined);\n flow.set('storage-7',undefined);\n flow.set('storage-8',undefined);\n flow.set('storage-9',undefined);\n flow.set('storage-10',undefined);\n flow.set('storage-11',undefined);\n flow.set('storage-12',undefined);\n flow.set('storage-13',undefined);\n flow.set('storage-14',undefined);\n flow.set('storage-15',undefined);\n flow.set('storage-16',undefined);\n flow.set('storage-17',undefined);\n flow.set('storage-18',undefined);\n flow.set('storage-19',undefined);\n flow.set('storage-20',undefined);\n flow.set('storage-21',undefined);\n flow.set('storage-22',undefined);\n flow.set('storage-23',undefined);\n flow.set('storage-24',undefined);\n flow.set('storage-25',undefined);\n flow.set('options',[]);\n if (msg.topic === flow.get('colordropdownSelect')){\n flow.set('colordropdownSelect',undefined);\n }\n msg.show = \"hidden\";\n return msg;\n}\nelse{\n msg.show = \"visible\";\n return msg;\n}", "outputs": 1, "noerr": 0, - "x": 2530, - "y": 740, + "x": 2610, + "y": 760, "wires": [ [ "2c830d1d.47a5c2" @@ -6986,8 +6537,8 @@ "from": "", "to": "", "reg": false, - "x": 2350, - "y": 740, + "x": 2430, + "y": 760, "wires": [ [ "f158029e.ab5ad" @@ -7006,8 +6557,8 @@ "crontab": "", "once": false, "onceDelay": "", - "x": 2160, - "y": 740, + "x": 2240, + "y": 760, "wires": [ [ "bf4e38c5.6b64e8" @@ -7027,8 +6578,8 @@ "storeOutMessages": true, "fwdInMessages": true, "templateScope": "local", - "x": 2750, - "y": 780, + "x": 2830, + "y": 800, "wires": [ [ "1ee5d27c.fa4e8e", @@ -7044,8 +6595,8 @@ "func": "if(msg.payload === undefined){\n msg.payload = {};\n msg.show = \"hidden\";\n return msg; \n}\nvar displayTimeout = flow.get('displayTimeout')||120000;\n//set msg.topic for use in displaying the correct color\nmsg.topic = msg.payload.Color;\n//reorder list if a Tilt disconnects\nif (msg.payload.clock - msg.payload.timeStamp > displayTimeout){\n flow.set('storage-1',undefined);\n flow.set('storage-2',undefined);\n flow.set('storage-3',undefined);\n flow.set('storage-4',undefined);\n flow.set('storage-5',undefined);\n flow.set('storage-6',undefined);\n flow.set('storage-7',undefined);\n flow.set('storage-8',undefined);\n flow.set('storage-9',undefined);\n flow.set('storage-10',undefined);\n flow.set('storage-11',undefined);\n flow.set('storage-12',undefined);\n flow.set('storage-13',undefined);\n flow.set('storage-14',undefined);\n flow.set('storage-15',undefined);\n flow.set('storage-16',undefined);\n flow.set('storage-17',undefined);\n flow.set('storage-18',undefined);\n flow.set('storage-19',undefined);\n flow.set('storage-20',undefined);\n flow.set('storage-21',undefined);\n flow.set('storage-22',undefined);\n flow.set('storage-23',undefined);\n flow.set('storage-24',undefined);\n flow.set('storage-25',undefined);\n flow.set('options',[]);\n if (msg.topic === flow.get('colordropdownSelect')){\n flow.set('colordropdownSelect',undefined);\n }\n msg.show = \"hidden\";\n return msg;\n}\nelse{\n msg.show = \"visible\";\n return msg;\n}", "outputs": 1, "noerr": 0, - "x": 2530, - "y": 780, + "x": 2610, + "y": 800, "wires": [ [ "9fb8659c.72a988" @@ -7071,8 +6622,8 @@ "from": "", "to": "", "reg": false, - "x": 2350, - "y": 780, + "x": 2430, + "y": 800, "wires": [ [ "52a8aa48.8cbb84" @@ -7091,8 +6642,8 @@ "crontab": "", "once": false, "onceDelay": "", - "x": 2160, - "y": 780, + "x": 2240, + "y": 800, "wires": [ [ "5e446f27.4b485" @@ -7112,8 +6663,8 @@ "storeOutMessages": true, "fwdInMessages": true, "templateScope": "local", - "x": 2750, - "y": 820, + "x": 2830, + "y": 840, "wires": [ [ "1ee5d27c.fa4e8e", @@ -7129,8 +6680,8 @@ "func": "if(msg.payload === undefined){\n msg.payload = {};\n msg.show = \"hidden\";\n return msg; \n}\nvar displayTimeout = flow.get('displayTimeout')||120000;\n//set msg.topic for use in displaying the correct color\nmsg.topic = msg.payload.Color;\n//reorder list if a Tilt disconnects\nif (msg.payload.clock - msg.payload.timeStamp > displayTimeout){\n flow.set('storage-1',undefined);\n flow.set('storage-2',undefined);\n flow.set('storage-3',undefined);\n flow.set('storage-4',undefined);\n flow.set('storage-5',undefined);\n flow.set('storage-6',undefined);\n flow.set('storage-7',undefined);\n flow.set('storage-8',undefined);\n flow.set('storage-9',undefined);\n flow.set('storage-10',undefined);\n flow.set('storage-11',undefined);\n flow.set('storage-12',undefined);\n flow.set('storage-13',undefined);\n flow.set('storage-14',undefined);\n flow.set('storage-15',undefined);\n flow.set('storage-16',undefined);\n flow.set('storage-17',undefined);\n flow.set('storage-18',undefined);\n flow.set('storage-19',undefined);\n flow.set('storage-20',undefined);\n flow.set('storage-21',undefined);\n flow.set('storage-22',undefined);\n flow.set('storage-23',undefined);\n flow.set('storage-24',undefined);\n flow.set('storage-25',undefined);\n flow.set('options',[]);\n if (msg.topic === flow.get('colordropdownSelect')){\n flow.set('colordropdownSelect',undefined);\n }\n msg.show = \"hidden\";\n return msg;\n}\nelse{\n msg.show = \"visible\";\n return msg;\n}", "outputs": 1, "noerr": 0, - "x": 2530, - "y": 820, + "x": 2610, + "y": 840, "wires": [ [ "fad59c31.459a5" @@ -7156,8 +6707,8 @@ "from": "", "to": "", "reg": false, - "x": 2350, - "y": 820, + "x": 2430, + "y": 840, "wires": [ [ "ee3d5711.f574e8" @@ -7176,8 +6727,8 @@ "crontab": "", "once": false, "onceDelay": "", - "x": 2160, - "y": 820, + "x": 2240, + "y": 840, "wires": [ [ "57519e88.1b6e3" @@ -7197,8 +6748,8 @@ "storeOutMessages": true, "fwdInMessages": true, "templateScope": "local", - "x": 2750, - "y": 860, + "x": 2830, + "y": 880, "wires": [ [ "1ee5d27c.fa4e8e", @@ -7214,8 +6765,8 @@ "func": "if(msg.payload === undefined){\n msg.payload = {};\n msg.show = \"hidden\";\n return msg; \n}\nvar displayTimeout = flow.get('displayTimeout')||120000;\n//set msg.topic for use in displaying the correct color\nmsg.topic = msg.payload.Color;\n//reorder list if a Tilt disconnects\nif (msg.payload.clock - msg.payload.timeStamp > displayTimeout){\n flow.set('storage-1',undefined);\n flow.set('storage-2',undefined);\n flow.set('storage-3',undefined);\n flow.set('storage-4',undefined);\n flow.set('storage-5',undefined);\n flow.set('storage-6',undefined);\n flow.set('storage-7',undefined);\n flow.set('storage-8',undefined);\n flow.set('storage-9',undefined);\n flow.set('storage-10',undefined);\n flow.set('storage-11',undefined);\n flow.set('storage-12',undefined);\n flow.set('storage-13',undefined);\n flow.set('storage-14',undefined);\n flow.set('storage-15',undefined);\n flow.set('storage-16',undefined);\n flow.set('storage-17',undefined);\n flow.set('storage-18',undefined);\n flow.set('storage-19',undefined);\n flow.set('storage-20',undefined);\n flow.set('storage-21',undefined);\n flow.set('storage-22',undefined);\n flow.set('storage-23',undefined);\n flow.set('storage-24',undefined);\n flow.set('storage-25',undefined);\n flow.set('options',[]);\n if (msg.topic === flow.get('colordropdownSelect')){\n flow.set('colordropdownSelect',undefined);\n }\n msg.show = \"hidden\";\n return msg;\n}\nelse{\n msg.show = \"visible\";\n return msg;\n}", "outputs": 1, "noerr": 0, - "x": 2530, - "y": 860, + "x": 2610, + "y": 880, "wires": [ [ "2d9318ec.26fb18" @@ -7241,8 +6792,8 @@ "from": "", "to": "", "reg": false, - "x": 2350, - "y": 860, + "x": 2430, + "y": 880, "wires": [ [ "4eddc4d8.fd628c" @@ -7261,8 +6812,8 @@ "crontab": "", "once": false, "onceDelay": "", - "x": 2160, - "y": 860, + "x": 2240, + "y": 880, "wires": [ [ "8d67d3dc.c514e" @@ -7282,8 +6833,8 @@ "storeOutMessages": true, "fwdInMessages": true, "templateScope": "local", - "x": 2750, - "y": 900, + "x": 2830, + "y": 920, "wires": [ [ "1ee5d27c.fa4e8e", @@ -7299,8 +6850,8 @@ "func": "if(msg.payload === undefined){\n msg.payload = {};\n msg.show = \"hidden\";\n return msg; \n}\nvar displayTimeout = flow.get('displayTimeout')||120000;\n//set msg.topic for use in displaying the correct color\nmsg.topic = msg.payload.Color;\n//reorder list if a Tilt disconnects\nif (msg.payload.clock - msg.payload.timeStamp > displayTimeout){\n flow.set('storage-1',undefined);\n flow.set('storage-2',undefined);\n flow.set('storage-3',undefined);\n flow.set('storage-4',undefined);\n flow.set('storage-5',undefined);\n flow.set('storage-6',undefined);\n flow.set('storage-7',undefined);\n flow.set('storage-8',undefined);\n flow.set('storage-9',undefined);\n flow.set('storage-10',undefined);\n flow.set('storage-11',undefined);\n flow.set('storage-12',undefined);\n flow.set('storage-13',undefined);\n flow.set('storage-14',undefined);\n flow.set('storage-15',undefined);\n flow.set('storage-16',undefined);\n flow.set('storage-17',undefined);\n flow.set('storage-18',undefined);\n flow.set('storage-19',undefined);\n flow.set('storage-20',undefined);\n flow.set('storage-21',undefined);\n flow.set('storage-22',undefined);\n flow.set('storage-23',undefined);\n flow.set('storage-24',undefined);\n flow.set('storage-25',undefined);\n flow.set('options',[]);\n if (msg.topic === flow.get('colordropdownSelect')){\n flow.set('colordropdownSelect',undefined);\n }\n msg.show = \"hidden\";\n return msg;\n}\nelse{\n msg.show = \"visible\";\n return msg;\n}", "outputs": 1, "noerr": 0, - "x": 2530, - "y": 900, + "x": 2610, + "y": 920, "wires": [ [ "e58cff3a.8f6cd" @@ -7326,8 +6877,8 @@ "from": "", "to": "", "reg": false, - "x": 2350, - "y": 900, + "x": 2430, + "y": 920, "wires": [ [ "5fc1729f.da123c" @@ -7346,8 +6897,8 @@ "crontab": "", "once": false, "onceDelay": "", - "x": 2160, - "y": 900, + "x": 2240, + "y": 920, "wires": [ [ "ca4b0ee0.4371d" @@ -7365,8 +6916,8 @@ "timer": "", "oldrc": false, "name": "", - "x": 530, - "y": 300, + "x": 610, + "y": 320, "wires": [ [ "3f72b10e.4b106e" @@ -7388,8 +6939,8 @@ "arraySpltType": "len", "stream": true, "addname": "", - "x": 690, - "y": 300, + "x": 770, + "y": 320, "wires": [ [ "f5df2cba.4ec66" @@ -7415,8 +6966,8 @@ "from": "", "to": "", "reg": false, - "x": 820, - "y": 300, + "x": 900, + "y": 320, "wires": [ [ "2c73dfce.b79cc" @@ -7440,8 +6991,8 @@ "checkall": "false", "repair": false, "outputs": 1, - "x": 1090, - "y": 260, + "x": 1170, + "y": 280, "wires": [ [ "cdc2a491.47b908" @@ -7458,8 +7009,8 @@ "console": false, "tostatus": false, "complete": "false", - "x": 1580, - "y": 380, + "x": 1660, + "y": 400, "wires": [] }, { @@ -7477,8 +7028,8 @@ "mode": "text", "delay": "0", "topic": "", - "x": 640, - "y": 2760, + "x": 720, + "y": 2780, "wires": [ [ "71555fdb.854f1" @@ -7496,8 +7047,8 @@ "syntax": "mustache", "template": "https://raw.githubusercontent.com/baronbrew/TILTpi/{{payload}}/flow.json\n", "output": "str", - "x": 810, - "y": 2760, + "x": 890, + "y": 2780, "wires": [ [ "13f0085a.0d5178" @@ -7523,8 +7074,8 @@ "from": "", "to": "", "reg": false, - "x": 590, - "y": 2800, + "x": 670, + "y": 2820, "wires": [ [ "14afaa5e.5b9ff6" @@ -7550,8 +7101,8 @@ "from": "", "to": "", "reg": false, - "x": 1990, - "y": 940, + "x": 2070, + "y": 960, "wires": [ [] ] @@ -7568,8 +7119,8 @@ "crontab": "", "once": false, "onceDelay": "", - "x": 2160, - "y": 940, + "x": 2240, + "y": 960, "wires": [ [ "ec92d732.73b488" @@ -7595,8 +7146,8 @@ "from": "", "to": "", "reg": false, - "x": 2350, - "y": 940, + "x": 2430, + "y": 960, "wires": [ [ "6b2630c1.ee399" @@ -7611,8 +7162,8 @@ "func": "if(msg.payload === undefined){\n msg.payload = {};\n msg.show = \"hidden\";\n return msg; \n}\nvar displayTimeout = flow.get('displayTimeout')||120000;\n//set msg.topic for use in displaying the correct color\nmsg.topic = msg.payload.Color;\n//reorder list if a Tilt disconnects\nif (msg.payload.clock - msg.payload.timeStamp > displayTimeout){\n flow.set('storage-1',undefined);\n flow.set('storage-2',undefined);\n flow.set('storage-3',undefined);\n flow.set('storage-4',undefined);\n flow.set('storage-5',undefined);\n flow.set('storage-6',undefined);\n flow.set('storage-7',undefined);\n flow.set('storage-8',undefined);\n flow.set('storage-9',undefined);\n flow.set('storage-10',undefined);\n flow.set('storage-11',undefined);\n flow.set('storage-12',undefined);\n flow.set('storage-13',undefined);\n flow.set('storage-14',undefined);\n flow.set('storage-15',undefined);\n flow.set('storage-16',undefined);\n flow.set('storage-17',undefined);\n flow.set('storage-18',undefined);\n flow.set('storage-19',undefined);\n flow.set('storage-20',undefined);\n flow.set('storage-21',undefined);\n flow.set('storage-22',undefined);\n flow.set('storage-23',undefined);\n flow.set('storage-24',undefined);\n flow.set('storage-25',undefined);\n flow.set('options',[]);\n if (msg.topic === flow.get('colordropdownSelect')){\n flow.set('colordropdownSelect',undefined);\n }\n msg.show = \"hidden\";\n return msg;\n}\nelse{\n msg.show = \"visible\";\n return msg;\n}", "outputs": 1, "noerr": 0, - "x": 2530, - "y": 940, + "x": 2610, + "y": 960, "wires": [ [ "cf792291.cb942" @@ -7632,8 +7183,8 @@ "storeOutMessages": true, "fwdInMessages": true, "templateScope": "local", - "x": 2750, - "y": 940, + "x": 2830, + "y": 960, "wires": [ [ "394a5d3d.92fa72", @@ -7660,8 +7211,8 @@ "from": "", "to": "", "reg": false, - "x": 1990, - "y": 980, + "x": 2070, + "y": 1000, "wires": [ [] ] @@ -7678,8 +7229,8 @@ "crontab": "", "once": false, "onceDelay": "", - "x": 2160, - "y": 980, + "x": 2240, + "y": 1000, "wires": [ [ "95307bd3.783cc8" @@ -7705,8 +7256,8 @@ "from": "", "to": "", "reg": false, - "x": 2350, - "y": 980, + "x": 2430, + "y": 1000, "wires": [ [ "6b914e1.9bb8eb" @@ -7721,8 +7272,8 @@ "func": "if(msg.payload === undefined){\n msg.payload = {};\n msg.show = \"hidden\";\n return msg; \n}\nvar displayTimeout = flow.get('displayTimeout')||120000;\n//set msg.topic for use in displaying the correct color\nmsg.topic = msg.payload.Color;\n//reorder list if a Tilt disconnects\nif (msg.payload.clock - msg.payload.timeStamp > displayTimeout){\n flow.set('storage-1',undefined);\n flow.set('storage-2',undefined);\n flow.set('storage-3',undefined);\n flow.set('storage-4',undefined);\n flow.set('storage-5',undefined);\n flow.set('storage-6',undefined);\n flow.set('storage-7',undefined);\n flow.set('storage-8',undefined);\n flow.set('storage-9',undefined);\n flow.set('storage-10',undefined);\n flow.set('storage-11',undefined);\n flow.set('storage-12',undefined);\n flow.set('storage-13',undefined);\n flow.set('storage-14',undefined);\n flow.set('storage-15',undefined);\n flow.set('storage-16',undefined);\n flow.set('storage-17',undefined);\n flow.set('storage-18',undefined);\n flow.set('storage-19',undefined);\n flow.set('storage-20',undefined);\n flow.set('storage-21',undefined);\n flow.set('storage-22',undefined);\n flow.set('storage-23',undefined);\n flow.set('storage-24',undefined);\n flow.set('storage-25',undefined);\n flow.set('options',[]);\n if (msg.topic === flow.get('colordropdownSelect')){\n flow.set('colordropdownSelect',undefined);\n }\n msg.show = \"hidden\";\n return msg;\n}\nelse{\n msg.show = \"visible\";\n return msg;\n}", "outputs": 1, "noerr": 0, - "x": 2530, - "y": 980, + "x": 2610, + "y": 1000, "wires": [ [ "a68bf66a.5f1538" @@ -7742,8 +7293,8 @@ "storeOutMessages": true, "fwdInMessages": true, "templateScope": "local", - "x": 2750, - "y": 980, + "x": 2830, + "y": 1000, "wires": [ [ "394a5d3d.92fa72", @@ -7770,8 +7321,8 @@ "from": "", "to": "", "reg": false, - "x": 1990, - "y": 1020, + "x": 2070, + "y": 1040, "wires": [ [] ] @@ -7788,8 +7339,8 @@ "crontab": "", "once": false, "onceDelay": "", - "x": 2160, - "y": 1020, + "x": 2240, + "y": 1040, "wires": [ [ "a7e1f3b1.13f8e" @@ -7815,8 +7366,8 @@ "from": "", "to": "", "reg": false, - "x": 2350, - "y": 1020, + "x": 2430, + "y": 1040, "wires": [ [ "c3bb0e8a.e2ea3" @@ -7831,8 +7382,8 @@ "func": "if(msg.payload === undefined){\n msg.payload = {};\n msg.show = \"hidden\";\n return msg; \n}\nvar displayTimeout = flow.get('displayTimeout')||120000;\n//set msg.topic for use in displaying the correct color\nmsg.topic = msg.payload.Color;\n//reorder list if a Tilt disconnects\nif (msg.payload.clock - msg.payload.timeStamp > displayTimeout){\n flow.set('storage-1',undefined);\n flow.set('storage-2',undefined);\n flow.set('storage-3',undefined);\n flow.set('storage-4',undefined);\n flow.set('storage-5',undefined);\n flow.set('storage-6',undefined);\n flow.set('storage-7',undefined);\n flow.set('storage-8',undefined);\n flow.set('storage-9',undefined);\n flow.set('storage-10',undefined);\n flow.set('storage-11',undefined);\n flow.set('storage-12',undefined);\n flow.set('storage-13',undefined);\n flow.set('storage-14',undefined);\n flow.set('storage-15',undefined);\n flow.set('storage-16',undefined);\n flow.set('storage-17',undefined);\n flow.set('storage-18',undefined);\n flow.set('storage-19',undefined);\n flow.set('storage-20',undefined);\n flow.set('storage-21',undefined);\n flow.set('storage-22',undefined);\n flow.set('storage-23',undefined);\n flow.set('storage-24',undefined);\n flow.set('storage-25',undefined);\n flow.set('options',[]);\n if (msg.topic === flow.get('colordropdownSelect')){\n flow.set('colordropdownSelect',undefined);\n }\n msg.show = \"hidden\";\n return msg;\n}\nelse{\n msg.show = \"visible\";\n return msg;\n}", "outputs": 1, "noerr": 0, - "x": 2530, - "y": 1020, + "x": 2610, + "y": 1040, "wires": [ [ "9d398dc.08dc57" @@ -7852,8 +7403,8 @@ "storeOutMessages": true, "fwdInMessages": true, "templateScope": "local", - "x": 2750, - "y": 1020, + "x": 2830, + "y": 1040, "wires": [ [ "394a5d3d.92fa72", @@ -7880,8 +7431,8 @@ "from": "", "to": "", "reg": false, - "x": 1990, - "y": 1060, + "x": 2070, + "y": 1080, "wires": [ [] ] @@ -7898,8 +7449,8 @@ "crontab": "", "once": false, "onceDelay": "", - "x": 2160, - "y": 1060, + "x": 2240, + "y": 1080, "wires": [ [ "8843e2c8.51bdf" @@ -7925,8 +7476,8 @@ "from": "", "to": "", "reg": false, - "x": 2350, - "y": 1060, + "x": 2430, + "y": 1080, "wires": [ [ "6d524c1c.8009f4" @@ -7941,8 +7492,8 @@ "func": "if(msg.payload === undefined){\n msg.payload = {};\n msg.show = \"hidden\";\n return msg; \n}\nvar displayTimeout = flow.get('displayTimeout')||120000;\n//set msg.topic for use in displaying the correct color\nmsg.topic = msg.payload.Color;\n//reorder list if a Tilt disconnects\nif (msg.payload.clock - msg.payload.timeStamp > displayTimeout){\n flow.set('storage-1',undefined);\n flow.set('storage-2',undefined);\n flow.set('storage-3',undefined);\n flow.set('storage-4',undefined);\n flow.set('storage-5',undefined);\n flow.set('storage-6',undefined);\n flow.set('storage-7',undefined);\n flow.set('storage-8',undefined);\n flow.set('storage-9',undefined);\n flow.set('storage-10',undefined);\n flow.set('storage-11',undefined);\n flow.set('storage-12',undefined);\n flow.set('storage-13',undefined);\n flow.set('storage-14',undefined);\n flow.set('storage-15',undefined);\n flow.set('storage-16',undefined);\n flow.set('storage-17',undefined);\n flow.set('storage-18',undefined);\n flow.set('storage-19',undefined);\n flow.set('storage-20',undefined);\n flow.set('storage-21',undefined);\n flow.set('storage-22',undefined);\n flow.set('storage-23',undefined);\n flow.set('storage-24',undefined);\n flow.set('storage-25',undefined);\n flow.set('options',[]);\n if (msg.topic === flow.get('colordropdownSelect')){\n flow.set('colordropdownSelect',undefined);\n }\n msg.show = \"hidden\";\n return msg;\n}\nelse{\n msg.show = \"visible\";\n return msg;\n}", "outputs": 1, "noerr": 0, - "x": 2530, - "y": 1060, + "x": 2610, + "y": 1080, "wires": [ [ "96d4a8e7.f414a8" @@ -7962,8 +7513,8 @@ "storeOutMessages": true, "fwdInMessages": true, "templateScope": "local", - "x": 2750, - "y": 1060, + "x": 2830, + "y": 1080, "wires": [ [ "394a5d3d.92fa72", @@ -7990,8 +7541,8 @@ "from": "", "to": "", "reg": false, - "x": 1990, - "y": 1100, + "x": 2070, + "y": 1120, "wires": [ [] ] @@ -8008,8 +7559,8 @@ "crontab": "", "once": false, "onceDelay": "", - "x": 2160, - "y": 1100, + "x": 2240, + "y": 1120, "wires": [ [ "da4dbd71.50463" @@ -8035,8 +7586,8 @@ "from": "", "to": "", "reg": false, - "x": 2350, - "y": 1100, + "x": 2430, + "y": 1120, "wires": [ [ "4200342b.ee6e5c" @@ -8051,8 +7602,8 @@ "func": "if(msg.payload === undefined){\n msg.payload = {};\n msg.show = \"hidden\";\n return msg; \n}\nvar displayTimeout = flow.get('displayTimeout')||120000;\n//set msg.topic for use in displaying the correct color\nmsg.topic = msg.payload.Color;\n//reorder list if a Tilt disconnects\nif (msg.payload.clock - msg.payload.timeStamp > displayTimeout){\n flow.set('storage-1',undefined);\n flow.set('storage-2',undefined);\n flow.set('storage-3',undefined);\n flow.set('storage-4',undefined);\n flow.set('storage-5',undefined);\n flow.set('storage-6',undefined);\n flow.set('storage-7',undefined);\n flow.set('storage-8',undefined);\n flow.set('storage-9',undefined);\n flow.set('storage-10',undefined);\n flow.set('storage-11',undefined);\n flow.set('storage-12',undefined);\n flow.set('storage-13',undefined);\n flow.set('storage-14',undefined);\n flow.set('storage-15',undefined);\n flow.set('storage-16',undefined);\n flow.set('storage-17',undefined);\n flow.set('storage-18',undefined);\n flow.set('storage-19',undefined);\n flow.set('storage-20',undefined);\n flow.set('storage-21',undefined);\n flow.set('storage-22',undefined);\n flow.set('storage-23',undefined);\n flow.set('storage-24',undefined);\n flow.set('storage-25',undefined);\n flow.set('options',[]);\n if (msg.topic === flow.get('colordropdownSelect')){\n flow.set('colordropdownSelect',undefined);\n }\n msg.show = \"hidden\";\n return msg;\n}\nelse{\n msg.show = \"visible\";\n return msg;\n}", "outputs": 1, "noerr": 0, - "x": 2530, - "y": 1100, + "x": 2610, + "y": 1120, "wires": [ [ "b8172640.fdaf28" @@ -8072,8 +7623,8 @@ "storeOutMessages": true, "fwdInMessages": true, "templateScope": "local", - "x": 2750, - "y": 1100, + "x": 2830, + "y": 1120, "wires": [ [ "394a5d3d.92fa72", @@ -8086,8 +7637,8 @@ "type": "ui_ui_control", "z": "a564595f.642818", "name": "", - "x": 1240, - "y": 3520, + "x": 1320, + "y": 3540, "wires": [ [] ] @@ -8115,8 +7666,8 @@ "offvalueType": "bool", "officon": "", "offcolor": "", - "x": 520, - "y": 3440, + "x": 600, + "y": 3460, "wires": [ [ "1bd050cb.503d1f" @@ -8149,8 +7700,8 @@ "from": "", "to": "", "reg": false, - "x": 710, - "y": 3420, + "x": 790, + "y": 3440, "wires": [ [ "87e1a3b9.13fb6" @@ -8172,8 +7723,8 @@ "randomLast": "5", "randomUnits": "seconds", "drop": false, - "x": 900, - "y": 3440, + "x": 980, + "y": 3460, "wires": [ [ "bc47cb99.cb1a18" @@ -8199,8 +7750,8 @@ "from": "", "to": "", "reg": false, - "x": 1120, - "y": 3440, + "x": 1200, + "y": 3460, "wires": [ [] ] @@ -8210,8 +7761,8 @@ "type": "ui_ui_control", "z": "a564595f.642818", "name": "", - "x": 520, - "y": 860, + "x": 600, + "y": 880, "wires": [ [ "9215e4a9.c3af38" @@ -8237,8 +7788,8 @@ "from": "", "to": "", "reg": false, - "x": 680, - "y": 860, + "x": 760, + "y": 880, "wires": [ [ "423412c2.1b104c" @@ -8253,8 +7804,8 @@ "links": [ "e829c02e.da7e1" ], - "x": 1580, - "y": 180, + "x": 1660, + "y": 200, "wires": [] }, { @@ -8265,8 +7816,8 @@ "links": [ "e493bf39.98126" ], - "x": 695, - "y": 920, + "x": 775, + "y": 940, "wires": [ [ "423412c2.1b104c" @@ -8291,8 +7842,8 @@ "checkall": "true", "repair": false, "outputs": 2, - "x": 770, - "y": 3520, + "x": 850, + "y": 3540, "wires": [ [ "b7da9395.ce5ca" @@ -8321,8 +7872,8 @@ "from": "", "to": "", "reg": false, - "x": 990, - "y": 3500, + "x": 1070, + "y": 3520, "wires": [ [ "712aa79c.da4988" @@ -8348,8 +7899,8 @@ "from": "", "to": "", "reg": false, - "x": 990, - "y": 3540, + "x": 1070, + "y": 3560, "wires": [ [ "712aa79c.da4988" @@ -8361,8 +7912,8 @@ "type": "ui_ui_control", "z": "a564595f.642818", "name": "", - "x": 460, - "y": 3520, + "x": 540, + "y": 3540, "wires": [ [ "45d0c134.d6bcf" @@ -8388,8 +7939,8 @@ "from": "", "to": "", "reg": false, - "x": 630, - "y": 3520, + "x": 710, + "y": 3540, "wires": [ [ "84b471d.dd3d59" @@ -8408,8 +7959,8 @@ "crontab": "", "once": true, "onceDelay": "8", - "x": 460, - "y": 3320, + "x": 540, + "y": 3340, "wires": [ [ "be79385c.484a28" @@ -8424,8 +7975,8 @@ "func": "var smoothSwitch = flow.get('smoothSwitch')||false;\nif (smoothSwitch && msg.payload.SG > 0.5){\nvar color = msg.payload.Color;\nvar SG = msg.payload.SG;\nvar Temp = msg.payload.Temp;\nvar alphaSG = flow.get('alphaSG') / 100||0.5;//ratio of current sample vs. average of previous samples over sample rate\nvar alphaTemp = flow.get('alphaTemp') / 100||0.5;//ratio of current sample vs. average of previous samples over sample rate\nvar numberSamples = flow.get('numberSamples') * 12 || 36;//multiply this number by sample rate to determine timeframe of moving average\nvar sampleRate = 5000;//measurements on Tilt taken every 5 seconds\nvar timeSinceLastSample = context.get(color + '-timeSinceLastSample')||sampleRate;\nvar prevSampleTime = context.get(color + '-prevSampleTime')||msg.payload.timeStamp;\nvar sampleTakenFlag = context.get(color + '-sampleTakenFlag')||\"not taken\";\nvar prevSGArray = context.get(color + '-SG')||[];\nvar prevTempArray = context.get(color + '-Temp')||[];\nif (timeSinceLastSample >= sampleRate && sampleTakenFlag == \"not taken\"){//take sample if time elapsed is more than sample rate\n context.set(color + '-sampleTakenFlag', \"taken\");\n prevSGArray.push(SG);\n prevTempArray.push(Temp);\n if (prevSGArray.length > numberSamples || prevTempArray.length > numberSamples){\n prevSGArray.shift();\n prevTempArray.shift();\n }\n context.set(color + '-SG', prevSGArray);\n context.set(color + '-Temp', prevTempArray);\n context.set(color + '-prevSampleTime', msg.payload.timeStamp);\n}else{\n context.set(color + '-sampleTakenFlag', \"not taken\")\n}\ntimeSinceLastSample = msg.payload.timeStamp - prevSampleTime;\ncontext.set(color + '-timeSinceLastSample', timeSinceLastSample)\n//calculate means\nvar totalSG = 0;\nfor(var i = 0; i < prevSGArray.length; i++) {\n totalSG += prevSGArray[i];\n}\nvar meanSG = totalSG / prevSGArray.length;\nmsg.payload.SG = ((SG * (1 - alphaSG)) + (meanSG * alphaSG));\nvar totalTemp = 0;\nfor(var i = 0; i < prevTempArray.length; i++) {\n totalTemp += prevTempArray[i];\n}\nvar meanTemp = totalTemp / prevTempArray.length;\nmsg.payload.Temp = ((Temp * (1 - alphaTemp)) + (meanTemp * alphaTemp));\n}\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 1440, - "y": 120, + "x": 1520, + "y": 140, "wires": [ [ "86447ba5.5d5b68" @@ -8455,8 +8006,8 @@ "offvalueType": "bool", "officon": "", "offcolor": "", - "x": 470, - "y": 3660, + "x": 550, + "y": 3680, "wires": [ [ "78939739.e7eac8" @@ -8482,8 +8033,8 @@ "from": "", "to": "", "reg": false, - "x": 710, - "y": 3660, + "x": 790, + "y": 3680, "wires": [ [] ] @@ -8507,8 +8058,8 @@ "from": "", "to": "", "reg": false, - "x": 750, - "y": 3740, + "x": 830, + "y": 3760, "wires": [ [] ] @@ -8532,8 +8083,8 @@ "from": "", "to": "", "reg": false, - "x": 750, - "y": 3820, + "x": 830, + "y": 3840, "wires": [ [] ] @@ -8555,8 +8106,8 @@ "min": 0, "max": "120", "step": ".1", - "x": 510, - "y": 3900, + "x": 590, + "y": 3920, "wires": [ [ "349b10e1.3c62c" @@ -8582,8 +8133,8 @@ "from": "", "to": "", "reg": false, - "x": 790, - "y": 3900, + "x": 870, + "y": 3920, "wires": [ [] ] @@ -8605,8 +8156,8 @@ "min": "1", "max": "100", "step": "1", - "x": 500, - "y": 3820, + "x": 580, + "y": 3840, "wires": [ [ "a99b227e.f6b3" @@ -8630,8 +8181,8 @@ "min": "1", "max": "100", "step": "1", - "x": 500, - "y": 3740, + "x": 580, + "y": 3760, "wires": [ [ "abb434fc.fa72a8" @@ -8650,8 +8201,8 @@ "crontab": "", "once": true, "onceDelay": "8", - "x": 210, - "y": 3660, + "x": 290, + "y": 3680, "wires": [ [ "69de6eed.51ee3" @@ -8670,8 +8221,8 @@ "crontab": "", "once": true, "onceDelay": "8", - "x": 220, - "y": 3740, + "x": 300, + "y": 3760, "wires": [ [ "4c545b57.8a8e44" @@ -8690,8 +8241,8 @@ "crontab": "", "once": true, "onceDelay": "8", - "x": 200, - "y": 3820, + "x": 280, + "y": 3840, "wires": [ [ "bc58593a.8338b8" @@ -8710,12 +8261,695 @@ "crontab": "", "once": true, "onceDelay": "8", - "x": 220, - "y": 3900, + "x": 300, + "y": 3920, "wires": [ [ "b8cf9d8c.26898" ] ] + }, + { + "id": "26d12db4.df7f82", + "type": "ui_numeric", + "z": "a564595f.642818", + "name": "", + "label": "Enter Pre-cal/Tilt SG", + "tooltip": "", + "group": "6acae0b0.a184", + "order": 2, + "width": "0", + "height": "0", + "passthru": false, + "topic": "", + "format": "{{msg.payload}}", + "min": "0.9900", + "max": "1.1200", + "step": ".0001", + "x": 2600, + "y": 1480, + "wires": [ + [ + "777f1a14.1b3e44", + "ba7658fb.988088" + ] + ] + }, + { + "id": "8756395a.c6f6e8", + "type": "ui_numeric", + "z": "a564595f.642818", + "name": "", + "label": "Enter Actual SG", + "tooltip": "", + "group": "6acae0b0.a184", + "order": 4, + "width": "0", + "height": "0", + "passthru": false, + "topic": "", + "format": "{{msg.payload}}", + "min": "0.990", + "max": "1.200", + "step": ".0001", + "x": 2580, + "y": 1540, + "wires": [ + [ + "84ffe685.150d58", + "ba7658fb.988088" + ] + ] + }, + { + "id": "2b26e418.b14aec", + "type": "ui_button", + "z": "a564595f.642818", + "name": "", + "group": "6acae0b0.a184", + "order": 5, + "width": 0, + "height": 0, + "passthru": false, + "label": "Calibrate in Known SG", + "tooltip": "", + "color": "", + "bgcolor": "", + "icon": "", + "payload": "colordropdownSelect", + "payloadType": "flow", + "topic": "", + "x": 2740, + "y": 1820, + "wires": [ + [ + "6c6270ad.ae742" + ] + ] + }, + { + "id": "7edb039d.78073c", + "type": "ui_button", + "z": "a564595f.642818", + "name": "", + "group": "6acae0b0.a184", + "order": 1, + "width": 0, + "height": 0, + "passthru": false, + "label": "Calibrate in Water", + "tooltip": "", + "color": "", + "bgcolor": "", + "icon": "", + "payload": "colordropdownSelect", + "payloadType": "flow", + "topic": "calibrate in water", + "x": 2730, + "y": 1740, + "wires": [ + [ + "6c6270ad.ae742" + ] + ] + }, + { + "id": "483fead5.b9c834", + "type": "ui_switch", + "z": "a564595f.642818", + "name": "", + "label": "Get Current SG", + "tooltip": "", + "group": "6acae0b0.a184", + "order": 3, + "width": 0, + "height": 0, + "passthru": true, + "decouple": "false", + "topic": "", + "style": "", + "onvalue": "enabled", + "onvalueType": "str", + "onicon": "", + "oncolor": "", + "offvalue": "disabled", + "offvalueType": "str", + "officon": "", + "offcolor": "", + "x": 1760, + "y": 1520, + "wires": [ + [ + "3eb6f3c4.588d1c" + ] + ] + }, + { + "id": "58debd3d.af16a4", + "type": "inject", + "z": "a564595f.642818", + "name": "Color", + "topic": "", + "payload": "colordropdownSelect", + "payloadType": "flow", + "repeat": "1", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "x": 1910, + "y": 1460, + "wires": [ + [ + "3eb6f3c4.588d1c", + "d6de2020.56974" + ] + ] + }, + { + "id": "18df7203.454ade", + "type": "inject", + "z": "a564595f.642818", + "name": "", + "topic": "", + "payload": "enabled", + "payloadType": "str", + "repeat": "", + "crontab": "", + "once": true, + "onceDelay": 0.1, + "x": 1580, + "y": 1520, + "wires": [ + [ + "483fead5.b9c834" + ] + ] + }, + { + "id": "ba7658fb.988088", + "type": "link out", + "z": "a564595f.642818", + "name": "sg calibration update", + "links": [ + "22133d6c.455a72" + ], + "x": 2795, + "y": 1380, + "wires": [] + }, + { + "id": "22133d6c.455a72", + "type": "link in", + "z": "a564595f.642818", + "name": "sg calibration update", + "links": [ + "ba7658fb.988088" + ], + "x": 1475, + "y": 1620, + "wires": [ + [ + "b47e694e.3ce3c8" + ] + ] + }, + { + "id": "b47e694e.3ce3c8", + "type": "change", + "z": "a564595f.642818", + "name": "Disabled", + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "disabled", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 1560, + "y": 1560, + "wires": [ + [ + "483fead5.b9c834" + ] + ] + }, + { + "id": "3b195e06.c8f962", + "type": "function", + "z": "a564595f.642818", + "name": "SG Calibration Table", + "func": "var color = msg.topic;\nmsg.uncalpointsArray = flow.get('uncalSGpoints-' + color)||[];\nmsg.actualpointsArray = flow.get('actualSGpoints-' + color)||[];\nif (typeof msg.uncalpointsArray == \"string\" || typeof msg.actualpointsArray == \"string\"){\n msg.uncalpointsArray = msg.uncalpointsArray.split(\",\");\n msg.actualpointsArray = msg.actualpointsArray.split(\",\");\n}\nif (msg.uncalpointsArray[0] === undefined){\n msg.row0 = 'hidden'\n}else{\nmsg.row0 = 'visible';\n}\nif (msg.uncalpointsArray[1] === undefined){\n msg.row1 = 'hidden'\n}else{\nmsg.row1 = 'visible';\n}\nif (msg.uncalpointsArray[2] === undefined){\n msg.row2 = 'hidden'\n}else{\nmsg.row2 = 'visible';\n}\nif (msg.uncalpointsArray[3] === undefined){\n msg.row3 = 'hidden'\n}else{\nmsg.row3 = 'visible';\n}\nif (msg.uncalpointsArray[4] === undefined){\n msg.row4 = 'hidden'\n}else{\nmsg.row4 = 'visible';\n}\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 3280, + "y": 1740, + "wires": [ + [ + "44aae1a8.7f6b3" + ] + ] + }, + { + "id": "44aae1a8.7f6b3", + "type": "ui_template", + "z": "a564595f.642818", + "group": "6acae0b0.a184", + "name": "SG Calibration Points", + "order": 6, + "width": "0", + "height": "0", + "format": "\n\n\n\n\n

SG Calibration Points:

\n\n \n \n \n \n \n \n
DeletePre-Cal/TiltActual
X{{msg.uncalpointsArray[0]}}{{msg.actualpointsArray[0]}}
X{{msg.uncalpointsArray[1]}}{{msg.actualpointsArray[1]}}
X{{msg.uncalpointsArray[2]}}{{msg.actualpointsArray[2]}}
X{{msg.uncalpointsArray[3]}}{{msg.actualpointsArray[3]}}
X{{msg.uncalpointsArray[4]}}{{msg.actualpointsArray[4]}}
\n", + "storeOutMessages": false, + "fwdInMessages": false, + "templateScope": "local", + "x": 3520, + "y": 1740, + "wires": [ + [ + "25ccc367.8d427c" + ] + ] + }, + { + "id": "5a6c003b.37e3", + "type": "ui_button", + "z": "a564595f.642818", + "name": "", + "group": "6acae0b0.a184", + "order": 7, + "width": 0, + "height": 0, + "passthru": false, + "label": "Delete All", + "tooltip": "", + "color": "", + "bgcolor": "#FF5733", + "icon": "", + "payload": "colordropdownSelect", + "payloadType": "flow", + "topic": "clear calibration", + "x": 2720, + "y": 1780, + "wires": [ + [ + "6c6270ad.ae742" + ] + ] + }, + { + "id": "25ccc367.8d427c", + "type": "function", + "z": "a564595f.642818", + "name": "Remove SG Cal Point", + "func": "var calpointIndex = Number(msg.payload);\nvar color = flow.get('colordropdownSelect');\nvar uncalpointsArray = flow.get('uncalSGpoints-' + color)||[];\nvar actualpointsArray = flow.get('actualSGpoints-' + color)||[];\nif (typeof uncalpointsArray == \"string\" || typeof actualpointsArray == \"string\"){\n uncalpointsArray = uncalpointsArray.split(\",\");\n actualpointsArray = actualpointsArray.split(\",\");\n}\nuncalpointsArray.splice(calpointIndex,1);\nactualpointsArray.splice(calpointIndex,1);\nflow.set('uncalSGpoints-' + color,uncalpointsArray);\nflow.set('actualSGpoints-' + color,actualpointsArray);\nmsg.topic = color;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 3500, + "y": 1940, + "wires": [ + [ + "3b195e06.c8f962" + ] + ] + }, + { + "id": "8cb2d9.bccfcd28", + "type": "ui_button", + "z": "a564595f.642818", + "name": "", + "group": "c12bcb12.dbd0d8", + "order": 7, + "width": 0, + "height": 0, + "passthru": false, + "label": "Delete All", + "tooltip": "", + "color": "", + "bgcolor": "#FF5733", + "icon": "", + "payload": "colordropdownSelect", + "payloadType": "flow", + "topic": "clear calibration", + "x": 2320, + "y": 2140, + "wires": [ + [ + "c78e4ac7.89ba88" + ] + ] + }, + { + "id": "a4aa0e4b.1999d", + "type": "ui_button", + "z": "a564595f.642818", + "name": "", + "group": "c12bcb12.dbd0d8", + "order": 5, + "width": 0, + "height": 0, + "passthru": false, + "label": "Calibrate in Known Temp", + "tooltip": "", + "color": "", + "bgcolor": "", + "icon": "", + "payload": "colordropdownSelect", + "payloadType": "flow", + "topic": "", + "x": 2350, + "y": 2200, + "wires": [ + [ + "c78e4ac7.89ba88" + ] + ] + }, + { + "id": "c78e4ac7.89ba88", + "type": "function", + "z": "a564595f.642818", + "name": "Add Temp Cal Points", + "func": "var color = msg.payload;\nif (msg.topic == \"clear calibration\"){\n flow.set('uncalTemppoints-' + color,[]);\n flow.set('actualTemppoints-' + color,[]);\n}else{\nvar uncalTempcalPoint = flow.get('uncalTemppoint')||0;\nvar actualTempcalPoint = flow.get('actualTemppoint')||0;\nif (msg.topic == \"calibrate in ice water\"){\n if (flow.get(\"displayUnits\") == \"°F\"){\n actualTempcalPoint = \"32.0\";\n }else{\n actualTempcalPoint = \"0.0\"\n }\n \n}\nvar uncalpointsArray = flow.get('uncalTemppoints-' + color)||[];\nvar actualpointsArray = flow.get('actualTemppoints-' + color)||[];\nuncalpointsArray.push(uncalTempcalPoint);\nuncalpointsArray.sort(function(a, b){return a-b;});\nflow.set('uncalTemppoints-' + color,uncalpointsArray);\nactualpointsArray.push(actualTempcalPoint);\nactualpointsArray.sort(function(a, b){return a-b;});\nflow.set('actualTemppoints-' + color,actualpointsArray);\n}\nmsg.topic = color;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 2640, + "y": 2140, + "wires": [ + [ + "518cb266.0001dc" + ] + ] + }, + { + "id": "518cb266.0001dc", + "type": "function", + "z": "a564595f.642818", + "name": "Temp Calibration Table", + "func": "var color = msg.topic;\nmsg.uncalpointsArray = flow.get('uncalTemppoints-' + color)||[];\nmsg.actualpointsArray = flow.get('actualTemppoints-' + color)||[];\nif (typeof msg.uncalpointsArray == \"string\" || typeof msg.actualpointsArray == \"string\"){\n msg.uncalpointsArray = msg.uncalpointsArray.split(\",\");\n msg.actualpointsArray = msg.actualpointsArray.split(\",\");\n}\nif (msg.uncalpointsArray[0] === undefined){\n msg.row0 = 'hidden'\n}else{\nmsg.row0 = 'visible';\n}\nif (msg.uncalpointsArray[1] === undefined){\n msg.row1 = 'hidden'\n}else{\nmsg.row1 = 'visible';\n}\nif (msg.uncalpointsArray[2] === undefined){\n msg.row2 = 'hidden'\n}else{\nmsg.row2 = 'visible';\n}\nif (msg.uncalpointsArray[3] === undefined){\n msg.row3 = 'hidden'\n}else{\nmsg.row3 = 'visible';\n}\nif (msg.uncalpointsArray[4] === undefined){\n msg.row4 = 'hidden'\n}else{\nmsg.row4 = 'visible';\n}\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 2900, + "y": 2140, + "wires": [ + [ + "1eb8ab12.557895" + ] + ] + }, + { + "id": "1eb8ab12.557895", + "type": "ui_template", + "z": "a564595f.642818", + "group": "c12bcb12.dbd0d8", + "name": "Temp Calibration Points", + "order": 6, + "width": "0", + "height": "0", + "format": "\n\n\n\n\n

Temp Calibration Points:

\n\n \n \n \n \n \n \n
DeletePre-Cal/TiltActual
X{{msg.uncalpointsArray[0]}}{{msg.actualpointsArray[0]}}
X{{msg.uncalpointsArray[1]}}{{msg.actualpointsArray[1]}}
X{{msg.uncalpointsArray[2]}}{{msg.actualpointsArray[2]}}
X{{msg.uncalpointsArray[3]}}{{msg.actualpointsArray[3]}}
X{{msg.uncalpointsArray[4]}}{{msg.actualpointsArray[4]}}
\n", + "storeOutMessages": false, + "fwdInMessages": false, + "templateScope": "local", + "x": 3150, + "y": 2140, + "wires": [ + [ + "4ee1ce04.5d" + ] + ] + }, + { + "id": "4ee1ce04.5d", + "type": "function", + "z": "a564595f.642818", + "name": "Remove Temp Cal Point", + "func": "var calpointIndex = Number(msg.payload);\nvar color = flow.get('colordropdownSelect');\nvar uncalpointsArray = flow.get('uncalTemppoints-' + color)||[];\nvar actualpointsArray = flow.get('actualTemppoints-' + color)||[];\nif (typeof uncalpointsArray == \"string\" || typeof actualpointsArray == \"string\"){\n uncalpointsArray = uncalpointsArray.split(\",\");\n actualpointsArray = actualpointsArray.split(\",\");\n}\nuncalpointsArray.splice(calpointIndex,1);\nactualpointsArray.splice(calpointIndex,1);\nflow.set('uncalTemppoints-' + color,uncalpointsArray);\nflow.set('actualTemppoints-' + color,actualpointsArray);\nmsg.topic = color;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 3110, + "y": 2300, + "wires": [ + [ + "518cb266.0001dc" + ] + ] + }, + { + "id": "ee2ae6f4.9089f8", + "type": "ui_numeric", + "z": "a564595f.642818", + "name": "", + "label": "Enter Pre-cal/Tilt Temp", + "tooltip": "", + "group": "c12bcb12.dbd0d8", + "order": 2, + "width": "0", + "height": "0", + "passthru": false, + "topic": "", + "format": "{{msg.payload}}", + "min": "-20", + "max": "220", + "step": ".1", + "x": 2600, + "y": 1580, + "wires": [ + [ + "67b168fa.e90078", + "4e784ef2.20482" + ] + ] + }, + { + "id": "1381f934.df5b27", + "type": "ui_numeric", + "z": "a564595f.642818", + "name": "", + "label": "Enter Actual Temp", + "tooltip": "", + "group": "c12bcb12.dbd0d8", + "order": 4, + "width": "0", + "height": "0", + "passthru": false, + "topic": "", + "format": "{{msg.payload}}", + "min": "-20", + "max": "220", + "step": ".1", + "x": 2610, + "y": 1620, + "wires": [ + [ + "37e5d681.345a7a", + "4e784ef2.20482" + ] + ] + }, + { + "id": "37e5d681.345a7a", + "type": "function", + "z": "a564595f.642818", + "name": "set Actual Temp Value", + "func": "var value = Number(msg.payload);\nflow.set('actualTemppoint',value.toFixed(1));\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 2860, + "y": 1660, + "wires": [ + [] + ] + }, + { + "id": "31140e5b.ae7102", + "type": "ui_ui_control", + "z": "a564595f.642818", + "name": "", + "x": 1360, + "y": 1740, + "wires": [ + [ + "2c202db.f124dd2" + ] + ] + }, + { + "id": "2c202db.f124dd2", + "type": "change", + "z": "a564595f.642818", + "name": "Update Local Logging Interval", + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "localloggingInterval", + "tot": "flow" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 1590, + "y": 1740, + "wires": [ + [ + "7b1370e2.6e8c9" + ] + ] + }, + { + "id": "4e784ef2.20482", + "type": "link out", + "z": "a564595f.642818", + "name": "temp calibration update", + "links": [ + "5a61d854.c47468" + ], + "x": 2855, + "y": 1560, + "wires": [] + }, + { + "id": "5a61d854.c47468", + "type": "link in", + "z": "a564595f.642818", + "name": "temp calibration update", + "links": [ + "4e784ef2.20482" + ], + "x": 1520, + "y": 1680, + "wires": [ + [ + "4419c6f1.d35ca8" + ] + ] + }, + { + "id": "4419c6f1.d35ca8", + "type": "change", + "z": "a564595f.642818", + "name": "Disabled", + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "disabled", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 1640, + "y": 1680, + "wires": [ + [ + "dfd8fe97.8ff78" + ] + ] + }, + { + "id": "a1cbb161.09291", + "type": "inject", + "z": "a564595f.642818", + "name": "", + "topic": "", + "payload": "enabled", + "payloadType": "str", + "repeat": "", + "crontab": "", + "once": true, + "onceDelay": 0.1, + "x": 1600, + "y": 1620, + "wires": [ + [ + "dfd8fe97.8ff78" + ] + ] + }, + { + "id": "dfd8fe97.8ff78", + "type": "ui_switch", + "z": "a564595f.642818", + "name": "", + "label": "Get Current Temp", + "tooltip": "", + "group": "c12bcb12.dbd0d8", + "order": 3, + "width": 0, + "height": 0, + "passthru": true, + "decouple": "false", + "topic": "", + "style": "", + "onvalue": "enabled", + "onvalueType": "str", + "onicon": "", + "oncolor": "", + "offvalue": "disabled", + "offvalueType": "str", + "officon": "", + "offcolor": "", + "x": 1790, + "y": 1640, + "wires": [ + [ + "d6de2020.56974" + ] + ] + }, + { + "id": "e53f4a.4ede80b8", + "type": "ui_ui_control", + "z": "a564595f.642818", + "name": "", + "x": 580, + "y": 2340, + "wires": [ + [ + "a1357f50.ee57a", + "9fa076ac.17f568" + ] + ] + }, + { + "id": "757b57b9.6d63a8", + "type": "ui_button", + "z": "a564595f.642818", + "name": "", + "group": "c12bcb12.dbd0d8", + "order": 1, + "width": 0, + "height": 0, + "passthru": false, + "label": "Calibrate in Ice Water", + "tooltip": "", + "color": "", + "bgcolor": "", + "icon": "", + "payload": "colordropdownSelect", + "payloadType": "flow", + "topic": "calibrate in ice water", + "x": 2340, + "y": 2080, + "wires": [ + [ + "c78e4ac7.89ba88" + ] + ] } ] \ No newline at end of file