[ { "id": "ed5ed821.4bbdb8", "type": "inject", "z": "8a8b41a.6576c4", "name": "", "topic": "", "payload": "", "payloadType": "date", "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "x": 220, "y": 500, "wires": [ [ "680462d7.984aa4" ] ] }, { "id": "47e98ae6.dbd454", "type": "debug", "z": "8a8b41a.6576c4", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "x": 750, "y": 820, "wires": [] }, { "id": "680462d7.984aa4", "type": "function", "z": "8a8b41a.6576c4", "name": "petició sentilo", "func": "msg.payload=\"curl -X GET -H \\\"IDENTITY_KEY: 9236ee8fc44c79cd632add790001710784078c5b6bd0230124a23a9ad4ea521f\\\" http://popotamo.binefa.cat:8081/data/prov00/temp00/?limit=20&from=10/09/2012T10:00:00 && sleep 0.2\"\nreturn msg;", "outputs": 1, "noerr": 0, "x": 280, "y": 580, "wires": [ [ "8bea280f.34923" ] ] }, { "id": "8bea280f.34923", "type": "exec", "z": "8a8b41a.6576c4", "command": "", "addpay": true, "append": "", "useSpawn": "false", "timer": "", "oldrc": false, "name": "", "x": 410, "y": 660, "wires": [ [ "c1d002c0.a4cc" ], [], [] ] }, { "id": "c1d002c0.a4cc", "type": "json", "z": "8a8b41a.6576c4", "name": "", "property": "payload", "action": "", "pretty": true, "x": 570, "y": 600, "wires": [ [ "2e5f952f.00d0a2", "3334085c.f682a8" ] ] }, { "id": "2e5f952f.00d0a2", "type": "function", "z": "8a8b41a.6576c4", "name": "", "func": "msg.payload = msg.payload.observations\nreturn msg;", "outputs": 1, "noerr": 0, "x": 490, "y": 720, "wires": [ [ "f579310e.f8a898", "8be42df8.7e2958" ] ] }, { "id": "8be42df8.7e2958", "type": "function", "z": "8a8b41a.6576c4", "name": "Introducció dades InfluxDB", "func": "//var a = [\"a\", \"b\", \"c\"];\n\n\na = msg.payload;\nvar f = [];\n//var t = [];\n// var ttt = [];\n/*\nfunction myFunction(item) {\n f.push(Number(item.value));\n} \n*/\n\n/*\nfor (var i = 0; i < a.length; i++){\n \n // var data;\n // var time = RED.util.cloneMessage(msg);\n// var value = RED.util.cloneMessage(msg);\n \n time.payload = a[i].time;\n value.payload = parseFloat(a[i].value);\n var time = parseFloat(a[i].value);\n var value = a[i].timestamp;\n \n new_msg.payload = parseFloat(a[i].value);\n new_msg2.payload = a[i].time;\n \n msg.payload = { \"time\" : new_msg2 , \"value\" : new_msg }\n \n f.push(msg);\n\n // ttt.push(...t, ...f);\n \n}\n*/\n\n\nfor(var i = 0; i