# Debug to Gauge Node

**URL:** <https://discourse.nodered.org/t/debug-to-gauge-node/13515>\
**Category:** Dashboard\
**Created:** [21 July 2019 09:56 UTC](https://discourse.nodered.org/t/debug-to-gauge-node/13515 "2019-07-21T09:56:02Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rawbutter](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@Rawbutter](https://discourse.nodered.org/u/Rawbutter)\
**Post date:** [21 July 2019 09:56 UTC](https://discourse.nodered.org/t/debug-to-gauge-node/13515/1 "2019-07-21T09:56:03Z")

</div>

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](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/7/7a56b6eeb69a5843ba432415a6e4b5cbb40d3323.png)  
 ![Node%20Red%20UI](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/d/d68f3f1494b029489ff9c4d9bc359121e775c776.png)

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [21 July 2019 10:15 UTC](https://discourse.nodered.org/t/debug-to-gauge-node/13515/2 "2019-07-21T10:15:00Z")

</div>

what does the debug node show?

---

<div class="post-metadata">

**Author:** ![Rawbutter](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@Rawbutter](https://discourse.nodered.org/u/Rawbutter)\
**Post date:** [21 July 2019 10:20 UTC](https://discourse.nodered.org/t/debug-to-gauge-node/13515/3 "2019-07-21T10:20:40Z")

</div>

![Debug%20Output](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/0/028ddb452767da41159fb11c8309c9763e73226c.png)

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [21 July 2019 11:02 UTC](https://discourse.nodered.org/t/debug-to-gauge-node/13515/4 "2019-07-21T11:02:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Rawbutter](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@Rawbutter](https://discourse.nodered.org/u/Rawbutter)\
**Post date:** [21 July 2019 13:08 UTC](https://discourse.nodered.org/t/debug-to-gauge-node/13515/5 "2019-07-21T13:08:14Z")

</div>

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

 ![Change%20Node](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/5/533f2c812c893d0120ead395d415fc531bdad018.png)

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [21 July 2019 13:21 UTC](https://discourse.nodered.org/t/debug-to-gauge-node/13515/6 "2019-07-21T13:21:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [21 July 2019 13:44 UTC](https://discourse.nodered.org/t/debug-to-gauge-node/13515/7 "2019-07-21T13:44:49Z")

</div>

You need to get the number from the line of text

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

```auto
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](https://www.w3schools.com/jsref/jsref_parsefloat.asp)

---

<div class="post-metadata">

**Author:** ![Rawbutter](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@Rawbutter](https://discourse.nodered.org/u/Rawbutter)\
**Post date:** [21 July 2019 13:56 UTC](https://discourse.nodered.org/t/debug-to-gauge-node/13515/8 "2019-07-21T13:56:26Z")

</div>

Cheers mate, solved the problem, Seems pretty simple now 😊

 ![Node%20Red](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/f/f89dfd55397adc25b3ca86c621e397b106273519.png)

 ![Gauges](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/d/df16d4406a2b539f8297430b396cc084cd55f33f.png)
