# Converting MQTT Payload to Dashbard gauge

**URL:** <https://discourse.nodered.org/t/converting-mqtt-payload-to-dashbard-gauge/5767>\
**Category:** Dashboard\
**Created:** [13 December 2018 18:12 UTC](https://discourse.nodered.org/t/converting-mqtt-payload-to-dashbard-gauge/5767 "2018-12-13T18:12:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SteffenP](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@SteffenP](https://discourse.nodered.org/u/SteffenP)\
**Post date:** [13 December 2018 18:12 UTC](https://discourse.nodered.org/t/converting-mqtt-payload-to-dashbard-gauge/5767/1 "2018-12-13T18:12:02Z")

</div>

Hi,

my name is Steffen, and I am new to Node Red and this board.

I am also not very used to this JSON stuff. Actually I am very blind. Maybe anyone can help me.

I got an MQTT message payload string which looks like this

"{"value": -161}"

How can I change it, so that a dashboard gauge can handle the value as int. So I am interested in the -161 only. it can have positive and negative values up to int32 range. I would like to use a function block or direct entry in dashboard gauge If possible.

I am sure, this is very simple, but I don't get it...

thanks in advance,  
Steffen

---

<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:** [13 December 2018 18:31 UTC](https://discourse.nodered.org/t/converting-mqtt-payload-to-dashbard-gauge/5767/2 "2018-12-13T18:31:44Z")

</div>

if it’s coming from MQTT it will be a string as you noticed. So use the JSON node to convert it back to a javascript object.

If you use a debug node after the JSON node you should see msg.payload.value is -161

Most nodes in Node-RED expect the important information to be in msg.payload

so you can then use a change node to Move msg.payload.value  
to msg.payload

---

<div class="post-metadata">

**Author:** ![SteffenP](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@SteffenP](https://discourse.nodered.org/u/SteffenP)\
**Post date:** [13 December 2018 22:02 UTC](https://discourse.nodered.org/t/converting-mqtt-payload-to-dashbard-gauge/5767/3 "2018-12-13T22:02:36Z")

</div>

Thanks a lot. This worked.
