# How to extract only Temperature from a Msg.Payload : Object

**URL:** <https://discourse.nodered.org/t/how-to-extract-only-temperature-from-a-msg-payload-object/60316>\
**Category:** General\
**Tags:** function-node\
**Created:** [25 March 2022 00:11 UTC](https://discourse.nodered.org/t/how-to-extract-only-temperature-from-a-msg-payload-object/60316 "2022-03-25T00:11:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrea](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@andrea](https://discourse.nodered.org/u/andrea)\
**Post date:** [25 March 2022 00:11 UTC](https://discourse.nodered.org/t/how-to-extract-only-temperature-from-a-msg-payload-object/60316/1 "2022-03-25T00:11:46Z")

</div>

Hi, I just want to visualise the 2 temperatures coming from 2 DS18B20 connected on port 4.  
For some reason the payload is not just a number but it containd the id and the temperature.  
How can I send only the value of the temperature to the gauge?

```auto
[{"id":"e2b4fabf.4316f8","type":"ui_gauge","z":"ec21e019.06fec","name":"","group":"653a7658.e1df08","order":3,"width":0,"height":0,"gtype":"gage","title":"gauge","label":"units","format":"{{value}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"","x":650,"y":240,"wires":[]},{"id":"653a7658.e1df08","type":"ui_group","name":"Temperature Ext Int","tab":"590954b.dffadac","order":1,"disp":true,"width":11,"collapse":false,"className":""},{"id":"590954b.dffadac","type":"ui_tab","name":"Grafico","icon":"dashboard","disabled":false,"hidden":false}]

```

Thanks for your help

Andrea

 ![Dashboard1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/f/bfc05d432745e8cd9198466923bfbf694662f8a3.jpeg)  
 ![Flow1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/5/a5635461842a629c997035ed6d74224792e6aafd.jpeg)

---

<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:** [25 March 2022 00:22 UTC](https://discourse.nodered.org/t/how-to-extract-only-temperature-from-a-msg-payload-object/60316/2 "2022-03-25T00:22:16Z")

</div>

Many ways to do this. One simple way is to use the change node just before the gauge

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/e/4e3306d344665657a4f952679f7bb5e17d32304e.png)

---

<div class="post-metadata">

**Author:** ![shrickus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shrickus/32/517_2.png) [@shrickus](https://discourse.nodered.org/u/shrickus)\
**Post date:** [25 March 2022 00:26 UTC](https://discourse.nodered.org/t/how-to-extract-only-temperature-from-a-msg-payload-object/60316/3 "2022-03-25T00:26:38Z")

</div>

Or just set the `ui_gauge` node to show the value of `msg.payload.temperature` directly?

---

<div class="post-metadata">

**Author:** ![andrea](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@andrea](https://discourse.nodered.org/u/andrea)\
**Post date:** [25 March 2022 02:21 UTC](https://discourse.nodered.org/t/how-to-extract-only-temperature-from-a-msg-payload-object/60316/4 "2022-03-25T02:21:06Z")

</div>

Magnificent! thanks Feeling very newbe... ahahaha

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [25 March 2022 14:35 UTC](https://discourse.nodered.org/t/how-to-extract-only-temperature-from-a-msg-payload-object/60316/5 "2022-03-25T14:35:55Z")

</div>

It saves a node if, instead of the change node, in the Gauge node you set the Value Format field to `{{msg.payload.temperature}}`, which was what @shrickus was suggesting.l

---

<div class="post-metadata">

**Author:** ![andrea](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@andrea](https://discourse.nodered.org/u/andrea)\
**Post date:** [26 March 2022 01:20 UTC](https://discourse.nodered.org/t/how-to-extract-only-temperature-from-a-msg-payload-object/60316/6 "2022-03-26T01:20:35Z")

</div>

Thanks. Really appreciated

---

<div class="post-metadata">

**Author:** ![andrea](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@andrea](https://discourse.nodered.org/u/andrea)\
**Post date:** [26 March 2022 01:21 UTC](https://discourse.nodered.org/t/how-to-extract-only-temperature-from-a-msg-payload-object/60316/7 "2022-03-26T01:21:00Z")

</div>

Got it, thanks. I like both solutions

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [25 May 2022 01:21 UTC](https://discourse.nodered.org/t/how-to-extract-only-temperature-from-a-msg-payload-object/60316/8 "2022-05-25T01:21:03Z")

</div>

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