stackhero-io / node-red-contrib-stackhero-influxdb-v2

Node-RED node to read and write to an InfluxDB v2 database.
31 stars 7 forks source link

Couln't write to influxdb with event trigger time timestamp #16

Open srivari2021 opened 2 years ago

srivari2021 commented 2 years ago

Hi Team, Greetings

I am trying to write to influxdb without timestamp it works. by default it adds node-red timestamp in influxdb when it writes. query shows the timestamp of the node-red.

{ "_msgid": "df366b6bdb1b98a9", "payload": { "data": { "measurement": "customer_a", "tags": { "device_id": "mydevice-name" }, "fields": { "cycle_on": 1, }, } }, "topic": "customer_a" }

but when i assign a timestamp value from payload / manually and it fails to write to influxdb. no error, not written in influxdb, nothing happening. no clue at all. can someone share light on this please? { "_msgid": "df366b6bdb1b98a9", "payload": { "data": { "measurement": "customer_a", "tags": { "device_id": "mydevice-name" }, "fields": { "cycle_on": 1, }, "timestamp": 1636097507 } }, "topic": "customer_a" }

SebSeb11 commented 1 year ago

Hi, unfortunately I do have the same problem. Using no timestamp is working. A wrong timestamp results in "bad timestamp". A (hopefully) correct timestamp does not produce an error but no data is written to influxdb.

Edit/solution: I had to set "precision" to "ms". Before it was "ns". There was no error because it was written to the DB. I did not see the measurements because I did not check for them at the time it was wrongly saved (years ago).