Node red to influxdb help

Hello,
I installed influxdb and can communicate with it from node-red and cli.
If i use insert from cli the values are inserted in column with a single title and the values below it. (this is the way i'd prefer).
If i use insert from node-red, the influxdb out node and connect a simple string like Temperature=1 it inserts it to a value column with the "Temperature" appended to it on each line.
I have 3 values from 3 sensors, i'd like to have a table to plot it later. Having the name of the value in front would eat up space on the long run.

image

insert from cli: first 2 rows (good)
insert from node: the rest (bad)

I've read the documentation and left out the optional tag_set as is unnecessary.
Thank you.

The reason it has stored the string "Temperature=12.9" in the database is because you have passed it a string "Temperature=12.9".

The first question is, what does the data that you are getting into node red look like before you star manipulting it? Feed the values into a debug node and show us a screenshot so we can see.

Thanks Colin for answering,

image

debug_1 is indeed a string and just after you posted i've seen it in the "help" that string gets written to the value as a single entry.

" If msg.payload is an object containing multiple properties, the fields will be written to the measurement." - this means if i make this modification;

image
(this is the content of debug_2)

It will be like the first two rows of my first screenshot?

Yes you need the payload to be the javascript object
{Temperture: 22.3, Humidity: 57.8, DewPoint: 13.6}

You can do that with a Change node configured to Move msg.payload.StatusSNS.SI7021 To msg.payload

1 Like

yes, thank you, done and working

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