# Hassio IOT: appropriate timestamp for Influxdb

**URL:** <https://discourse.nodered.org/t/hassio-iot-appropriate-timestamp-for-influxdb/41149>\
**Category:** General\
**Created:** [17 February 2021 11:02 UTC](https://discourse.nodered.org/t/hassio-iot-appropriate-timestamp-for-influxdb/41149 "2021-02-17T11:02:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![epaike](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/epaike/32/37402_2.png) [@epaike](https://discourse.nodered.org/u/epaike)\
**Post date:** [17 February 2021 11:02 UTC](https://discourse.nodered.org/t/hassio-iot-appropriate-timestamp-for-influxdb/41149/1 "2021-02-17T11:02:31Z")

</div>

Hi, i’m not familiar with coding.

Started with [node-red-contrib-nordpool-api-plus (node) - Node-RED](https://flows.nodered.org/node/node-red-contrib-nordpool-api-plus)  
I try to write value with time to influxdb, no success so far.

 ![Screenshot 2021-02-17 at 13.01.31](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/a/7a21dbd30b291e46896fcbc5806fc5c18fb93f56.jpeg)

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…

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [17 February 2021 12:01 UTC](https://discourse.nodered.org/t/hassio-iot-appropriate-timestamp-for-influxdb/41149/2 "2021-02-17T12:01:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![epaike](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/epaike/32/37402_2.png) [@epaike](https://discourse.nodered.org/u/epaike)\
**Post date:** [17 February 2021 13:02 UTC](https://discourse.nodered.org/t/hassio-iot-appropriate-timestamp-for-influxdb/41149/3 "2021-02-17T13:02:31Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [17 February 2021 13:17 UTC](https://discourse.nodered.org/t/hassio-iot-appropriate-timestamp-for-influxdb/41149/4 "2021-02-17T13:17:08Z")

</div>

> [@epaike](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![epaike](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/epaike/32/37402_2.png) [@epaike](https://discourse.nodered.org/u/epaike)\
**Post date:** [17 February 2021 13:42 UTC](https://discourse.nodered.org/t/hassio-iot-appropriate-timestamp-for-influxdb/41149/5 "2021-02-17T13:42:18Z")

</div>

Thank you very much, this was very helpful.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [17 February 2021 13:44 UTC](https://discourse.nodered.org/t/hassio-iot-appropriate-timestamp-for-influxdb/41149/6 "2021-02-17T13:44:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [18 April 2021 13:45 UTC](https://discourse.nodered.org/t/hassio-iot-appropriate-timestamp-for-influxdb/41149/7 "2021-04-18T13:45:37Z")

</div>

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