Debug to Gauge Node

G'day,

Having a couple of issues getting my msg.payload to display as a value on my guage. I think I'm missing something faily simple.

Im running a loadcell through a HX711 into my arduino and using a serial node to display the data in nodered, I can display it as a numeric value but am unable to represent the data on a gauge.

Node%20Red%20Nodes
Node%20Red%20UI

what does the debug node show?

So you can’t send a string “weight : -0.35⏎"
to a gauge.

You would need to strip out the text and probably the ⏎ which you should be able to do with a change node (change the rule drop down to "Change"

Alternative alter your arduino code to send JSON which an be easily converted into a Javascript object with the JSON node

I did try the change node earlier, I don't quite understand how it works. I might need to do some research into it. This is what i have tried

search for the bit you want to remove i.e. the text bit
Replace with what you want to replace it with i.e. nothing

You are trying to end up with a payload that is "0.26" which although it is still a string (text) rather than being a value (number) the gauge should display.

1 Like

You need to get the number from the line of text

Send the payload to function node.
In that function node:

msg.payload = parseFloat(msg.payload)
return msg

And then feed it to the gauge node (and may be to debug node to see if value is correct)

https://www.w3schools.com/jsref/jsref_parsefloat.asp

Cheers mate, solved the problem, Seems pretty simple now :blush: