MQTT json file to influxdb

Hello!

Im trying to send a JSON with data over MQTT which i convert to a javascript object and then send to influxDB which will later go to my grafana. However when i insert my data in influx the values come in as strings, i assume this is causing the problem with me not being able to display the values. Does anyone know how to fix this?

Welcome to the forum!

Can you post your flow?

Feed the message you are feeding into influx into a debug node and show us what it looks like.

Is this directly from a MQTT node?
If so try setting the MQTT node to output a parsed JSON object.

Screenshot-10

Yes, i'm outputting using that option in my MQTT node.

What error message does InfluxDB give?

Theres no error, the values get inserted as strings, is there a way to convert them in node-red?

What is creating the data in the first place? Looks like that is creating the strings and that would be the best place to fix it.

1 Like

First you have to decide what you want to write to the influx. The message you have shown has a nested object bandwidth. You can't write objects to influx, only fields and tags. Look at the help text for the influx node and it will tell you what the data has to look like. First you need to design the db schema though.

1 Like

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