[ { "id": "d9ef38ea.807a4", "type": "ttn uplink", "z": "66f40105.4a68e8", "name": "Missatge ascendent (uplink)", "app": "28b17470.64c2cc", "dev_id": "", "field": "", "x": 180, "y": 140, "wires": [ [ "58bf84c3.2e677c", "cb25eadb.00d7b8", "130445dd.21df7a" ] ] }, { "id": "58bf84c3.2e677c", "type": "debug", "z": "66f40105.4a68e8", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "x": 450, "y": 240, "wires": [] }, { "id": "6f9a0a8e.a8afa4", "type": "inject", "z": "66f40105.4a68e8", "name": "", "topic": "", "payload": "0", "payloadType": "num", "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "x": 110, "y": 340, "wires": [ [ "5bf6a84b.058f98" ] ] }, { "id": "4859e798.da4f", "type": "inject", "z": "66f40105.4a68e8", "name": "", "topic": "", "payload": "1", "payloadType": "num", "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "x": 110, "y": 380, "wires": [ [ "5bf6a84b.058f98" ] ] }, { "id": "5bf6a84b.058f98", "type": "function", "z": "66f40105.4a68e8", "name": "Cap a TTN", "func": "\nreturn {\n dev_id: \"lopy-node-00\",\n port: msg.port,\n schedule: \"replace\",\n confirmed: false,\n payload: Buffer.from([msg.payload ? 0x71:0x51])\n};", "outputs": 1, "noerr": 0, "x": 270, "y": 380, "wires": [ [ "6061f8a6.6885f" ] ] }, { "id": "6061f8a6.6885f", "type": "ttn downlink", "z": "66f40105.4a68e8", "name": "Missatge descendent", "app": "28b17470.64c2cc", "dev_id": "", "port": "", "confirmed": false, "schedule": "replace", "x": 480, "y": 380, "wires": [] }, { "id": "a1f1037b.0a28a", "type": "ui_switch", "z": "66f40105.4a68e8", "name": "", "label": "switch", "group": "be900638.e4f94", "order": 0, "width": 0, "height": 0, "passthru": true, "decouple": "false", "topic": "", "style": "", "onvalue": "true", "onvalueType": "bool", "onicon": "", "oncolor": "", "offvalue": "false", "offvalueType": "bool", "officon": "", "offcolor": "", "x": 110, "y": 420, "wires": [ [ "5bf6a84b.058f98" ] ] }, { "id": "cb25eadb.00d7b8", "type": "ui_text", "z": "66f40105.4a68e8", "group": "be900638.e4f94", "order": 0, "width": 0, "height": 0, "name": "", "label": "Rebut", "format": "{{msg.payload}}", "layout": "row-spread", "x": 430, "y": 280, "wires": [] }, { "id": "130445dd.21df7a", "type": "function", "z": "66f40105.4a68e8", "name": "array to float", "func": "var data = msg.payload;\n\n// Create a buffer\nvar buf = new ArrayBuffer(4);\n// Create a data view of it\nvar view = new DataView(buf);\n\n// set bytes\ndata.forEach(function (b, i) {\n view.setUint8(i, b);\n});\n\n// Read the bits as a float; note that by doing this, we're implicitly\n// converting it from a 32-bit float into JavaScript's native 64-bit double\nvar num = view.getFloat32(0);\nnum = Math.round(num*100)/100;\n// Done\nmsg.payload = num;\n\nreturn msg;", "outputs": 1, "noerr": 0, "x": 430, "y": 140, "wires": [ [ "58bf84c3.2e677c", "8d1108e0.11eaf", "67a818cf.e17b88" ] ] }, { "id": "8d1108e0.11eaf", "type": "ui_chart", "z": "66f40105.4a68e8", "name": "", "group": "be900638.e4f94", "order": 0, "width": 0, "height": 0, "label": "chart", "chartType": "line", "legend": "false", "xformat": "HH:mm:ss", "interpolate": "linear", "nodata": "", "dot": false, "ymin": "15", "ymax": "45", "removeOlder": 1, "removeOlderPoints": "", "removeOlderUnit": "3600", "cutout": 0, "useOneColor": false, "colors": [ "#1f77b4", "#aec7e8", "#ff7f0e", "#2ca02c", "#98df8a", "#d62728", "#ff9896", "#9467bd", "#c5b0d5" ], "useOldStyle": false, "x": 600, "y": 80, "wires": [ [], [] ] }, { "id": "67a818cf.e17b88", "type": "ui_gauge", "z": "66f40105.4a68e8", "name": "", "group": "be900638.e4f94", "order": 0, "width": 0, "height": 0, "gtype": "gage", "title": "Gauge", "label": "units", "format": "{{value}}", "min": "-30", "max": "80", "colors": [ "#00b500", "#e6e600", "#ca3838" ], "seg1": "", "seg2": "", "x": 620, "y": 140, "wires": [] }, { "id": "28b17470.64c2cc", "type": "ttn app", "z": "", "appId": "node-portatil-00", "accessKey": "ttn-account-v2.q7qCPwMuCAlgcVzCWIXLTuEPVGxZoUvG1PM1giB9dU8", "discovery": "discovery.thethingsnetwork.org:1900" }, { "id": "be900638.e4f94", "type": "ui_group", "z": "", "name": "LoRaWAN", "tab": "d67ac9d4.1d32a8", "disp": true, "width": "6", "collapse": false }, { "id": "d67ac9d4.1d32a8", "type": "ui_tab", "z": "", "name": "Primer control", "icon": "dashboard" } ]