tengo en node red la lectura de mi inversor solar, el cual guarda los datos en influxdb, me gustaría exportar cada cierto tiempo esa base de datos en un csv o Excel… me podrían ayudar por favor
Welcome to the forum @Hagory85
Sorry, I do not speak your language, but I suggest you start by using Google to search for
Export influxdb to excel
Then when you know how to do it you can think about doing it in node red.
This structure should do the trick. The query is edited in the template node (not essential but a good practice as it gives you the ability to bring in variables from message properties.) This example would pull the last week worth of data and put it in a CSV formatted file.
{
"id": "b35992d8108e37c6",
"type": "influxdb in",
"z": "d7ef59df0fafedbb",
"influxdb": "",
"name": "",
"query": "",
"rawOutput": false,
"precision": "",
"retentionPolicy": "",
"org": "YOURORG",
"x": 560,
"y": 620,
"wires": [
[
"a56df2edbe56416f"
]
]
},
{
"id": "0ed441529b5da056",
"type": "inject",
"z": "d7ef59df0fafedbb",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
},
{
"p": "bucket",
"v": "bucketname",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 240,
"y": 620,
"wires": [
[
"2d7cf7837c332c64"
]
]
},
{
"id": "2d7cf7837c332c64",
"type": "template",
"z": "d7ef59df0fafedbb",
"name": "",
"field": "query",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "from(bucket: \"{{{bucket}}}\")\n |> range(start: -7d)\n |> sort(columns: [\"_time\"])\n |> yield(name: \"reult\")",
"output": "str",
"x": 400,
"y": 620,
"wires": [
[
"b35992d8108e37c6"
]
]
},
{
"id": "e0360f7585105061",
"type": "debug",
"z": "d7ef59df0fafedbb",
"name": "debug 80",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 980,
"y": 620,
"wires": []
},
{
"id": "a56df2edbe56416f",
"type": "csv",
"z": "d7ef59df0fafedbb",
"name": "",
"sep": ",",
"hdrin": "",
"hdrout": "all",
"multi": "one",
"ret": "\\n",
"temp": "",
"skip": "0",
"strings": true,
"include_empty_strings": "",
"include_null_values": "",
"x": 710,
"y": 620,
"wires": [
[
"15863b861736f80b"
]
]
},
{
"id": "15863b861736f80b",
"type": "file",
"z": "d7ef59df0fafedbb",
"name": "",
"filename": "",
"filenameType": "str",
"appendNewline": false,
"createDir": false,
"overwriteFile": "true",
"encoding": "none",
"x": 840,
"y": 620,
"wires": [
[
"e0360f7585105061"
]
]
}
]```
Where do I have to add this code? ... excuse me, I'm lost
Before bothering here I had already Googled it... if I ask it's that I need help... anyway thank you for your answer
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.