How to set the _field tag to write to influxdb using the influxdb out node?

Hey everyone,

I'm new to node-red and already learned a lot from browsing this forum.

I have a little flow that right now uses a single object to write a value into influx db using the influxdb out node.
My problem is, that the entries made in influxdb have _value as the _field tag where I want it do be AT and I don't get why that is. The object send to the influxdb out node is

grafik

I am thankful for hints and ideas and happy to learn.

Welcome to the forum @HerrLux

As described in the help text for the node, you can pass on object in msg.payload with the property AT set to the value.

You do that in a Change node configured like this
image

Then feed that into a Debug node to make sure it looks right before connecting to the Influx node.

Thank you very much Colin.

In between your two replies I came up with a function note that does the trick for me

msg.payload = [{
       "AT": msg.payload,
   }];
return msg;

If you want to do it in a function (which is less efficient than a change node) then you can take out the square brackets. It doesn't need to be an array. Again, see the help text for the node.

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