# New to node red struggling

**URL:** <https://discourse.nodered.org/t/new-to-node-red-struggling/72279>\
**Category:** General\
**Created:** [15 December 2022 18:52 UTC](https://discourse.nodered.org/t/new-to-node-red-struggling/72279 "2022-12-15T18:52:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![montyfert](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@montyfert](https://discourse.nodered.org/u/montyfert)\
**Post date:** [15 December 2022 18:52 UTC](https://discourse.nodered.org/t/new-to-node-red-struggling/72279/1 "2022-12-15T18:52:49Z")

</div>

hi im new to node red and mqtt i have a sonoff th flashed with tasmota and i am trying to get the temperature to show in node red dashboard. this is how i set it up and what i get

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/7/97e9940021fa94f639e98fe8ab34f795617953d5.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/1/a123957fe8c661e6abde13d5dd9dd1f5fc04beb0.png)

any help would be great  
thanks in advance  
martin

---

<div class="post-metadata">

**Author:** ![montyfert](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@montyfert](https://discourse.nodered.org/u/montyfert)\
**Post date:** [15 December 2022 18:53 UTC](https://discourse.nodered.org/t/new-to-node-red-struggling/72279/2 "2022-12-15T18:53:50Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/8/48ed1e57f0229fefa894bba92df51784f5fa5cf0.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/c/0cd5fc5098da27728edc7c1411e2a52663ba9e5c.png)

---

<div class="post-metadata">

**Author:** ![znetsixe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/znetsixe/32/72588_2.png) [@znetsixe](https://discourse.nodered.org/u/znetsixe)\
**Post date:** [15 December 2022 19:32 UTC](https://discourse.nodered.org/t/new-to-node-red-struggling/72279/3 "2022-12-15T19:32:04Z")

</div>

Place a function node between your mqtt node and your ui node and write the following.

```auto
var temp = msg.payload.DS18B20.Temperature;

msg.payload = temp;
msg.topic = "Temperature";

Return msg;

```

The mqtt reply is a javascript object. You fetch the value from the object as demonstrated above.  
The ui node needs a numeric value to display correctly.

The msg in node red is also an object. Always consisting out of minimum a topic and a payload.

Topic = description  
Payload = value

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [15 December 2022 19:55 UTC](https://discourse.nodered.org/t/new-to-node-red-struggling/72279/4 "2022-12-15T19:55:20Z")

</div>

Or use a change node:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/5/5529ff2a36ccda2dd9bc66f043b964ee4a9b0c48.png)

---

<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:** [15 December 2022 21:41 UTC](https://discourse.nodered.org/t/new-to-node-red-struggling/72279/5 "2022-12-15T21:41:03Z")

</div>

Or in the Value Format field of the gauge put  
`{{payload.DS18B20.Temperature}}`

---

<div class="post-metadata">

**Author:** ![montyfert](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@montyfert](https://discourse.nodered.org/u/montyfert)\
**Post date:** [15 December 2022 22:07 UTC](https://discourse.nodered.org/t/new-to-node-red-struggling/72279/6 "2022-12-15T22:07:54Z")

</div>

thanks so much for the help i was pulling my hair out .  
martin

---

<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:** [13 February 2023 22:08 UTC](https://discourse.nodered.org/t/new-to-node-red-struggling/72279/7 "2023-02-13T22:08:52Z")

</div>

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