# 2 sensor temperatures, I am lost how to get both values into a chart on Dashboard 1

**URL:** <https://discourse.nodered.org/t/2-sensor-temperatures-i-am-lost-how-to-get-both-values-into-a-chart-on-dashboard-1/98339>\
**Category:** General\
**Created:** [27 July 2025 17:58 UTC](https://discourse.nodered.org/t/2-sensor-temperatures-i-am-lost-how-to-get-both-values-into-a-chart-on-dashboard-1/98339 "2025-07-27T17:58:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![questuk](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/questuk/32/4059_2.png) [@questuk](https://discourse.nodered.org/u/questuk)\
**Post date:** [27 July 2025 17:58 UTC](https://discourse.nodered.org/t/2-sensor-temperatures-i-am-lost-how-to-get-both-values-into-a-chart-on-dashboard-1/98339/1 "2025-07-27T17:58:46Z")

</div>

I have tried for hours to get this to work, i want to plot 2 temperatures from an array  
I even tried AI which sent me down a ridiculous path !!!

I am using Dasboard 1

My array that comes into Node-RED from 2 sensors  
`{"DS1820":[{"heating":false,"temperature":25.8,"target":-1,"hysteresis":0.2},{"N/A":false,"temperature":26.4,"target":-1,"hysteresis":0.2}]}`

I have this flow that works as an example for random numbers but cannot get it to work with the above. I have tried many ways but I am out of my depth 🫠

```auto
[{"id":"810330e445c1b1a6","type":"inject","z":"37097d1320355ac2","name":"Trigger Snapshot","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1150,"y":2650,"wires":[["2df365f379c533a8"]]},{"id":"702e7c62e3581e42","type":"ui_chart","z":"37097d1320355ac2","name":"Sensor Chart","group":"622657530a0d7963","order":0,"width":"0","height":"0","label":"Sensor Temperatures","chartType":"line","legend":"true","xformat":"HH:mm:ss","nodata":"","dot":true,"ymin":"","ymax":"","removeOlder":"10","removeOlderPoints":"","removeOlderUnit":"60","cutout":"","useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":1170,"y":2760,"wires":[["af4a38f86160c9f3"]]},{"id":"af4a38f86160c9f3","type":"debug","z":"37097d1320355ac2","name":"Debug Output","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1170,"y":2820,"wires":[]},{"id":"2df365f379c533a8","type":"function","z":"37097d1320355ac2","name":"Generate Data","func":"var msg = {};\nvar msg1 = {};\nmsg.payload = Math.round(Math.random()*100);;\nmsg.topic = 'Line1';\nmsg1.payload = Math.round(Math.random()*100);\nmsg1.topic = 'Line2';\nreturn [msg, msg1];","outputs":2,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":1170,"y":2710,"wires":[["702e7c62e3581e42"],["702e7c62e3581e42"]]},{"id":"622657530a0d7963","type":"ui_group","name":"Charts","tab":"2cf3f4e5d086e667","order":1,"disp":true,"width":"25","collapse":false,"className":""},{"id":"2cf3f4e5d086e667","type":"ui_tab","name":"Charts","icon":"dashboard","order":4,"disabled":false,"hidden":false}]

```

Thanks

---

<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:** [27 July 2025 19:39 UTC](https://discourse.nodered.org/t/2-sensor-temperatures-i-am-lost-how-to-get-both-values-into-a-chart-on-dashboard-1/98339/2 "2025-07-27T19:39:05Z")

</div>

Your flow works fine for me, Here is what the dashboard looks like:

 ![Screenshot 2025-07-27 at 3.36.52 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/4/74a164d1b928b48751edfa8f02d0c11415be1fe2.png)

Note I did change the graph size to 6x6 and did the inject twice.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [27 July 2025 20:26 UTC](https://discourse.nodered.org/t/2-sensor-temperatures-i-am-lost-how-to-get-both-values-into-a-chart-on-dashboard-1/98339/3 "2025-07-27T20:26:02Z")

</div>

Your chart using "Generate data" works because that node sends two separate messages, each with a topic and a payload. You can check this with another debug node

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

Connecting the wires to the same input on another node (the chart) does not join them into a singe message.  
Nothing to do with the wires being slightly different length, Node-red only processes 1 message at a time.

So you need to send your actual sensor data as two separate messages, each with a topic and a payload.

I cannot immediately tell if the temperatures you give above (25.8 and 26.4) are readings from 2 different sensors, name unknown, or 2 sequential readings from a single sensor "DS1820".  
Therefore I can't advise the best way to split this message up.

How does the data get into this format? The "N/A" value suggests that something is not working well.

---

<div class="post-metadata">

**Author:** ![questuk](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/questuk/32/4059_2.png) [@questuk](https://discourse.nodered.org/u/questuk)\
**Post date:** [28 July 2025 07:05 UTC](https://discourse.nodered.org/t/2-sensor-temperatures-i-am-lost-how-to-get-both-values-into-a-chart-on-dashboard-1/98339/4 "2025-07-28T07:05:19Z")

</div>

Thanks to both of you for your help, you put me on the right track and with a clear head next day managed to get it working perfectly 😀

---

<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:** [26 October 2025 07:06 UTC](https://discourse.nodered.org/t/2-sensor-temperatures-i-am-lost-how-to-get-both-values-into-a-chart-on-dashboard-1/98339/5 "2025-10-26T07:06:09Z")

</div>

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