# How to split a payload ? And display information on Dashboard

**URL:** <https://discourse.nodered.org/t/how-to-split-a-payload-and-display-information-on-dashboard/11195>\
**Category:** General\
**Created:** [16 May 2019 03:46 UTC](https://discourse.nodered.org/t/how-to-split-a-payload-and-display-information-on-dashboard/11195 "2019-05-16T03:46:17Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![LoupiasM](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@LoupiasM](https://discourse.nodered.org/u/LoupiasM)\
**Post date:** [16 May 2019 03:46 UTC](https://discourse.nodered.org/t/how-to-split-a-payload-and-display-information-on-dashboard/11195/1 "2019-05-16T03:46:17Z")

</div>

Hello everyone,  
I'm a French student who discovered Node-Red one month ago.  
I need help because i want to split the information of the payload  
 ![Capteurs](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/2/23d3ffaf93f4f2208fdb8884a7d83f4c971fb0bd.png)  
And display the information on differents gauge, so i try to use the split node but i don't know how to use it.  
Hope you can help me !

 ![Code](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/b/b446ab1edd27aa613693f61d0645c0afa71258e3.png)

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [16 May 2019 05:04 UTC](https://discourse.nodered.org/t/how-to-split-a-payload-and-display-information-on-dashboard/11195/2 "2019-05-16T05:04:48Z")

</div>

You don't need the split node if you receive this object.

You can connect the device directly to the gauge nodes and use mustache format in the value field:

`{{msg.payload.payload_fields.analog_in_1}}`

---

<div class="post-metadata">

**Author:** ![LoupiasM](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@LoupiasM](https://discourse.nodered.org/u/LoupiasM)\
**Post date:** [16 May 2019 05:26 UTC](https://discourse.nodered.org/t/how-to-split-a-payload-and-display-information-on-dashboard/11195/3 "2019-05-16T05:26:23Z")

</div>

First of all thanks for your answer.  
I already tried it before but i have a mistake when i do that here it is :

 ![Erreur](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/b/b2a61f9efa2a3ae8b38582da821abc79cd17644e.png)

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [16 May 2019 05:31 UTC](https://discourse.nodered.org/t/how-to-split-a-payload-and-display-information-on-dashboard/11195/4 "2019-05-16T05:31:34Z")

</div>

See here [https://nodered.org/docs/user-guide/messages](https://nodered.org/docs/user-guide/messages)  
To work out what your msg properties really are

---

<div class="post-metadata">

**Author:** ![LoupiasM](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@LoupiasM](https://discourse.nodered.org/u/LoupiasM)\
**Post date:** [16 May 2019 05:48 UTC](https://discourse.nodered.org/t/how-to-split-a-payload-and-display-information-on-dashboard/11195/5 "2019-05-16T05:48:19Z")

</div>

Yeah so i use your link and I see I can copy the path so it's work.

 ![Code](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/e/e79a5cef89dc4ca166efa1f05ce5d7295ef3d77f.png)  
 ![Device](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/b/b72925c4853c3860f827b962052a37b0682526b2.png)  
Now i will try to add the notifications if the temperature is too high for example if I need your help I will come back.  
Thanks for your help and your reactivity !

---

<div class="post-metadata">

**Author:** ![LoupiasM](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@LoupiasM](https://discourse.nodered.org/u/LoupiasM)\
**Post date:** [16 May 2019 07:10 UTC](https://discourse.nodered.org/t/how-to-split-a-payload-and-display-information-on-dashboard/11195/6 "2019-05-16T07:10:04Z")

</div>

So I wanted to have the value of battery in %.  
But in my payload it's the value in Volt (3.3V for example).  
I tried to write the calcul in the value format but it doesn't work, so do I need to use a function before ?

 ![Batterie](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/b/b3865432a11369bb86c9b9ba681ebe9c224ca976.png)

---

<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:** [16 May 2019 10:37 UTC](https://discourse.nodered.org/t/how-to-split-a-payload-and-display-information-on-dashboard/11195/7 "2019-05-16T10:37:46Z")

</div>

the way you have the gauge set up, it will show the value it gets on a gauge set to show values between 0 and 100. So, currently (no pun intended) your 3.3 volts is being assumed to be 3.3 percent.

So you need to calculate how much 3.3v is of the total voltage of the battery. You could use a `function` node or a `change` node or `range` node (and probably others) to calculate the percentage. Check out all three and see which makes the best sense and/or is easiest to use.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [16 May 2019 12:22 UTC](https://discourse.nodered.org/t/how-to-split-a-payload-and-display-information-on-dashboard/11195/8 "2019-05-16T12:22:27Z")

</div>

(which of course begs the question... is 3.3V 100% ? most Lipos can go up to 4.2 (or at least 3.7) - 3.3 is only the nominal voltage... - and of course has nothing to do with battery capacity... 🙂

---

<div class="post-metadata">

**Author:** ![LoupiasM](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@LoupiasM](https://discourse.nodered.org/u/LoupiasM)\
**Post date:** [21 May 2019 08:57 UTC](https://discourse.nodered.org/t/how-to-split-a-payload-and-display-information-on-dashboard/11195/9 "2019-05-21T08:57:12Z")

</div>

Hello just wanted to give some news about my project !  
This is my flow now :

 ![Flow](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/4/4c9005da411a48eda55e1b34160879b9235d1f08.png)  
For the value of the battery i use this function : ![Function](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/2/28436b2866cddebfc788625b05c346d1476a78c0.png)  
And this is my final dashboard : ![Dashboard](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/2/26c827c1491e0730f9bbd1094ad649a832b749da.png)  
My question is do you think i can put all my device (8 on total) on the same flow and choose which device i want to show on the dashboard with a dropdown node ?  
Thanks in advance

---

<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:** [21 May 2019 09:37 UTC](https://discourse.nodered.org/t/how-to-split-a-payload-and-display-information-on-dashboard/11195/10 "2019-05-21T09:37:57Z")

</div>

Would it be possible...maybe.

First off, backup your existing flow so if things don't work, you could recover.

If all the devices have a unique identifier, I'd have the dropdown (with the value set to the unique identifier) connect to a change node that stored that value in a flow variable.

Next I'd have all the device nodes feed to a switch node that would compare the device's unique identifier against the flow variable. If it matches then send that data thru otherwise dump it.

Depending on how ofter the devices send data, it might take a moment for the data to be updated.

Oh, it looks like most devices don't have a sound gauge.

---

<div class="post-metadata">

**Author:** ![LoupiasM](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@LoupiasM](https://discourse.nodered.org/u/LoupiasM)\
**Post date:** [21 May 2019 09:42 UTC](https://discourse.nodered.org/t/how-to-split-a-payload-and-display-information-on-dashboard/11195/11 "2019-05-21T09:42:38Z")

</div>

Yeah i will try to do this.  
And for the sound don t worry we just had for one device because we need to calibrate the sensor.

---

<div class="post-metadata">

**Author:** ![LoupiasM](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@LoupiasM](https://discourse.nodered.org/u/LoupiasM)\
**Post date:** [22 May 2019 03:17 UTC](https://discourse.nodered.org/t/how-to-split-a-payload-and-display-information-on-dashboard/11195/12 "2019-05-22T03:17:31Z")

</div>

This don't do exactly what I wanted to do. Do you think there is a way to choose which device I want to show on the Dashboard ?  
Do you also know if i can use the level of this : node-red-contrib-ui-level, for display the temperature because i try to play with it but it seems like he don't want to take value.

---

<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:** [22 May 2019 10:23 UTC](https://discourse.nodered.org/t/how-to-split-a-payload-and-display-information-on-dashboard/11195/13 "2019-05-22T10:23:11Z")

</div>

> [@LoupiasM](#):
>
> Do you think there is a way to choose which device I want to show on the Dashboard ?

Yes! Use a ui\_dropdown. Here is a demo flow showing how it can be done:

 ![multi-device-guage-demo](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/3/39a77b6bc1a883df4d5aa998461fe349fb70880b.png)  
[multi-device-guage-demo.json](https://discourse.nodered.org/uploads/short-url/pI5y1ucsZSABdps0Z5ZzntXrskJ.json) (5.9 KB)

---

<div class="post-metadata">

**Author:** ![LoupiasM](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@LoupiasM](https://discourse.nodered.org/u/LoupiasM)\
**Post date:** [23 May 2019 01:32 UTC](https://discourse.nodered.org/t/how-to-split-a-payload-and-display-information-on-dashboard/11195/14 "2019-05-23T01:32:37Z")

</div>

Okay i will try it today !

---

<div class="post-metadata">

**Author:** ![LoupiasM](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@LoupiasM](https://discourse.nodered.org/u/LoupiasM)\
**Post date:** [23 May 2019 04:25 UTC](https://discourse.nodered.org/t/how-to-split-a-payload-and-display-information-on-dashboard/11195/15 "2019-05-23T04:25:46Z")

</div>

So i have some trouble to do that.  
My device send payload like that : ![Payload](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/e/e43d601c45513831ff4f5694924d0a4bfe1207ca.png)  
So for example i just try to display the temperature of 2 devices and choose which one I want to publish here is the flow :

 ![Flow](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/d/dd9c4558a715bf161a9d1e4b4f7f174cd1729539.png)  
 ![Change](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/d/d12fbb16bc0fde69ea34707aa415bc5f7df18c17.png) ![Switch](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/f/fa6434c0820dff1c3f4321006cf65b96e4d0c8c7.png)  
Do u have any idea why it doesn t work ?

---

<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:** [23 May 2019 09:15 UTC](https://discourse.nodered.org/t/how-to-split-a-payload-and-display-information-on-dashboard/11195/16 "2019-05-23T09:15:49Z")

</div>

> [@LoupiasM](#):
>
> Do u have any idea why it doesn t work ?

Yes, but seeing as you are a student, you will have to work for the answers in order to learn.

What big difference is there between my flow and yours?
