Hassio IOT: appropriate timestamp for Influxdb

Hi, i’m not familiar with coding.

Started with node-red-contrib-nordpool-api-plus (node) - Node-RED
I try to write value with time to influxdb, no success so far.

How should I change the appropriate timestamp for Influxdb?
Could you write me some flow code here?

2021-02-16T20:41:13+0200 xxx [{“timestamp”:“2021-02-15T23:00:00.000Z”,“price”:45.18,“currency”:“EUR”,“area”:“EE”},{“timestamp”:“2021-02-16T00:00:00.000Z”,“price”:44.28,“currency”:“EUR”,“area”:“EE”},{“timestamp”:“2021-02-16T01:00:00.000Z”,“price”:43.52,“currency”:“EUR”,“area”:“EE”},{“timestamp”:“2021-02-16T02:00:00.000Z”,“price”:42.22,“currency”:“EUR”,“area”:“EE”},{“timestamp”:“2021-02-16T03:00:00.000Z”,“price”:42.35,“currency”:“EUR”,“area”:“EE”},{“timestamp”:“2021-02-16T04:00:00.000Z”,“price”:44…

Welcome to the forum.

Is the time you want to use the current time? If so then you don't need to specify the time in the data at all, Influx will use the current time.

If it is not the current time then use the influx batch node where you can specify a time. I am pretty sure it will accept an ISO string, or a javascript Date object. It isn't clear from what you have said exactly what form it is in.

Here is the input I see listening to it via mqtt. It consist 24 price points for every hour:
[{“timestamp”:“2021-02-15T23:00:00.000Z”,“price”:45.18,“currency”:“EUR”,“area”:“EE”},{“timestamp”:“2021-02-16T00:00:00.000Z”,“price”:44.28,“cur.....
...."currency":"EUR","area":"EE"}]
I noticed also that through mqtt some additional tags and names are missing.

As i understand it is an array consisting 24 objects of array.
How to send this to influx?

Start by looking at the docs for the influx batch node and work out what you need to give it.

Thank you very much, this was very helpful.

Once you know what you want if you can't work out how to do it then come back.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.