Tigo Energy PV combined API to InfluxDB

Hello,

I am trying to pull data from TigoEnergy API and pass it to InfluxDB.
So far I am able to pull data and getting successful reply but have no a clue how to correctly pas this to InfluxDB
My GET querry:
https://api2.tigoenergy.com/api/v3/data/combined?system_id=xxxx&agg=mi&start=2021-05-30T04:00:00&end=2021-05-30T22:00:00

Response:

DATETIME,84177508
2021/05/30 04:00:00,
2021/05/30 04:01:00,
2021/05/30 04:02:00,
2021/05/30 04:03:00,
2021/05/30 04:04:00,
2021/05/30 04:05:00,
2021/05/30 04:06:00,
2021/05/30 04:07:00,
2021/05/30 04:08:00,
2021/05/30 04:09:00,
2021/05/30 04:10:00,
2021/05/30 04:11:00,
2021/05/30 04:12:00,
2021/05/30 04:13:00,
2021/05/30 04:14:00,
2021/05/30 04:15:00,
2021/05/30 04:16:00,
2021/05/30 04:17:00,
2021/05/30 04:18:00,
2021/05/30 04:19:00,
2021/05/30 04:20:00,
2021/05/30 04:21:00,
2021/05/30 04:22:00,
2021/05/30 04:23:00,
2021/05/30 04:24:00,
2021/05/30 04:25:00,
2021/05/30 04:26:00,
2021/05/30 04:27:00,
2021/05/30 04:28:00,
2021/05/30 04:29:00,
2021/05/30 04:30:00,
2021/05/30 04:31:00,
2021/05/30 04:32:00,
2021/05/30 04:33:00,
2021/05/30 04:34:00,
2021/05/30 04:35:00,
2021/05/30 04:36:00,
2021/05/30 04:37:00,
2021/05/30 04:38:00,
2021/05/30 04:39:00,
2021/05/30 04:40:00,
2021/05/30 04:41:00,
2021/05/30 04:42:00,
2021/05/30 04:43:00,
2021/05/30 04:44:00,
2021/05/30 04:45:00,
2021/05/30 04:46:00,
2021/05/30 04:47:00,
2021/05/30 04:48:00,
2021/05/30 04:49:00,
2021/05/30 04:50:00,
2021/05/30 04:51:00,
2021/05/30 04:52:00,
2021/05/30 04:53:00,
2021/05/30 04:54:00,
2021/05/30 04:55:00,
2021/05/30 04:56:00,
2021/05/30 04:57:00,
2021/05/30 04:58:00,
2021/05/30 04:59:00,
2021/05/30 05:00:00,
2021/05/30 05:01:00,
2021/05/30 05:02:00,
2021/05/30 05:03:00,
2021/05/30 05:04:00,
2021/05/30 05:05:00,
2021/05/30 05:06:00,
2021/05/30 05:07:00,
2021/05/30 05:08:00,0
2021/05/30 05:09:00,0
2021/05/30 05:10:00,0
2021/05/30 05:11:00,5
2021/05/30 05:12:00,7
2021/05/30 05:13:00,8
2021/05/30 05:14:00,8
2021/05/30 05:15:00,0
2021/05/30 05:16:00,15
2021/05/30 05:17:00,7
2021/05/30 05:18:00,10
2021/05/30 05:19:00,10
2021/05/30 05:20:00,10
2021/05/30 05:21:00,10
2021/05/30 05:22:00,10
2021/05/30 05:23:00,11
2021/05/30 05:24:00,10
2021/05/30 05:25:00,10
2021/05/30 05:26:00,10
2021/05/30 05:27:00,10
2021/05/30 05:28:00,16
2021/05/30 05:29:00,20
2021/05/30 05:30:00,22
2021/05/30 05:31:00,22
2021/05/30 05:32:00,22
2021/05/30 05:33:00,22
2021/05/30 05:34:00,22
2021/05/30 05:35:00,22
2021/05/30 05:36:00,23
2021/05/30 05:37:00,22
2021/05/30 05:38:00,24
2021/05/30 05:39:00,33
2021/05/30 05:40:00,33
2021/05/30 05:41:00,34
2021/05/30 05:42:00,31
2021/05/30 05:43:00,33
2021/05/30 05:44:00,36
2021/05/30 05:45:00,39
2021/05/30 05:46:00,45
2021/05/30 05:47:00,40
2021/05/30 05:48:00,42
2021/05/30 05:49:00,43
2021/05/30 05:50:00,43
2021/05/30 05:51:00,44
2021/05/30 05:52:00,41
2021/05/30 05:53:00,43
2021/05/30 05:54:00,44
2021/05/30 05:55:00,44
2021/05/30 05:56:00,44
2021/05/30 05:57:00,51
2021/05/30 05:58:00,54
2021/05/30 05:59:00,55
2021/05/30 06:00:00,50
2021/05/30 06:01:00,56
2021/05/30 06:02:00,55
2021/05/30 06:03:00,60
2021/05/30 06:04:00,66
2021/05/30 06:05:00,73
2021/05/30 06:06:00,78
2021/05/30 06:07:00,86
2021/05/30 06:08:00,91
2021/05/30 06:09:00,92
2021/05/30 06:10:00,95
2021/05/30 06:11:00,97
2021/05/30 06:12:00,99
2021/05/30 06:13:00,105
2021/05/30 06:14:00,106
2021/05/30 06:15:00,114
2021/05/30 06:16:00,125
2021/05/30 06:17:00,129
2021/05/30 06:18:00,137
2021/05/30 06:19:00,147
2021/05/30 06:20:00,137
2021/05/30 06:21:00,137
2021/05/30 06:22:00,137
2021/05/30 06:23:00,150
2021/05/30 06:24:00,172
2021/05/30 06:25:00,178
2021/05/30 06:26:00,183
2021/05/30 06:27:00,188
2021/05/30 06:28:00,193
2021/05/30 06:29:00,193
2021/05/30 06:30:00,183
2021/05/30 06:31:00,186
2021/05/30 06:32:00,218
2021/05/30 06:33:00,217
2021/05/30 06:34:00,215
2021/05/30 06:35:00,217
2021/05/30 06:36:00,239
2021/05/30 06:37:00,253
2021/05/30 06:38:00,236
2021/05/30 06:39:00,215
2021/05/30 06:40:00,214
2021/05/30 06:41:00,251
2021/05/30 06:42:00,272
2021/05/30 06:43:00,239
2021/05/30 06:44:00,229
2021/05/30 06:45:00,227
2021/05/30 06:46:00,217
2021/05/30 06:47:00,239
2021/05/30 06:48:00,269
2021/05/30 06:49:00,273
2021/05/30 06:50:00,251
2021/05/30 06:51:00,263
2021/05/30 06:52:00,285
2021/05/30 06:53:00,285
2021/05/30 06:54:00,286
2021/05/30 06:55:00,297
2021/05/30 06:56:00,326
2021/05/30 06:57:00,323
2021/05/30 06:58:00,310
2021/05/30 06:59:00,275
2021/05/30 07:00:00,247
2021/05/30 07:01:00,244
2021/05/30 07:02:00,251
2021/05/30 07:03:00,251
2021/05/30 07:04:00,255
2021/05/30 07:05:00,248
2021/05/30 07:06:00,263
2021/05/30 07:07:00,275
2021/05/30 07:08:00,309
2021/05/30 07:09:00,338
2021/05/30 07:10:00,309
2021/05/30 07:11:00,263
2021/05/30 07:12:00,262
2021/05/30 07:13:00,275
2021/05/30 07:14:00,325
2021/05/30 07:15:00,344
2021/05/30 07:16:00,340

As you can see there is time stamp and value. I would like to pass this to InfluxDB as PV Power.

Please help.

Regards
Maciej

Welcome to the forum @benek984

You can use the Influxdb batch node (contained in node-red-contrib-influxdb) to do that. Using that you can add them all in one go. The Influxdb Out node (also in that package) can add them one at a time, but that is much less efficient obviously.

Hello,
Added influx batch as you mentioned but getting error: "TypeError: points.forEach is not a function"
Do I need to split data somehow before passing to influxdb batch?

The help text for the node tells you how to format the data. msg.payload has to be an array of point objects, where each element has a measurement property, a fields property, a timestamp and optionally a tags property. Since you only have timestamp and value you will need something like

[
 {
  measurement: "the_measurement",
  fields: {power: 10},
  timestamp: 1622751472959
 }, 
 {
  measurement: "the_measurement",
  fields: {power: 20},
  timestamp: 1622752347768
 } 
 ...
]

The easiest way to get the timestamps is to create Date objects from your dates and then use getTime() to give you the timestamp in milliseconds, then in the node check that the Time Precision is set to milliseconds

Hi @Colin thank you for your comments. However, me having no programming experience what so ever still don't understand which node need to be use and how to convert this payload to the format that InfluxDB will like it.

Would that be possible for you to build that flow for me if I give you API credentials?

Feed the message containing the data into a debug node and show us what it says, so that we can understand exactly the form of the data.


{"_msgid":"4974d8c1.3fa568","topic":"pv_pin","statusCode":200,"headers":{"date":"Sat, 05 Jun 2021 10:20:22 GMT","server":"Apache","access-control-allow-origin":"*","access-control-allow-headers":"Origin, X-Requested-With, Content-Type, Accept","pragma":"public","expires":"0","cache-control":"must-revalidate, post-check=0, pre-check=0","x-frame-options":"sameorigin","connection":"close","transfer-encoding":"chunked","content-type":"text/csv","x-node-red-request-node":"799f77f2"},"responseUrl":"https://api2.tigoenergy.com/api/v3/data/combined?system_id=xxxxx&agg=mi&start=2021-05-30T07:00:00&end=2021-05-30T22:00:00","payload":"DATETIME,84177508\n2021/05/30 07:00:00,247\n2021/05/30 07:01:00,244\n2021/05/30 07:02:00,251\n2021/05/30 07:03:00,251\n2021/05/30 07:04:00,255\n2021/05/30 07:05:00,248\n2021/05/30 07:06:00,263\n2021/05/30 07:07:00,275\n2021/05/30 07:08:00,309\n2021/05/30 07:09:00,338\n2021/05/30 07:10:00,309\n2021/05/30 07:11:00,263\n2021/05/30 07:12:00,262\n2021/05/30 07:13:00,275\n2021/05/30 07:14:00,325\n2021/05/30 07:15:00,344\n2021/05/30 07:16:00,340\n2021/05/30 07:17:00,322\n2021/05/30 07:18:00,320\n2021/05/30 07:19:00,352\n2021/05/30 07:20:00,348\n2021/05/30 07:21:00,297\n2021/05/30 07:22:00,270\n2021/05/30 07:23:00,242\n2021/05/30 07:24:00,252\n2021/05/30 07:25:00,252\n2021/05/30 07:26:00,261\n2021/05/30 07:27:00,261\n2021/05/30 07:28:00,255\n2021/05/30 07:29:00,243\n2021/05/30 07:30:00,243\n2021/05/30 07:31:00,245\n2021/05/30 07:32:00,239\n2021/05/30 07:33:00,234\n2021/05/30 07:34:00,231\n2021/05/30 07:35:00,231\n2021/05/30 07:36:00,227\n2021/05/30 07:37:00,224\n2021/05/30 07:38:00,220\n2021/05/30 07:39:00,220\n2021/05/30 07:40:00,21...","redirectList":[ ]}

Can you edit that and add three backtick characters on a separate line before it and one after it, so that the forum does not mess with it.
```
like this
```

You can edit and correct your post by clicking the pencil icon.

See this post for more details - How to share code or flow json

What timezone are the timestamps in? Hopefully UTC.

System is set to Europe/London but at this moment receiving British summer time.

What do you want to happen when there is a DST switch? In the spring you will have a gap of one hour in the samples and in the autumn you will have an hour with the timestamps repeating the same time as the previous hour. The solution is to use UTC for timestamps.

Not sure if I will be able to pull the sample with UTC. I will ask Tigo Supprt if this will be possible and will get back to you.

I am a bit confused about how you are fetching the data. Looking at the Tigo API all the responses are json format but your data does not appear to be in that format.

This is how I have this setup at this moment.

I had not looked far enough down the document. It is odd that most of the api returns structured json but those ones just return a string you have to decode.

Is there anything we can do about it? Are they any nodes that can translate data to the right format?

the payload looks pretty much like CSV - try attaching a CSV node to the output of the HTTP request then to a debug node to see what it looks like.

The data are easily interpreted. Here is a short flow showing how it can be extracted to an array. The next step is to convert it to the format required by the influx batch node. The problem is that, because the timestamps include a DST component there is no way of uniquely converting to UTC, so you will get overlapping data when the clocks go back. If this doesn't bother you then all that remains is to use Array.map() to convert the array elements as required.

[{"id":"3da4222.005e05e","type":"inject","z":"1e323fba.79cef8","name":"Sample data","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"\"DATETIME,84177508\\n2021/05/30 07:00:00,247\\n2021/05/30 07:01:00,244\\n2021/05/30 07:02:00,251\\n2021/05/30 07:03:00,251\\n2021/05/30 07:04:00,255\\n2021/05/30 07:05:00,248\\n2021/05/30 07:06:00,263\\n2021/05/30 07:07:00,275\\n2021/05/30 07:08:00,309\\n2021/05/30 07:09:00,338\\n2021/05/30 07:10:00,309\\n2021/05/30 07:11:00,263\\n2021/05/30 07:12:00,262\\n2021/05/30 07:13:00,275\\n2021/05/30 07:14:00,325\\n2021/05/30 07:15:00,344\\n2021/05/30 07:16:00,340\\n2021/05/30 07:17:00,322\\n2021/05/30 07:18:00,320\\n2021/05/30 07:19:00,352\\n2021/05/30 07:20:00,348\\n2021/05/30 07:21:00,297\\n2021/05/30 07:22:00,270\\n2021/05/30 07:23:00,242\\n2021/05/30 07:24:00,252\\n2021/05/30 07:25:00,252\\n2021/05/30 07:26:00,261\\n2021/05/30 07:27:00,261\\n2021/05/30 07:28:00,255\\n2021/05/30 07:29:00,243\\n2021/05/30 07:30:00,243\\n2021/05/30 07:31:00,245\\n2021/05/30 07:32:00,239\\n2021/05/30 07:33:00,234\\n2021/05/30 07:34:00,231\\n2021/05/30 07:35:00,231\\n2021/05/30 07:36:00,227\\n2021/05/30 07:37:00,224\\n\"","payloadType":"json","x":170,"y":660,"wires":[["33196695.e91212"]]},{"id":"33196695.e91212","type":"function","z":"1e323fba.79cef8","name":"","func":"// convert to array by splitting on newline\nlet values = msg.payload.split(\"\\n\")\n// discard the first one which is not required\nvalues.shift()\n// map the array elements to the format required by influx batch node\n//values = values.map(function(value) {\n//    return ??\n//})\n\nmsg.payload = values\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":340,"y":660,"wires":[["9a082a91.e21ec"]]},{"id":"9a082a91.e21ec","type":"debug","z":"1e323fba.79cef8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":530,"y":660,"wires":[]}]

Hi,

{"_msgid":"86e2a515.679718","topic":"pv_pin","statusCode":200,"headers":{"date":"Sun, 06 Jun 2021 11:17:36 GMT","server":"Apache","access-control-allow-origin":"*","access-control-allow-headers":"Origin, X-Requested-With, Content-Type, Accept","pragma":"public","expires":"0","cache-control":"must-revalidate, post-check=0, pre-check=0","x-frame-options":"sameorigin","content-length":"5853","connection":"close","content-type":"text/csv","x-node-red-request-node":"74bdf2c8"},"responseUrl":"https://api2.tigoenergy.com/api/v3/data/combined?system_id=52705&agg=mi&start=2021-06-4T07:00:00&end=2021-06-4T11:00:00","payload":[{"84177508":221,"DATETIME":"2021/06/04 07:00:00"},{"84177508":230,"DATETIME":"2021/06/04 07:01:00"},{"84177508":237,"DATETIME":"2021/06/04 07:02:00"},{"84177508":248,"DATETIME":"2021/06/04 07:03:00"},{"84177508":264,"DATETIME":"2021/06/04 07:04:00"},{"84177508":279,"DATETIME":"2021/06/04 07:05:00"},{"84177508":310,"DATETIME":"2021/06/04 07:06:00"},{"84177508":339,"DATETIME":"2021/06/04 07:07:00"},{"84177508":374,"DATETIME":"2021/06/04 07:08:00"},{"84177508":405,"DATETIME":"2021/06/04 07:09:00"},{"84177508":429,"DATETIME":"2021/06/04 07:10:00"},{"84177508":448,"DATETIME":"2021/06/04 07:11:00"},{"84177508":460,"DATETIME":"2021/06/04 07:12:00"},{"84177508":470,"DATETIME":"2021/06/04 07:13:00"},{"84177508":482,"DATETIME":"2021/06/04 07:14:00"},{"84177508":494,"DATETIME":"2021/06/04 07:15:00"},{"84177508":495,"DATETIME":"2021/06/04 07:16:00"},{"84177508":496,"DATETIME":"2021/06/04 07:17:00"},{"84177508":502,"DATETIME":"2021/06/04 07:18:00"},{"84177508":506,"DATETIME":"2021/06/04 07:19:00"},{"84177508":507,"DATETIME":"2021/06/04 07:20:00"},{"84177508":513,"DATETIME":"2021/06/04 07:21:00"},{"84177508":517,"DATETIME":"2021/06/04 07:22:00"},{"84177508":518,"DATETIME":"2021/06/04 07:23:00"},{"84177508":517,"DATETIME":"2021/06/04 07:24:00"},{"84177508":517,"DATETIME":"2021/06/04 07:25:00"},{"84177508":508,"DATETIME":"2021/06/04 07:26:00"},{"84177508":506,"DATETIME":"2021/06/04 07:27:00"},{"84177508":494,"DATETIME":"2021/06/04 07:28:00"},{"84177508":485,"DATETIME":"2021/06/04 07:29:00"},{"84177508":481,"DATETIME":"2021/06/04 07:30:00"},{"84177508":471,"DATETIME":"2021/06/04 07:31:00"},{"84177508":460,"DATETIME":"2021/06/04 07:32:00"},{"84177508":448,"DATETIME":"2021/06/04 07:33:00"},{"84177508":446,"DATETIME":"2021/06/04 07:34:00"},{"84177508":436,"DATETIME":"2021/06/04 07:35:00"},{"84177508":427,"DATETIME":"2021/06/04 07:36:00"},{"84177508":418,"DATETIME":"2021/06/04 07:37:00"},{"84177508":415,"DATETIME":"2021/06/04 07:38:00"},{"84177508":414,"DATETIME":"2021/06/04 07:39:00"},{"84177508":415,"DATETIME":"2021/06/04 07:40:00"},{"84177508":421,"DATETIME":"2021/06/04 07:41:00"},{"84177508":416,"DATETIME":"2021/06/04 07:42:00"},{"84177508":416,"DATETIME":"2021/06/04 07:43:00"},{"84177508":418,"DATETIME":"2021/06/04 07:44:00"},{"84177508":416,"DATETIME":"2021/06/04 07:45:00"},{"84177508":407,"DATETIME":"2021/06/04 07:46:00"},{"84177508":380,"DATETIME":"2021/06/04 07:47:00"},{"84177508":368,"DATETIME":"2021/06/04 07:48:00"},{"84177508":362,"DATETIME":"2021/06/04 07:49:00"},{"84177508":390,"DATETIME":"2021/06/04 07:50:00"},{"84177508":403,"DATETIME":"2021/06/04 07:51:00"},{"84177508":392,"DATETIME":"2021/06/04 07:52:00"},{"84177508":386,"DATETIME":"2021/06/04 07:53:00"},{"84177508":390,"DATETIME":"2021/06/04 07:54:00"},{"84177508":403,"DATETIME":"2021/06/04 07:55:00"},{"84177508":402,"DATETIME":"2021/06/04 07:56:00"},{"84177508":393,"DATETIME":"2021/06/04 07:57:00"},{"84177508":392,"DATETIME":"2021/06/04 07:58:00"},{"84177508":399,"DATETIME":"2021/06/04 07:59:00"},{"84177508":404,"DATETIME":"2021/06/04 08:00:00"},{"84177508":414,"DATETIME":"2021/06/04 08:01:00"},{"84177508":413,"DATETIME":"2021/06/04 08:02:00"},{"84177508":428,"DATETIME":"2021/06/04 08:03:00"},{"84177508":442,"DATETIME":"2021/06/04 08:04:00"},{"84177508":472,"DATETIME":"2021/06/04 08:05:00"},{"84177508":499,"DATETIME":"2021/06/04 08:06:00"},{"84177508":528,"DATETIME":"2021/06/04 08:07:00"},{"84177508":553,"DATETIME":"2021/06/04 08:08:00"},{"84177508":583,"DATETIME":"2021/06/04 08:09:00"},{"84177508":595,"DATETIME":"2021/06/04 08:10:00"},{"84177508":580,"DATETIME":"2021/06/04 08:11:00"},{"84177508":607,"DATETIME":"2021/06/04 08:12:00"},{"84177508":608,"DATETIME":"2021/06/04 08:13:00"},{"84177508":588,"DATETIME":"2021/06/04 08:14:00"},{"84177508":540,"DATETIME":"2021/06/04 08:15:00"},{"84177508":483,"DATETIME":"2021/06/04 08:16:00"},{"84177508":474,"DATETIME":"2021/06/04 08:17:00"},{"84177508":480,"DATETIME":"2021/06/04 08:18:00"},{"84177508":469,"DATETIME":"2021/06/04 08:19:00"},{"84177508":457,"DATETIME":"2021/06/04 08:20:00"},{"84177508":509,"DATETIME":"2021/06/04 08:21:00"},{"84177508":516,"DATETIME":"2021/06/04 08:22:00"},{"84177508":518,"DATETIME":"2021/06/04 08:23:00"},{"84177508":507,"DATETIME":"2021/06/04 08:24:00"},{"84177508":512,"DATETIME":"2021/06/04 08:25:00"},{"84177508":493,"DATETIME":"2021/06/04 08:26:00"},{"84177508":402,"DATETIME":"2021/06/04 08:27:00"},{"84177508":386,"DATETIME":"2021/06/04 08:28:00"},{"84177508":365,"DATETIME":"2021/06/04 08:29:00"},{"84177508":377,"DATETIME":"2021/06/04 08:30:00"},{"84177508":390,"DATETIME":"2021/06/04 08:31:00"},{"84177508":429,"DATETIME":"2021/06/04 08:32:00"},{"84177508":460,"DATETIME":"2021/06/04 08:33:00"},{"84177508":509,"DATETIME":"2021/06/04 08:34:00"},{"84177508":526,"DATETIME":"2021/06/04 08:35:00"},{"84177508":505,"DATETIME":"2021/06/04 08:36:00"},{"84177508":483,"DATETIME":"2021/06/04 08:37:00"},{"84177508":491,"DATETIME":"2021/06/04 08:38:00"},{"84177508":499,"DATETIME":"2021/06/04 08:39:00"},{"84177508":505,"DATETIME":"2021/06/04 08:40:00"},{"84177508":538,"DATETIME":"2021/06/04 08:41:00"},{"84177508":551,"DATETIME":"2021/06/04 08:42:00"},{"84177508":595,"DATETIME":"2021/06/04 08:43:00"},{"84177508":614,"DATETIME":"2021/06/04 08:44:00"},{"84177508":638,"DATETIME":"2021/06/04 08:45:00"},{"84177508":707,"DATETIME":"2021/06/04 08:46:00"},{"84177508":833,"DATETIME":"2021/06/04 08:47:00"},{"84177508":796,"DATETIME":"2021/06/04 08:48:00"},{"84177508":801,"DATETIME":"2021/06/04 08:49:00"},{"84177508":749,"DATETIME":"2021/06/04 08:50:00"},{"84177508":798,"DATETIME":"2021/06/04 08:51:00"},{"84177508":831,"DATETIME":"2021/06/04 08:52:00"},{"84177508":853,"DATETIME":"2021/06/04 08:53:00"},{"84177508":841,"DATETIME":"2021/06/04 08:54:00"},{"84177508":831,"DATETIME":"2021/06/04 08:55:00"},{"84177508":734,"DATETIME":"2021/06/04 08:56:00"},{"84177508":698,"DATETIME":"2021/06/04 08:57:00"},{"84177508":685,"DATETIME":"2021/06/04 08:58:00"},{"84177508":710,"DATETIME":"2021/06/04 08:59:00"},{"84177508":773,"DATETIME":"2021/06/04 09:00:00"},{"84177508":866,"DATETIME":"2021/06/04 09:01:00"},{"84177508":930,"DATETIME":"2021/06/04 09:02:00"},{"84177508":1024,"DATETIME":"2021/06/04 09:03:00"},{"84177508":1070,"DATETIME":"2021/06/04 09:04:00"},{"84177508":1057,"DATETIME":"2021/06/04 09:05:00"},{"84177508":1080,"DATETIME":"2021/06/04 09:06:00"},{"84177508":1088,"DATETIME":"2021/06/04 09:07:00"},{"84177508":1108,"DATETIME":"2021/06/04 09:08:00"},{"84177508":1062,"DATETIME":"2021/06/04 09:09:00"},{"84177508":1033,"DATETIME":"2021/06/04 09:10:00"},{"84177508":999,"DATETIME":"2021/06/04 09:11:00"},{"84177508":976,"DATETIME":"2021/06/04 09:12:00"},{"84177508":928,"DATETIME":"2021/06/04 09:13:00"},{"84177508":864,"DATETIME":"2021/06/04 09:14:00"},{"84177508":781,"DATETIME":"2021/06/04 09:15:00"},{"84177508":682,"DATETIME":"2021/06/04 09:16:00"},{"84177508":608,"DATETIME":"2021/06/04 09:17:00"},{"84177508":608,"DATETIME":"2021/06/04 09:18:00"},{"84177508":649,"DATETIME":"2021/06/04 09:19:00"},{"84177508":695,"DATETIME":"2021/06/04 09:20:00"},{"84177508":782,"DATETIME":"2021/06/04 09:21:00"},{"84177508":896,"DATETIME":"2021/06/04 09:22:00"},{"84177508":947,"DATETIME":"2021/06/04 09:23:00"},{"84177508":966,"DATETIME":"2021/06/04 09:24:00"},{"84177508":998,"DATETIME":"2021/06/04 09:25:00"},{"84177508":916,"DATETIME":"2021/06/04 09:26:00"},{"84177508":722,"DATETIME":"2021/06/04 09:27:00"},{"84177508":510,"DATETIME":"2021/06/04 09:28:00"},{"84177508":438,"DATETIME":"2021/06/04 09:29:00"},{"84177508":419,"DATETIME":"2021/06/04 09:30:00"},{"84177508":411,"DATETIME":"2021/06/04 09:31:00"},{"84177508":411,"DATETIME":"2021/06/04 09:32:00"},{"84177508":417,"DATETIME":"2021/06/04 09:33:00"},{"84177508":422,"DATETIME":"2021/06/04 09:34:00"},{"84177508":428,"DATETIME":"2021/06/04 09:35:00"},{"84177508":457,"DATETIME":"2021/06/04 09:36:00"},{"84177508":533,"DATETIME":"2021/06/04 09:37:00"},{"84177508":618,"DATETIME":"2021/06/04 09:38:00"},{"84177508":613,"DATETIME":"2021/06/04 09:39:00"},{"84177508":556,"DATETIME":"2021/06/04 09:40:00"},{"84177508":541,"DATETIME":"2021/06/04 09:41:00"},{"84177508":539,"DATETIME":"2021/06/04 09:42:00"},{"84177508":537,"DATETIME":"2021/06/04 09:43:00"},{"84177508":535,"DATETIME":"2021/06/04 09:44:00"},{"84177508":533,"DATETIME":"2021/06/04 09:45:00"},{"84177508":546,"DATETIME":"2021/06/04 09:46:00"},{"84177508":568,"DATETIME":"2021/06/04 09:47:00"},{"84177508":589,"DATETIME":"2021/06/04 09:48:00"},{"84177508":584,"DATETIME":"2021/06/04 09:49:00"},{"84177508":571,"DATETIME":"2021/06/04 09:50:00"},{"84177508":574,"DATETIME":"2021/06/04 09:51:00"},{"84177508":557,"DATETIME":"2021/06/04 09:52:00"},{"84177508":543,"DATETIME":"2021/06/04 09:53:00"},{"84177508":536,"DATETIME":"2021/06/04 09:54:00"},{"84177508":519,"DATETIME":"2021/06/04 09:55:00"},{"84177508":496,"DATETIME":"2021/06/04 09:56:00"},{"84177508":493,"DATETIME":"2021/06/04 09:57:00"},{"84177508":500,"DATETIME":"2021/06/04 09:58:00"},{"84177508":492,"DATETIME":"2021/06/04 09:59:00"},{"84177508":481,"DATETIME":"2021/06/04 10:00:00"},{"84177508":494,"DATETIME":"2021/06/04 10:01:00"},{"84177508":519,"DATETIME":"2021/06/04 10:02:00"},{"84177508":548,"DATETIME":"2021/06/04 10:03:00"},{"84177508":584,"DATETIME":"2021/06/04 10:04:00"},{"84177508":642,"DATETIME":"2021/06/04 10:05:00"},{"84177508":749,"DATETIME":"2021/06/04 10:06:00"},{"84177508":966,"DATETIME":"2021/06/04 10:07:00"},{"84177508":1140,"DATETIME":"2021/06/04 10:08:00"},{"84177508":1198,"DATETIME":"2021/06/04 10:09:00"},{"84177508":940,"DATETIME":"2021/06/04 10:10:00"},{"84177508":815,"DATETIME":"2021/06/04 10:11:00"},{"84177508":818,"DATETIME":"2021/06/04 10:12:00"},{"84177508":874,"DATETIME":"2021/06/04 10:13:00"},{"84177508":943,"DATETIME":"2021/06/04 10:14:00"},{"84177508":955,"DATETIME":"2021/06/04 10:15:00"},{"84177508":950,"DATETIME":"2021/06/04 10:16:00"},{"84177508":903,"DATETIME":"2021/06/04 10:17:00"},{"84177508":875,"DATETIME":"2021/06/04 10:18:00"},{"84177508":946,"DATETIME":"2021/06/04 10:19:00"},{"84177508":1089,"DATETIME":"2021/06/04 10:20:00"},{"84177508":1205,"DATETIME":"2021/06/04 10:21:00"},{"84177508":1134,"DATETIME":"2021/06/04 10:22:00"},{"84177508":1088,"DATETIME":"2021/06/04 10:23:00"},{"84177508":1078,"DATETIME":"2021/06/04 10:24:00"},{"84177508":1067,"DATETIME":"2021/06/04 10:25:00"},{"84177508":1056,"DATETIME":"2021/06/04 10:26:00"},{"84177508":1069,"DATETIME":"2021/06/04 10:27:00"},{"84177508":1132,"DATETIME":"2021/06/04 10:28:00"},{"84177508":1197,"DATETIME":"2021/06/04 10:29:00"},{"84177508":1202,"DATETIME":"2021/06/04 10:30:00"},{"84177508":1293,"DATETIME":"2021/06/04 10:31:00"},{"84177508":1306,"DATETIME":"2021/06/04 10:32:00"},{"84177508":1306,"DATETIME":"2021/06/04 10:33:00"},{"84177508":1328,"DATETIME":"2021/06/04 10:34:00"},{"84177508":1326,"DATETIME":"2021/06/04 10:35:00"},{"84177508":1316,"DATETIME":"2021/06/04 10:36:00"},{"84177508":1396,"DATETIME":"2021/06/04 10:37:00"},{"84177508":1408,"DATETIME":"2021/06/04 10:38:00"},{"84177508":1396,"DATETIME":"2021/06/04 10:39:00"},{"84177508":1326,"DATETIME":"2021/06/04 10:40:00"},{"84177508":1319,"DATETIME":"2021/06/04 10:41:00"},{"84177508":1308,"DATETIME":"2021/06/04 10:42:00"},{"84177508":1302,"DATETIME":"2021/06/04 10:43:00"},{"84177508":1301,"DATETIME":"2021/06/04 10:44:00"},{"84177508":1306,"DATETIME":"2021/06/04 10:45:00"},{"84177508":1338,"DATETIME":"2021/06/04 10:46:00"},{"84177508":1367,"DATETIME":"2021/06/04 10:47:00"},{"84177508":1419,"DATETIME":"2021/06/04 10:48:00"},{"84177508":1536,"DATETIME":"2021/06/04 10:49:00"},{"84177508":1688,"DATETIME":"2021/06/04 10:50:00"},{"84177508":1762,"DATETIME":"2021/06/04 10:51:00"},{"84177508":1647,"DATETIME":"2021/06/04 10:52:00"},{"84177508":1950,"DATETIME":"2021/06/04 10:53:00"},{"84177508":2392,"DATETIME":"2021/06/04 10:54:00"},{"84177508":2428,"DATETIME":"2021/06/04 10:55:00"},{"84177508":2372,"DATETIME":"2021/06/04 10:56:00"},{"84177508":2395,"DATETIME":"2021/06/04 10:57:00"},{"84177508":2497,"DATETIME":"2021/06/04 10:58:00"},{"84177508":2460,"DATETIME":"2021/06/04 10:59:00"},{"84177508":2350,"DATETIME":"2021/06/04 11:00:00"}],"redirectList":[],"columns":"DATETIME,84177508"}

I think this looks better by sending this to csv but how to set this so influx know which filed is a timestamp?

Hi,

I have used your function and getting data as below. looks better but still not readable for influxdb.

{"_msgid":"94306083.24174","topic":"pv_pin","statusCode":200,"headers":{"date":"Sun, 06 Jun 2021 11:34:13 GMT","server":"Apache","access-control-allow-origin":"*","access-control-allow-headers":"Origin, X-Requested-With, Content-Type, Accept","pragma":"public","expires":"0","cache-control":"must-revalidate, post-check=0, pre-check=0","x-frame-options":"sameorigin","content-length":"5919","connection":"close","content-type":"text/csv","x-node-red-request-node":"2647c1cf"},"responseUrl":"https://api2.tigoenergy.com/api/v3/data/combined?system_id=52705&agg=mi&start=2021-06-5T07:00:00&end=2021-06-5T11:00:00","payload":["2021/06/05 07:00:00,309","2021/06/05 07:01:00,308","2021/06/05 07:02:00,308","2021/06/05 07:03:00,303","2021/06/05 07:04:00,297","2021/06/05 07:05:00,287","2021/06/05 07:06:00,279","2021/06/05 07:07:00,281","2021/06/05 07:08:00,281","2021/06/05 07:09:00,279","2021/06/05 07:10:00,274","2021/06/05 07:11:00,274","2021/06/05 07:12:00,273","2021/06/05 07:13:00,273","2021/06/05 07:14:00,281","2021/06/05 07:15:00,288","2021/06/05 07:16:00,296","2021/06/05 07:17:00,296","2021/06/05 07:18:00,295","2021/06/05 07:19:00,296","2021/06/05 07:20:00,283","2021/06/05 07:21:00,271","2021/06/05 07:22:00,266","2021/06/05 07:23:00,240","2021/06/05 07:24:00,217","2021/06/05 07:25:00,205","2021/06/05 07:26:00,217","2021/06/05 07:27:00,217","2021/06/05 07:28:00,218","2021/06/05 07:29:00,217","2021/06/05 07:30:00,219","2021/06/05 07:31:00,229","2021/06/05 07:32:00,251","2021/06/05 07:33:00,262","2021/06/05 07:34:00,255","2021/06/05 07:35:00,259","2021/06/05 07:36:00,285","2021/06/05 07:37:00,296","2021/06/05 07:38:00,307","2021/06/05 07:39:00,330","2021/06/05 07:40:00,365","2021/06/05 07:41:00,399","2021/06/05 07:42:00,433","2021/06/05 07:43:00,457","2021/06/05 07:44:00,470","2021/06/05 07:45:00,503","2021/06/05 07:46:00,545","2021/06/05 07:47:00,573","2021/06/05 07:48:00,620","2021/06/05 07:49:00,599","2021/06/05 07:50:00,595","2021/06/05 07:51:00,626","2021/06/05 07:52:00,638","2021/06/05 07:53:00,630","2021/06/05 07:54:00,619","2021/06/05 07:55:00,597","2021/06/05 07:56:00,567","2021/06/05 07:57:00,533","2021/06/05 07:58:00,489","2021/06/05 07:59:00,468","2021/06/05 08:00:00,464","2021/06/05 08:01:00,472","2021/06/05 08:02:00,497","2021/06/05 08:03:00,525","2021/06/05 08:04:00,560","2021/06/05 08:05:00,608","2021/06/05 08:06:00,654","2021/06/05 08:07:00,680","2021/06/05 08:08:00,668","2021/06/05 08:09:00,623","2021/06/05 08:10:00,571","2021/06/05 08:11:00,568","2021/06/05 08:12:00,527","2021/06/05 08:13:00,479","2021/06/05 08:14:00,469","2021/06/05 08:15:00,465","2021/06/05 08:16:00,461","2021/06/05 08:17:00,459","2021/06/05 08:18:00,457","2021/06/05 08:19:00,468","2021/06/05 08:20:00,474","2021/06/05 08:21:00,466","2021/06/05 08:22:00,448","2021/06/05 08:23:00,430","2021/06/05 08:24:00,433","2021/06/05 08:25:00,423","2021/06/05 08:26:00,394","2021/06/05 08:27:00,407","2021/06/05 08:28:00,414","2021/06/05 08:29:00,411","2021/06/05 08:30:00,387","2021/06/05 08:31:00,362","2021/06/05 08:32:00,378","2021/06/05 08:33:00,399","2021/06/05 08:34:00,452","2021/06/05 08:35:00,495","2021/06/05 08:36:00,518","2021/06/05 08:37:00,539","2021/06/05 08:38:00,553","2021/06/05 08:39:00,562","2021/06/05 08:40:00,559","2021/06/05 08:41:00,571","2021/06/05 08:42:00,568","2021/06/05 08:43:00,611","2021/06/05 08:44:00,672","2021/06/05 08:45:00,737","2021/06/05 08:46:00,785","2021/06/05 08:47:00,757","2021/06/05 08:48:00,772","2021/06/05 08:49:00,760","2021/06/05 08:50:00,808","2021/06/05 08:51:00,795","2021/06/05 08:52:00,758","2021/06/05 08:53:00,719","2021/06/05 08:54:00,789","2021/06/05 08:55:00,788","2021/06/05 08:56:00,739","2021/06/05 08:57:00,704","2021/06/05 08:58:00,717","2021/06/05 08:59:00,750","2021/06/05 09:00:00,771","2021/06/05 09:01:00,797","2021/06/05 09:02:00,887","2021/06/05 09:03:00,997","2021/06/05 09:04:00,1071","2021/06/05 09:05:00,1067","2021/06/05 09:06:00,1299","2021/06/05 09:07:00,1429","2021/06/05 09:08:00,1470","2021/06/05 09:09:00,1518","2021/06/05 09:10:00,1414","2021/06/05 09:11:00,1329","2021/06/05 09:12:00,1377","2021/06/05 09:13:00,1412","2021/06/05 09:14:00,1432","2021/06/05 09:15:00,1362","2021/06/05 09:16:00,1368","2021/06/05 09:17:00,1381","2021/06/05 09:18:00,1400","2021/06/05 09:19:00,1275","2021/06/05 09:20:00,1245","2021/06/05 09:21:00,1253","2021/06/05 09:22:00,1307","2021/06/05 09:23:00,1260","2021/06/05 09:24:00,1248","2021/06/05 09:25:00,1253","2021/06/05 09:26:00,1223","2021/06/05 09:27:00,1194","2021/06/05 09:28:00,1178","2021/06/05 09:29:00,1162","2021/06/05 09:30:00,1156","2021/06/05 09:31:00,1145","2021/06/05 09:32:00,1132","2021/06/05 09:33:00,1132","2021/06/05 09:34:00,1152","2021/06/05 09:35:00,1165","2021/06/05 09:36:00,1188","2021/06/05 09:37:00,1213","2021/06/05 09:38:00,1240","2021/06/05 09:39:00,1259","2021/06/05 09:40:00,1283","2021/06/05 09:41:00,1295","2021/06/05 09:42:00,1312","2021/06/05 09:43:00,1374","2021/06/05 09:44:00,1513","2021/06/05 09:45:00,1509","2021/06/05 09:46:00,1551","2021/06/05 09:47:00,1941","2021/06/05 09:48:00,2226","2021/06/05 09:49:00,2124","2021/06/05 09:50:00,1542","2021/06/05 09:51:00,1411","2021/06/05 09:52:00,1374","2021/06/05 09:53:00,1400","2021/06/05 09:54:00,1586","2021/06/05 09:55:00,1782","2021/06/05 09:56:00,1453","2021/06/05 09:57:00,1427","2021/06/05 09:58:00,1509","2021/06/05 09:59:00,1770","2021/06/05 10:00:00,1718","2021/06/05 10:01:00,1555","2021/06/05 10:02:00,1539","2021/06/05 10:03:00,1651","2021/06/05 10:04:00,1589","2021/06/05 10:05:00,1576","2021/06/05 10:06:00,1521","2021/06/05 10:07:00,1508","2021/06/05 10:08:00,1474","2021/06/05 10:09:00,1498","2021/06/05 10:10:00,1500","2021/06/05 10:11:00,1499","2021/06/05 10:12:00,1511","2021/06/05 10:13:00,1549","2021/06/05 10:14:00,1623","2021/06/05 10:15:00,1753","2021/06/05 10:16:00,1922","2021/06/05 10:17:00,1890","2021/06/05 10:18:00,1929","2021/06/05 10:19:00,1755","2021/06/05 10:20:00,1622","2021/06/05 10:21:00,1564","2021/06/05 10:22:00,1520","2021/06/05 10:23:00,1470","2021/06/05 10:24:00,1446","2021/06/05 10:25:00,1439","2021/06/05 10:26:00,1463","2021/06/05 10:27:00,1572","2021/06/05 10:28:00,1728","2021/06/05 10:29:00,2261","2021/06/05 10:30:00,2270","2021/06/05 10:31:00,1784","2021/06/05 10:32:00,1776","2021/06/05 10:33:00,1829","2021/06/05 10:34:00,1939","2021/06/05 10:35:00,1889","2021/06/05 10:36:00,2716","2021/06/05 10:37:00,2242","2021/06/05 10:38:00,1804","2021/06/05 10:39:00,1824","2021/06/05 10:40:00,1808","2021/06/05 10:41:00,2020","2021/06/05 10:42:00,2710","2021/06/05 10:43:00,2264","2021/06/05 10:44:00,2949","2021/06/05 10:45:00,2082","2021/06/05 10:46:00,1633","2021/06/05 10:47:00,1621","2021/06/05 10:48:00,1596","2021/06/05 10:49:00,1569","2021/06/05 10:50:00,1680","2021/06/05 10:51:00,1647","2021/06/05 10:52:00,1648","2021/06/05 10:53:00,1836","2021/06/05 10:54:00,2315","2021/06/05 10:55:00,2372","2021/06/05 10:56:00,1890","2021/06/05 10:57:00,2474","2021/06/05 10:58:00,1991","2021/06/05 10:59:00,1507","2021/06/05 11:00:00,1454",""],"redirectList":[]}