# New User, odd stiuation

**URL:** <https://discourse.nodered.org/t/new-user-odd-stiuation/45742>\
**Category:** General\
**Created:** [16 May 2021 23:41 UTC](https://discourse.nodered.org/t/new-user-odd-stiuation/45742 "2021-05-16T23:41:40Z")\
**Posts on this page:** 16\
**Page:** 2

<div class="post-metadata">

**Author:** ![Cyprus125](https://avatars.discourse-cdn.com/v4/letter/c/4bbf92/32.png) [@Cyprus125](https://discourse.nodered.org/u/Cyprus125)\
**Post date:** [18 May 2021 14:23 UTC](https://discourse.nodered.org/t/new-user-odd-stiuation/45742/21 "2021-05-18T14:23:05Z")

</div>

hello again, more questions,

now they are communicating, the "string" of information is less compadible with my switch thing i had setup before.

```auto
[{"id":"f8a45b09.c7ce3","type":"change","z":"63556fbb.5ffe8","name":"Temp","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.temperature_C","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":60,"wires":[["66c26dbb.42a1d4"]]},{"id":"74a6788f.78fd68","type":"change","z":"63556fbb.5ffe8","name":"Humi","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.humidity","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":120,"wires":[["f99809b9.92dd7"]]},{"id":"f99809b9.92dd7","type":"function","z":"63556fbb.5ffe8","name":"Round","func":"msg.payload = Number(msg.payload.toFixed(0));\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":890,"y":120,"wires":[["6dfe61a4.8375e","8dcabbb9.be269"]]},{"id":"66c26dbb.42a1d4","type":"function","z":"63556fbb.5ffe8","name":"Round","func":"msg.payload = Number(msg.payload.toFixed(0));\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":890,"y":60,"wires":[["8dcabbb9.be269","6dfe61a4.8375e"]]}]

```

on the remote side i get an output of 21, and 54. temp/humi.

when i use the same on the server to pull out the data i want from the string i get

`2021-05-18, 11:20:35 a.m.[node: ab8ab462.05b1e](http://192.168.1.15:1880/#)Marcus Room : msg.payload1 : undefined`

`2021-05-18, 11:20:35 a.m.[node: ab8ab462.05b1e](http://192.168.1.15:1880/#)Marcus Room : msg.payload1 : undefined`

```auto
2021-05-18, 11:20:35 a.m.[node: ab8ab462.05b1e](http://192.168.1.15:1880/#)

Marcus Room : msg.payload1 : undefined

undefined

```

the colors on the debug screen are different as well.

```auto
{ temperature_C: 21.06, humidity: 52.386141050827035, pressure_hPa: 1015.4996487140004, model: "BME280" }

```

temp, humi, and pressure are purple with blue data and red model. on server side it's all red.

does that do something to the data being sent?

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [18 May 2021 14:25 UTC](https://discourse.nodered.org/t/new-user-odd-stiuation/45742/22 "2021-05-18T14:25:52Z")

</div>

Hi, in order to make code more readable and importable it is important to surround your code with three backticks  
`````  
`like this`  
`````

You can edit and correct your post by clicking the pencil icon.

See this post for more details - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

---

<div class="post-metadata">

**Author:** ![Cyprus125](https://avatars.discourse-cdn.com/v4/letter/c/4bbf92/32.png) [@Cyprus125](https://discourse.nodered.org/u/Cyprus125)\
**Post date:** [18 May 2021 14:41 UTC](https://discourse.nodered.org/t/new-user-odd-stiuation/45742/23 "2021-05-18T14:41:59Z")

</div>

i'm really sorry, you need to dumb that down, cause that means nothing to me. even the other link, i have no  
"The easiest way to do that is to click the 'Preformatted Text' button in the toolbar:

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

Then paste in your code or flow json.

thing where i can add the

```auto
`like this`

```

to any of this code or nodes.

(like i have no idea how you put 3 "`" in this fourm with out making stuff red.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [18 May 2021 14:59 UTC](https://discourse.nodered.org/t/new-user-odd-stiuation/45742/24 "2021-05-18T14:59:52Z")

</div>

in your `round` function you have

```auto
msg.payload = Number(msg.payload.toFixed(0));

```

that should be

```auto
msg.payload = Number(msg.payload).toFixed(0);

```

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [18 May 2021 15:03 UTC](https://discourse.nodered.org/t/new-user-odd-stiuation/45742/25 "2021-05-18T15:03:25Z")

</div>

> [@Cyprus125](#):
>
> temp, humi, and pressure are purple with blue data and red model. on server side it's all red.
> 
> does that do something to the data being sent?

What I think you are saying it the data on the "server side is all red" is that it is a string  
where as on the other side it is an object.

Set the MQTT In nodes to parse JSON

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/2/a26840eaf7bc94d0617a7580c2ece549c0a87197.png)

That will turn the "all red" (string) into "purple with blue data and red model" (an object)

  

when you have an **object** it is easy to grab the values...

There’s a great page in the docs that will explain how to use the debug panel to find the right path to any data item.

Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.

![BX00Cy7yHi](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/d/bd1f333a9e043b061b39917c328b0094d3e52d30.gif)

[https://nodered.org/docs/user-guide/messages](https://nodered.org/docs/user-guide/messages)

---

<div class="post-metadata">

**Author:** ![Cyprus125](https://avatars.discourse-cdn.com/v4/letter/c/4bbf92/32.png) [@Cyprus125](https://discourse.nodered.org/u/Cyprus125)\
**Post date:** [18 May 2021 15:03 UTC](https://discourse.nodered.org/t/new-user-odd-stiuation/45742/26 "2021-05-18T15:03:51Z")

</div>

the round functiuon i had was working. that was also me exploring other ways to fix the underlying issue of unsuable data on my server side.

---

<div class="post-metadata">

**Author:** ![Cyprus125](https://avatars.discourse-cdn.com/v4/letter/c/4bbf92/32.png) [@Cyprus125](https://discourse.nodered.org/u/Cyprus125)\
**Post date:** [18 May 2021 15:05 UTC](https://discourse.nodered.org/t/new-user-odd-stiuation/45742/27 "2021-05-18T15:05:53Z")

</div>

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

i don't have those options.

---

<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:** [18 May 2021 15:06 UTC](https://discourse.nodered.org/t/new-user-odd-stiuation/45742/28 "2021-05-18T15:06:00Z")

</div>

> [@Cyprus125](#):
>
> i have no  
> "The easiest way to do that is to click the 'Preformatted Text' button in the toolbar:

When you next type a reply to a message in the forum look 1 cm above where you are typing.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [18 May 2021 15:08 UTC](https://discourse.nodered.org/t/new-user-odd-stiuation/45742/29 "2021-05-18T15:08:16Z")

</div>

> [@Cyprus125](#):
>
> ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/3/a35e9bd2f1b4df97dc4400e7ea803e63298b1241.png)

> [@Cyprus125](#):
>
> i don't have those options.

That ↑ is the MQTT Out node.

I said...

> [@Steve-Mcl](#):
>
> Set the MQTT In nodes to parse JSON

@Cyprus125 sorry to say this, but you really need to **read** the stuff we write mate. 😕

---

<div class="post-metadata">

**Author:** ![Cyprus125](https://avatars.discourse-cdn.com/v4/letter/c/4bbf92/32.png) [@Cyprus125](https://discourse.nodered.org/u/Cyprus125)\
**Post date:** [18 May 2021 15:10 UTC](https://discourse.nodered.org/t/new-user-odd-stiuation/45742/30 "2021-05-18T15:10:13Z")

</div>

the title if this thread is i'm a new user. i don't understand what you are saying. i can't find the options you guys are saying. i'm bashing my head againt the keyboard woundering why i'm trying to get this. i'm greatful for the help.

"Set the MQTT In nodes to parse JSON" didn't explain output side, or in my understanding on my server.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [18 May 2021 15:11 UTC](https://discourse.nodered.org/t/new-user-odd-stiuation/45742/31 "2021-05-18T15:11:45Z")

</div>

> [@Cyprus125](#):
>
> the title if this thread is i'm a new user

I know, i seen

> [@Cyprus125](#):
>
> i'm greatful for the help.

You are welcome.

Just asking that you slow down a bit & read the stuff we post please.

As a beginner, I feel you will benefit from watching this playlist: [Node-RED Essentials](https://www.youtube.com/playlist?list=PLyNBB9VCLmo1hyO-4fIZ08gqFcXBkHy-6). The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

---

<div class="post-metadata">

**Author:** ![Cyprus125](https://avatars.discourse-cdn.com/v4/letter/c/4bbf92/32.png) [@Cyprus125](https://discourse.nodered.org/u/Cyprus125)\
**Post date:** [18 May 2021 15:14 UTC](https://discourse.nodered.org/t/new-user-odd-stiuation/45742/32 "2021-05-18T15:14:17Z")

</div>

so changing that fixed the colors in my debug window, but still leaves me undefined data on the end of my switch nodes.

2021-05-18, 12:13:08 p.m.[node: 80b45df7.c1c3e](http://192.168.1.15:1880/#)Master Bedroom : msg.payload : Object

{ temperature\_C: 21.33, humidity: 50.766390783699855, pressure\_hPa: 1015.1776177171702, model: "BME280" }

2021-05-18, 12:13:08 p.m.[node: fb4ab453.a47c7](http://192.168.1.15:1880/#)Master Bedroom : msg.payload0 : undefined

undefined

2021-05-18, 12:13:08 p.m.[node: fb4ab453.a47c7](http://192.168.1.15:1880/#)Master Bedroom : msg.payload0 : undefined

undefined

2021-05-18, 12:13:08 p.m.[node: fb4ab453.a47c7](http://192.168.1.15:1880/#)

Master Bedroom : msg.payload0 : undefined

undefined

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [18 May 2021 15:16 UTC](https://discourse.nodered.org/t/new-user-odd-stiuation/45742/33 "2021-05-18T15:16:53Z")

</div>

I dont have your full flow so I can only guess

> [@Cyprus125](#):
>
> msg.payload0

Should that not be `msg.payload`?

---

<div class="post-metadata">

**Author:** ![Cyprus125](https://avatars.discourse-cdn.com/v4/letter/c/4bbf92/32.png) [@Cyprus125](https://discourse.nodered.org/u/Cyprus125)\
**Post date:** [18 May 2021 15:20 UTC](https://discourse.nodered.org/t/new-user-odd-stiuation/45742/34 "2021-05-18T15:20:57Z")

</div>

yes it is.

ok so see, i would have never looked then there cause while back i trying to trouble shoot my issues, i added 3 debugs and named them all different so i could differentiate the 3 outputs in my debug screen.

sadly i'm a tech by trade, so i'm use to troubleshooting stuff. but when i'm troubleshooting Greek and don't speak it i've been having my fair share of issues.

---

<div class="post-metadata">

**Author:** ![Cyprus125](https://avatars.discourse-cdn.com/v4/letter/c/4bbf92/32.png) [@Cyprus125](https://discourse.nodered.org/u/Cyprus125)\
**Post date:** [18 May 2021 15:26 UTC](https://discourse.nodered.org/t/new-user-odd-stiuation/45742/35 "2021-05-18T15:26:30Z")

</div>

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

and with all that head scratching and the pacents of you amazing people i have something i can now try and produce a nice spash page for my home website.

i'm sorry i don't understand alot, and and soooooo very greatfull for people like your selves in this world.

---

<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:** [17 July 2021 15:27 UTC](https://discourse.nodered.org/t/new-user-odd-stiuation/45742/36 "2021-07-17T15:27:01Z")

</div>

Closed on 17 July 2021 15:27 UTC

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

[Previous page](https://discourse.nodered.org/t/new-user-odd-stiuation/45742.md?page=1)
