Get simple data into influxdb

i am sure i read a possibility but i can´t detect it.
I have a issue to create a right output for the Influxout node.
Data comes as a String, in this are only one number and one unit.
A Debug Node give me that:

19.1.2020, 17:12:02node: e8225dae.416db
MamaPiKg/kilo/ : msg.payload : string[14]
0.00 kg

Please can every one give me an simple example for a influx input (messurement) when the Influx node get this "0.00 kg" string. Or the code for another node like a function or change node.
I ask because this case have not so much time to work.
Must read my mothers weight because of diabetic.

Thanks a lot and best wishes from germany!
Greets Thorsten

The string you show is only 7 bytes but it says it is 14. Can you post a screenshot showing the debug output so we can see it exactly? You need to extract the number out of the string so it is important to know exactly what is there.

Hello Colin,
thanks for spending your time!
Your question shows me a little bit the way where i have to look. i see the great difference. But it means nothing to me.
Here is the screenshot.

You see the data comes via mqtt.
There are from a raspberry zero, near by the "Datagenerator".
I read the value from a medical scale via bluetooth to the pi.

Thanks very much!
hope understanding my untrained english..

Nothing with deploying, i just stoped the debug nodes.
(Just see the blue markers)

OK, that tells us what we need to know, there are spaces before the number but that shouldn't be a problem. The first thing to do is to extract the number as an actual number not as a string, which it is what it is at the moment (a sequence of spaces follow by a 0 then a . then another 0). Then this needs to be include in a object with the field name ready for passing to the influxdb node. So in a Function you can put

// first get the weight out as a number
let value = parseFloat(msg.payload)
// now build the message ready for influx
msg.payload = {weight: value}
return msg;

And feed that into the influxdb node. I have assumed that the field you want to store it as is called weight, change that to whatever you want it to be called.
It looks like your mother is a little underweight at the moment :slight_smile:

If you read the docs on working with messages it should help you to understand what is going on.

Hello Collin,
what should i say, thats works pretty fine.
Thank you very much!
Whith that working modell, i can make some next steps.
I will do equal good to another person.
Don´t think you could learn from me to the topics here.

Have a nice sunday with the best wishes to you


Can be closed as solved.