[ { "id": "1c7ae53.876909b", "type": "ttn uplink", "z": "bd5bf661.bb8ae", "name": "", "app": "89c60a80.0f9fb8", "dev_id": "device-victor", "field": "", "x": 160, "y": 100, "wires": [ [ "128e0e40.d1270a", "34234073.6bc1e8" ] ] }, { "id": "128e0e40.d1270a", "type": "debug", "z": "bd5bf661.bb8ae", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "x": 510, "y": 100, "wires": [] }, { "id": "34234073.6bc1e8", "type": "function", "z": "bd5bf661.bb8ae", "name": "buffer -> string", "func": "var nQuants = msg.payload.length;\nvar i,n;\nvar szC = \"\",sz = \"\";\n\nfor(i = 0 ; i < nQuants ; i++){\n n = msg.payload[i];\n sz = n.toString(16);\n if(sz.length == 1)\n sz = \"0\"+sz;\n szC += sz;\n}\nmsg.payload = szC;\n\nreturn msg;", "outputs": 1, "noerr": 0, "x": 350, "y": 200, "wires": [ [ "2cefff99.ab027", "fd3f332b.f6a35" ] ] }, { "id": "2cefff99.ab027", "type": "debug", "z": "bd5bf661.bb8ae", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "x": 560, "y": 200, "wires": [] }, { "id": "fd3f332b.f6a35", "type": "function", "z": "bd5bf661.bb8ae", "name": "Minimum of 2 seconds for a new info", "func": "var currentDate = new Date().toISOString();\nvar timestamp = Date.parse(currentDate);\nif(flow.get(\"LAST_SENT\")+2000 < timestamp){\n flow.set(\"LAST_SENT\",timestamp);\n return msg;\n}", "outputs": 1, "noerr": 0, "x": 410, "y": 260, "wires": [ [ "2eba9e46.2cc29a" ] ] }, { "id": "9e9289aa.cf676", "type": "inject", "z": "bd5bf661.bb8ae", "name": "", "topic": "", "payload": "", "payloadType": "date", "repeat": "", "crontab": "", "once": true, "onceDelay": 0.1, "x": 170, "y": 40, "wires": [ [ "92eba1eb.905f08" ] ] }, { "id": "92eba1eb.905f08", "type": "function", "z": "bd5bf661.bb8ae", "name": "LAST_SENT = 0", "func": "flow.set(\"LAST_SENT\",0);\nreturn msg;", "outputs": 1, "noerr": 0, "x": 390, "y": 40, "wires": [ [] ] }, { "id": "2eba9e46.2cc29a", "type": "function", "z": "bd5bf661.bb8ae", "name": "12 -> 3x4", "func": "var T = {payload: (msg.payload.substring(0,8))};\nvar RH = {payload: (msg.payload.substring(8,16))};\nvar P = {payload: (msg.payload.substring(16,24))};\n\nreturn [T,RH,P];", "outputs": 3, "noerr": 0, "x": 180, "y": 380, "wires": [ [ "ba983339.5c0718" ], [ "57bd0e21.f9e2a8" ], [ "1dc42f0a.b48e09" ] ] }, { "id": "4e606e98.17e5a8", "type": "debug", "z": "bd5bf661.bb8ae", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "x": 670, "y": 340, "wires": [] }, { "id": "b6f2d934.8f9448", "type": "debug", "z": "bd5bf661.bb8ae", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "x": 670, "y": 380, "wires": [] }, { "id": "6bec0bfc.9ee97c", "type": "debug", "z": "bd5bf661.bb8ae", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "x": 670, "y": 420, "wires": [] }, { "id": "ba983339.5c0718", "type": "function", "z": "bd5bf661.bb8ae", "name": "parseFloat2", "func": "// https://stackoverflow.com/questions/5055723/converting-hexadecimal-to-float-in-javascript\n\nfunction parseFloat2(str) {\n var float = 0, sign, order, mantiss,exp,\n int = 0, multi = 1;\n if (/^0x/.exec(str)) {\n int = parseInt(str,16);\n }else{\n for (var i = str.length -1; i >=0; i -= 1) {\n if (str.charCodeAt(i)>255) {\n console.log('Wrong string parametr'); \n return false;\n }\n int += str.charCodeAt(i) * multi;\n multi *= 256;\n }\n }\n sign = (int>>>31)?-1:1;\n exp = (int >>> 23 & 0xff) - 127;\n mantissa = ((int & 0x7fffff) + 0x800000).toString(2);\n for (i=0; i=0; i -= 1) {\n if (str.charCodeAt(i)>255) {\n console.log('Wrong string parametr'); \n return false;\n }\n int += str.charCodeAt(i) * multi;\n multi *= 256;\n }\n }\n sign = (int>>>31)?-1:1;\n exp = (int >>> 23 & 0xff) - 127;\n mantissa = ((int & 0x7fffff) + 0x800000).toString(2);\n for (i=0; i=0; i -= 1) {\n if (str.charCodeAt(i)>255) {\n console.log('Wrong string parametr'); \n return false;\n }\n int += str.charCodeAt(i) * multi;\n multi *= 256;\n }\n }\n sign = (int>>>31)?-1:1;\n exp = (int >>> 23 & 0xff) - 127;\n mantissa = ((int & 0x7fffff) + 0x800000).toString(2);\n for (i=0; i