# Empty values on template

**URL:** <https://discourse.nodered.org/t/empty-values-on-template/51538>\
**Category:** Dashboard\
**Tags:** node-red-dashboard\
**Created:** [26 September 2021 15:28 UTC](https://discourse.nodered.org/t/empty-values-on-template/51538 "2021-09-26T15:28:16Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![JeroenKokhuis](https://avatars.discourse-cdn.com/v4/letter/j/2bfe46/32.png) [@JeroenKokhuis](https://discourse.nodered.org/u/JeroenKokhuis)\
**Post date:** [26 September 2021 15:28 UTC](https://discourse.nodered.org/t/empty-values-on-template/51538/1 "2021-09-26T15:28:16Z")

</div>

Hello,

I want to show temperature en humidity form different deivces on an floorplan. So I use a join to combine the different payloads. After that I use a function to save the values and restore them at reload. ( otherwise I have empty values).

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/d/4d605c8369dcda2b3e2c448e67d51300458dd249.png)  
This is the output of the join node:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/8/38d858604ca281f51abcb105fc509ac340a85d1e.png)  
So I have 4 different payloads.

This is the function node:

```auto
var temp1 = flow.get("tBadkamer") || undefined;
var hum1 = flow.get("hBadkamer") || undefined;
var temp2 = flow.get("tEntree") || undefined;
var hum2 = flow.get("hEntree") || undefined;
var temp3 = flow.get("tBuiten") || undefined;
var hum3 = flow.get("hBuiten") || undefined;
var temp4 = flow.get("tWoonkamer") || undefined;
var hum4 = flow.get("hWoonkamer") || undefined;

flow.set("tBadkamer",msg.payload[1].sensorDataPoints.insideTemperature.celsius);
flow.set("hBadkamer",msg.payload[1].sensorDataPoints.humidity.percentage);
msg.payload.tbadkamer = temp1
msg.payload.hbadkamer = hum1

flow.set("tEntree",msg.payload[2].sensorDataPoints.insideTemperature.celsius);
flow.set("hEntree",msg.payload[2].sensorDataPoints.humidity.percentage);
msg.payload.tentree = temp2
msg.payload.hentree = hum2
return msg

flow.set("tBuiten",msg.payload[3].devices[0].modules[0].dashboard_data.Temperature);
flow.set("hBuiten",msg.payload[3].devices[0].modules[0].dashboard_data.Humidity);
msg.payload.tbuiten = temp3
msg.payload.hbuiten = hum3
return msg

flow.set("tWoonkamer",msg.payload[0].sensorDataPoints.insideTemperature.celsius);
flow.set("hWoonkamer",msg.payload[0].sensorDataPoints.humidity.percentage);
msg.payload.twoonkamer = temp4
msg.payload.hWoonkamer = hum4
return msg

```

This is the template:

```auto
<style>
#THBuiten {
    left: 1300px !important;
    Top: 730px !important;
}
#THWoonkamer {
    left: 500px !important;
    Top: 310px !important;
}
#THBadkamer {
    left: 1250px !important;
    Top: 250px !important;
}
#THEntree {
    left: 30% !important;
    Top: 65% !important;
}
#valuehome {
    color: black;
    vertical-align: middle;
    text-align: right;
}
#svghome {
    text-align: -webkit-right;
}
.divTable{
	display: table;
    border-collapse: separate;
    border: 2px solid #999999;
    border-radius: 10px;
    position: absolute;
    width:100px;
    height:30px;
}
.divTableRow {
	display: table-row;
}
.divTableHeading {
	background-color: #EEE;
	display: table-header-group;
}
.divTableCell, .divTableHead {
	border: 1px solid #999999;
	display: table-cell;
	z-index: 1000;
}
.divTableBody {
	display: table-row-group;
}
</style>
<div>
<div class="divTable" id="THBuiten">
<div class="divTableBody">
<div class="divTableRow">
<div class="divTableCell" id="valuehome">{{msg.payload.tbuiten}}</div><div class="divTableCell" id="valuehome">°C</div><div class="divTableCell" id="svghome"><img src="icons/thermometer.svg" width="30" height="30"></div>
</div>
<div class="divTableRow">
<div class="divTableCell" id="valuehome">{{msg.payload.hbuiten}}</div><div class="divTableCell" id="valuehome">%</div><div class="divTableCell" id="svghome"><img src="icons/humidity.svg" width="30" height="30"></div>
</div>
</div>
</div>
</div>
<div>
<div class="divTable" id="THWoonkamer">
<div class="divTableBody">
<div class="divTableRow">
<div class="divTableCell" id="valuehome">{{msg.payload.twoonkamer}}</div><div class="divTableCell" id="valuehome">°C</div><div class="divTableCell" id="svghome"><img src="icons/thermometer.svg" width="30" height="30"></div>
</div>
<div class="divTableRow">
<div class="divTableCell" id="valuehome">{{msg.payload.hwoonkamer}}</div><div class="divTableCell" id="valuehome">%</div><div class="divTableCell" id="svghome"><img src="icons/humidity.svg" width="30" height="30"></div>
</div>
</div>
</div>
<div>
<div class="divTable" id="THBadkamer">
<div class="divTableBody">
<div class="divTableRow">
<div class="divTableCell" id="valuehome">{{flow.temp1}}</div><div class="divTableCell" id="valuehome">°C</div><div class="divTableCell" id="svghome"><img src="icons/thermometer.svg" width="30" height="30"></div>
</div>
<div class="divTableRow">
<div class="divTableCell" id="valuehome">{{flow.hum1}}</div><div class="divTableCell" id="valuehome">%</div><div class="divTableCell" id="svghome"><img src="icons/humidity.svg" width="30" height="30"></div>
</div>
</div>
</div>
</div>
<div>
<div class="divTable" id="THEntree">
<div class="divTableBody">
<div class="divTableRow">
<div class="divTableCell" id="valuehome">{{msg.payload.tentree}}</div><div class="divTableCell" id="valuehome">°C</div><div class="divTableCell" id="svghome"><img src="icons/thermometer.svg" width="30" height="30"></div>
</div>
<div class="divTableRow">
<div class="divTableCell" id="valuehome">{{msg.payload.hentree}}</div><div class="divTableCell" id="valuehome">%</div><div class="divTableCell" id="svghome"><img src="icons/humidity.svg" width="30" height="30"></div>
</div>
</div>
</div>
</div>
</div>

```

But I don't get any values. Anyone know why?

---

<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:** [26 September 2021 15:46 UTC](https://discourse.nodered.org/t/empty-values-on-template/51538/2 "2021-09-26T15:46:26Z")

</div>

> [@JeroenKokhuis](#):
>
> But I don't get any values. Anyone know why?

I was going to comment your code but there are so many issues...

1. You havent shared your flow some some things are assumed
2. You have multiple returns (any thing after the first return is NEVER executed)
3. You grab value from `flow` and set the msg prop but you dont update the flow value at the right time (your `flow.get` statements will always retrieve the old value due to code ordering)
4. you are using `array` mode on the join node - you can never guarantee the order of values coming from devices and thus the order of the items in the array may be mixed up.
5. You assign new properties values to the incoming `msg.payload` - which is an array. You should not do this. Create a new object with properties and assign that to payload.

Recommendations

1. Use the key/value mode in the join
2. Either delete the `flow` context parts of your function OR if you need flow context, store the single joined object - but always use the values from the join node.

---

<div class="post-metadata">

**Author:** ![JeroenKokhuis](https://avatars.discourse-cdn.com/v4/letter/j/2bfe46/32.png) [@JeroenKokhuis](https://discourse.nodered.org/u/JeroenKokhuis)\
**Post date:** [26 September 2021 16:20 UTC](https://discourse.nodered.org/t/empty-values-on-template/51538/3 "2021-09-26T16:20:54Z")

</div>

Thanks for your reply. I'm not a programmer but I'm trying to learn.

There are passwords and usernames in the flow. That's why I didn't share my flow.

> [@Steve-Mcl](#):
>
> 1. Use the key/value mode in the join

I did use the key/value mode in the join but there is nothing comming trough.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/0/40aaa08b160dc15709bd90d9b0cadf4ab64d6a40.png)

> [@Steve-Mcl](#):
>
> 1. Either delete the `flow` context parts of your function

I did delete the function node but there is not any data comming trough

> [@Steve-Mcl](#):
>
> OR if you need flow context, store the single joined object - but always use the values from the join node.

I don't know how to do that.

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [26 September 2021 16:23 UTC](https://discourse.nodered.org/t/empty-values-on-template/51538/4 "2021-09-26T16:23:06Z")

</div>

Following the recommendations from @Steve-Mcl you will have a function node that will looks more like below. I just removed the major errors, so it still needs improvements and could be rewritten in a better way.

```auto
var temp1 = flow.get("tBadkamer") || undefined;
var hum1 = flow.get("hBadkamer") || undefined;
var temp2 = flow.get("tEntree") || undefined;
var hum2 = flow.get("hEntree") || undefined;
var temp3 = flow.get("tBuiten") || undefined;
var hum3 = flow.get("hBuiten") || undefined;
var temp4 = flow.get("tWoonkamer") || undefined;
var hum4 = flow.get("hWoonkamer") || undefined;

flow.set("tWoonkamer",msg.payload[0].temperature);
flow.set("hWoonkamer",msg.payload[0].humidity);
flow.set("tBadkamer",msg.payload[1].temperature);
flow.set("hBadkamer",msg.payload[1].humidity);
flow.set("tEntree",msg.payload[2].temperature);
flow.set("hEntree",msg.payload[2].humidity);
flow.set("tBuiten",msg.payload[3].temperature);
flow.set("hBuiten",msg.payload[3].humidity);

//added
msg.payload = {};
//endadded

msg.payload.tbadkamer = temp1
msg.payload.hbadkamer = hum1
msg.payload.tentree = temp2
msg.payload.hentree = hum2
msg.payload.tbuiten = temp3
msg.payload.hbuiten = hum3
msg.payload.twoonkamer = temp4
msg.payload.hWoonkamer = hum4
return msg

```

---

<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:** [26 September 2021 16:28 UTC](https://discourse.nodered.org/t/empty-values-on-template/51538/5 "2021-09-26T16:28:28Z")

</div>

> [@JeroenKokhuis](#):
>
> There are passwords and usernames in the flow. That's why I didn't share my flow.

Exported flows wont contain passwords. To prove this, export flow, paste to text editor, search for your private details - they should not be there.

Also, you dont have to export everything. You can select only the relevant nodes and press CTRL+E

Lastly, you could setup a mock flow that demonstrates your issue - using change nodes instead of the TADO nodes (since people will NOT have your sensors and likely wont have the TADO nodes installed)

> [@JeroenKokhuis](#):
>
> I did use the key/value mode in the join but there is nothing comming trough.

Originally, you must have been using array mode as your code was accessing `msg.payload[0].temperature` and `msg.payload[2].humidity` etc

> [@JeroenKokhuis](#):
>
> > [@Steve-Mcl](#):
> >
> > OR if you need flow context, store the single joined object - but always use the values from the join node.
> 
> I don't know how to do that.

After you have something coming out of the join node - that looks right - add a `change` node after the join and set it up to SET `flow.xxxxx` TO `msg.payload`

---

<div class="post-metadata">

**Author:** ![JeroenKokhuis](https://avatars.discourse-cdn.com/v4/letter/j/2bfe46/32.png) [@JeroenKokhuis](https://discourse.nodered.org/u/JeroenKokhuis)\
**Post date:** [26 September 2021 18:34 UTC](https://discourse.nodered.org/t/empty-values-on-template/51538/6 "2021-09-26T18:34:06Z")

</div>

Thanks for your input

---

<div class="post-metadata">

**Author:** ![JeroenKokhuis](https://avatars.discourse-cdn.com/v4/letter/j/2bfe46/32.png) [@JeroenKokhuis](https://discourse.nodered.org/u/JeroenKokhuis)\
**Post date:** [26 September 2021 18:48 UTC](https://discourse.nodered.org/t/empty-values-on-template/51538/7 "2021-09-26T18:48:32Z")

</div>

Here is my flow. When I exported the flow it was with password and username but I removed that:

```auto
[{"id":"6e7e5b25.431034","type":"ui_template","z":"4722bed2.dd209","group":"ff37b9ad.926348","name":"TnH Begane Grond","order":1,"width":30,"height":"20","format":"<style>\n#THBuiten {\n left: 1300px !important;\n Top: 730px !important;\n}\n#THWoonkamer {\n left: 500px !important;\n Top: 310px !important;\n}\n#THBadkamer {\n left: 1250px !important;\n Top: 250px !important;\n}\n#THEntree {\n left: 30% !important;\n Top: 65% !important;\n}\n#valuehome {\n color: black;\n vertical-align: middle;\n text-align: right;\n}\n#svghome {\n text-align: -webkit-right;\n}\n.divTable{\n\tdisplay: table;\n border-collapse: separate;\n border: 2px solid #999999;\n border-radius: 10px;\n position: absolute;\n width:100px;\n height:30px;\n}\n.divTableRow {\n\tdisplay: table-row;\n}\n.divTableHeading {\n\tbackground-color: #EEE;\n\tdisplay: table-header-group;\n}\n.divTableCell, .divTableHead {\n\tborder: 1px solid #999999;\n\tdisplay: table-cell;\n\tz-index: 1000;\n}\n.divTableBody {\n\tdisplay: table-row-group;\n}\n</style>\n<div>\n<div class=\"divTable\" id=\"THBuiten\">\n<div class=\"divTableBody\">\n<div class=\"divTableRow\">\n<div class=\"divTableCell\" id=\"valuehome\">{{msg.payload.tbuiten}}</div><div class=\"divTableCell\" id=\"valuehome\">°C</div><div class=\"divTableCell\" id=\"svghome\"><img src=\"icons/thermometer.svg\" width=\"30\" height=\"30\"></div>\n</div>\n<div class=\"divTableRow\">\n<div class=\"divTableCell\" id=\"valuehome\">{{msg.payload.hbuiten}}</div><div class=\"divTableCell\" id=\"valuehome\">%</div><div class=\"divTableCell\" id=\"svghome\"><img src=\"icons/humidity.svg\" width=\"30\" height=\"30\"></div>\n</div>\n</div>\n</div>\n</div>\n<div>\n<div class=\"divTable\" id=\"THWoonkamer\">\n<div class=\"divTableBody\">\n<div class=\"divTableRow\">\n<div class=\"divTableCell\" id=\"valuehome\">{{msg.payload.twoonkamer}}</div><div class=\"divTableCell\" id=\"valuehome\">°C</div><div class=\"divTableCell\" id=\"svghome\"><img src=\"icons/thermometer.svg\" width=\"30\" height=\"30\"></div>\n</div>\n<div class=\"divTableRow\">\n<div class=\"divTableCell\" id=\"valuehome\">{{msg.payload.hwoonkamer}}</div><div class=\"divTableCell\" id=\"valuehome\">%</div><div class=\"divTableCell\" id=\"svghome\"><img src=\"icons/humidity.svg\" width=\"30\" height=\"30\"></div>\n</div>\n</div>\n</div>\n<div>\n<div class=\"divTable\" id=\"THBadkamer\">\n<div class=\"divTableBody\">\n<div class=\"divTableRow\">\n<div class=\"divTableCell\" id=\"valuehome\">{{flow.temp1}}</div><div class=\"divTableCell\" id=\"valuehome\">°C</div><div class=\"divTableCell\" id=\"svghome\"><img src=\"icons/thermometer.svg\" width=\"30\" height=\"30\"></div>\n</div>\n<div class=\"divTableRow\">\n<div class=\"divTableCell\" id=\"valuehome\">{{flow.hum1}}</div><div class=\"divTableCell\" id=\"valuehome\">%</div><div class=\"divTableCell\" id=\"svghome\"><img src=\"icons/humidity.svg\" width=\"30\" height=\"30\"></div>\n</div>\n</div>\n</div>\n</div>\n<div>\n<div class=\"divTable\" id=\"THEntree\">\n<div class=\"divTableBody\">\n<div class=\"divTableRow\">\n<div class=\"divTableCell\" id=\"valuehome\">{{msg.payload.tentree}}</div><div class=\"divTableCell\" id=\"valuehome\">°C</div><div class=\"divTableCell\" id=\"svghome\"><img src=\"icons/thermometer.svg\" width=\"30\" height=\"30\"></div>\n</div>\n<div class=\"divTableRow\">\n<div class=\"divTableCell\" id=\"valuehome\">{{msg.payload.hentree}}</div><div class=\"divTableCell\" id=\"valuehome\">%</div><div class=\"divTableCell\" id=\"svghome\"><img src=\"icons/humidity.svg\" width=\"30\" height=\"30\"></div>\n</div>\n</div>\n</div>\n</div>\n</div>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":1150,"y":1880,"wires":[[]]},{"id":"c4657994.6ecca8","type":"ui_template","z":"4722bed2.dd209","group":"ff37b9ad.926348","name":"","order":2,"width":30,"height":1,"format":"<style>\nbody {\n background-image: url(icons/beganegrond.svg);\n background-repeat: no-repeat;\n background-position: center;\n background-size: auto;\n}\n</style>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":1120,"y":1820,"wires":[[]]},{"id":"c7298e00.bd08b","type":"tado","z":"4722bed2.dd209","configName":"6d8b0ebb.367a","apiCall":"getZoneState","homeId":"XXXXXX","deviceId":"","zoneId":"8","power":"on","temperature":"18","terminationType":"manual","terminationTimeout":900,"name":"Tado Badkamer","reportDate":"","presence":"HOME","geoTracking":true,"temperatureOffset":0,"windowDetection":true,"windowDetectionTimeout":900,"openWindowMode":true,"timetableId":"","x":470,"y":1880,"wires":[["bd5befe9.642c","c391d94.3f66228"]]},{"id":"502f63a3.5de02c","type":"inject","z":"4722bed2.dd209","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":1880,"wires":[["c7298e00.bd08b","9009125f.3b925","8a6ecd79.4b1e3","bca82c5b.2ae67","4ceb6db7.b967e4","6aac005b.83848","cada61ae.9ce4","43f45d4.2f4fda4","12d28b69.f0d3c5"]]},{"id":"8a6ecd79.4b1e3","type":"tado","z":"4722bed2.dd209","configName":"6d8b0ebb.367a","apiCall":"getZoneState","homeId":"XXXXXX","deviceId":"","zoneId":"7","power":"on","temperature":"18","terminationType":"manual","terminationTimeout":900,"name":"Tado Entree","reportDate":"","presence":"HOME","geoTracking":true,"temperatureOffset":0,"windowDetection":true,"windowDetectionTimeout":900,"openWindowMode":true,"timetableId":"","x":460,"y":1980,"wires":[["c78f5633.8d7978","c391d94.3f66228"]]},{"id":"bca82c5b.2ae67","type":"tado","z":"4722bed2.dd209","configName":"6d8b0ebb.367a","apiCall":"getZoneState","homeId":"XXXXXXX","deviceId":"","zoneId":"1","power":"on","temperature":"18","terminationType":"manual","terminationTimeout":900,"name":"Tado Wookamer","reportDate":"","presence":"HOME","geoTracking":true,"temperatureOffset":0,"windowDetection":true,"windowDetectionTimeout":900,"openWindowMode":true,"timetableId":"","x":470,"y":1800,"wires":[["57bbf8c.dfb9808","c391d94.3f66228"]]},{"id":"e96b6aae.a37f68","type":"debug","z":"4722bed2.dd209","name":"join","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1310,"y":2080,"wires":[]},{"id":"57bbf8c.dfb9808","type":"debug","z":"4722bed2.dd209","name":"Woonkamer","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":700,"y":1740,"wires":[]},{"id":"bd5befe9.642c","type":"debug","z":"4722bed2.dd209","name":"Badkamer","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":880,"y":1740,"wires":[]},{"id":"c78f5633.8d7978","type":"debug","z":"4722bed2.dd209","name":"Entree","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1030,"y":1740,"wires":[]},{"id":"c391d94.3f66228","type":"join","z":"4722bed2.dd209","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"payload","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"4","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":730,"y":1880,"wires":[["e96b6aae.a37f68","6e7e5b25.431034"]]},{"id":"12d28b69.f0d3c5","type":"get stations data","z":"4722bed2.dd209","name":"Station","creds":"6f236403.2c34dc","x":460,"y":2060,"wires":[["c391d94.3f66228"]]},{"id":"ff37b9ad.926348","type":"ui_group","z":"","name":"Begane grond","tab":"718fbdb4.4cec64","order":5,"disp":true,"width":"30","collapse":false},{"id":"6d8b0ebb.367a","type":"tado-config","z":"","name":"Tado"},{"id":"6f236403.2c34dc","type":"configNode","z":"","client_id":"XXXXXXXXXXXXXXXXXXXXXXXX","client_secret":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX","username":"XXXXXXXXXXXXXXXXXXXXXXXX","password":"XXXXXXXXXXXXXXXXXXXX","device_id":"XXXXXXXXXXXXXXXXXXXXXXXXX"},{"id":"XXXXXXXXXXXXXXXXXXXXXX","type":"ui_tab","z":"","name":"test","icon":"dashboard","order":12,"disabled":false,"hidden":false}]

```

> [@Steve-Mcl](#):
>
> Originally, you must have been using array mode as your code was accessing `msg.payload[0].temperature` and `msg.payload[2].humidity` etc

That's right. I changed it to key/value but there is no output. Why is there no output?

---

<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:** [26 September 2021 19:43 UTC](https://discourse.nodered.org/t/empty-values-on-template/51538/8 "2021-09-26T19:43:09Z")

</div>

Honestly, there was so much wrong and you didnt provide sample data & you included TADO nodes (which I dont have) etc etc etc - I simply dont have the energy to fully explain all the issues. :sigh:

* * *

Use debug nodes & the copy path feature to avoid mistakes

![MqnoZGT9yF](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/9/d99dab6667076195936135123824572728fce58b.gif)

* * *

Here is a semi working demo based on snippets of information you have provided - you will need to correct it / tidy it up...

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

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

The flow...

```auto
[{"id":"6e7e5b25.431034","type":"ui_template","z":"af952aeaa20f4f97","group":"a348b0ef9d248038","name":"TnH Begane Grond","order":1,"width":"12","height":"20","format":"<style>\n #THBuiten {\n left: 1300px !important;\n Top: 730px !important;\n }\n\n #THWoonkamer {\n left: 500px !important;\n Top: 310px !important;\n }\n\n #THBadkamer {\n left: 1250px !important;\n Top: 250px !important;\n }\n\n #THEntree {\n left: 30% !important;\n Top: 65% !important;\n }\n\n #valuehome {\n color: black;\n vertical-align: middle;\n text-align: right;\n }\n\n #svghome {\n text-align: -webkit-right;\n }\n\n .divTable {\n display: table;\n border-collapse: separate;\n border: 2px solid #999999;\n border-radius: 10px;\n position: absolute;\n width: 100px;\n height: 30px;\n }\n\n .divTableRow {\n display: table-row;\n }\n\n .divTableHeading {\n background-color: #EEE;\n display: table-header-group;\n }\n\n .divTableCell,\n .divTableHead {\n border: 1px solid #999999;\n display: table-cell;\n z-index: 1000;\n }\n\n .divTableBody {\n display: table-row-group;\n }\n</style>\n\n<div>\n <div class=\"divTable\" id=\"THBuiten\">\n <div class=\"divTableBody\">\n <div class=\"divTableRow\">\n <div class=\"divTableCell\" id=\"valuehome\">{{msg.payload.entry.sensorDataPoints.insideTemperature.celsius}}</div>\n <div class=\"divTableCell\" id=\"valuehome\">°C</div>\n <div class=\"divTableCell\" id=\"svghome\"><img src=\"icons/thermometer.svg\" width=\"30\" height=\"30\"></div>\n </div>\n <div class=\"divTableRow\">\n <div class=\"divTableCell\" id=\"valuehome\">{{msg.payload.entry.humidity.percentage}}</div>\n <div class=\"divTableCell\" id=\"valuehome\">%</div>\n <div class=\"divTableCell\" id=\"svghome\"><img src=\"icons/humidity.svg\" width=\"30\" height=\"30\"></div>\n </div>\n </div>\n </div>\n</div>\n<div>\n <div class=\"divTable\" id=\"THWoonkamer\">\n <div class=\"divTableBody\">\n <div class=\"divTableRow\">\n <div class=\"divTableCell\" id=\"valuehome\">{{msg.payload.wookamer.sensorDataPoints.insideTemperature.celsius}}</div>\n <div class=\"divTableCell\" id=\"valuehome\">°C</div>\n <div class=\"divTableCell\" id=\"svghome\"><img src=\"icons/thermometer.svg\" width=\"30\" height=\"30\"></div>\n </div>\n <div class=\"divTableRow\">\n <div class=\"divTableCell\" id=\"valuehome\">{{msg.payload.wookamer.humidity.percentage}}</div>\n <div class=\"divTableCell\" id=\"valuehome\">%</div>\n <div class=\"divTableCell\" id=\"svghome\"><img src=\"icons/humidity.svg\" width=\"30\" height=\"30\"></div>\n </div>\n </div>\n </div>\n <div>\n <div class=\"divTable\" id=\"THBadkamer\">\n <div class=\"divTableBody\">\n <div class=\"divTableRow\">\n <div class=\"divTableCell\" id=\"valuehome\">{{msg.payload.badkamer.sensorDataPoints.insideTemperature.celsius}}</div>\n <div class=\"divTableCell\" id=\"valuehome\">°C</div>\n <div class=\"divTableCell\" id=\"svghome\"><img src=\"icons/thermometer.svg\" width=\"30\" height=\"30\">\n </div>\n </div>\n <div class=\"divTableRow\">\n <div class=\"divTableCell\" id=\"valuehome\">{{fmsg.payload.badkamer.humidity.percentage}}</div>\n <div class=\"divTableCell\" id=\"valuehome\">%</div>\n <div class=\"divTableCell\" id=\"svghome\"><img src=\"icons/humidity.svg\" width=\"30\" height=\"30\"></div>\n </div>\n </div>\n </div>\n </div>\n <div>\n <div class=\"divTable\" id=\"THEntree\">\n <div class=\"divTableBody\">\n <div class=\"divTableRow\">\n <div class=\"divTableCell\" id=\"valuehome\">{{msg.payload.entry.sensorDataPoints.insideTemperature.celsius}}</div>\n <div class=\"divTableCell\" id=\"valuehome\">°C</div>\n <div class=\"divTableCell\" id=\"svghome\"><img src=\"icons/thermometer.svg\" width=\"30\" height=\"30\">\n </div>\n </div>\n <div class=\"divTableRow\">\n <div class=\"divTableCell\" id=\"valuehome\">{{msg.payload.entry.humidity.percentage}}</div>\n <div class=\"divTableCell\" id=\"valuehome\">%</div>\n <div class=\"divTableCell\" id=\"svghome\"><img src=\"icons/humidity.svg\" width=\"30\" height=\"30\"></div>\n </div>\n </div>\n </div>\n </div>\n</div>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":2130,"y":1500,"wires":[[]]},{"id":"502f63a3.5de02c","type":"inject","z":"af952aeaa20f4f97","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":1440,"y":1520,"wires":[["c0bb39b5ad90e48e","292ca5b06ec75f45","6d3a4ea22970d3a6","8fff4443dc0dd699"]]},{"id":"e96b6aae.a37f68","type":"debug","z":"af952aeaa20f4f97","name":"join","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":2090,"y":1560,"wires":[]},{"id":"c391d94.3f66228","type":"join","z":"af952aeaa20f4f97","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"4","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1930,"y":1520,"wires":[["e96b6aae.a37f68","6e7e5b25.431034"]]},{"id":"c0bb39b5ad90e48e","type":"change","z":"af952aeaa20f4f97","name":"wookamer (fake tado)","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"sensorDataPoints\":{\"insideTemperature\":{\"celsius\":21.5}},\"humidity\":{\"percentage\":56}}","tot":"json"},{"t":"set","p":"topic","pt":"msg","to":"wookamer","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1680,"y":1420,"wires":[["c391d94.3f66228"]]},{"id":"292ca5b06ec75f45","type":"change","z":"af952aeaa20f4f97","name":"badkamer (fake tado)","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"sensorDataPoints\":{\"insideTemperature\":{\"celsius\":20.3}},\"humidity\":{\"percentage\":36}}","tot":"json"},{"t":"set","p":"topic","pt":"msg","to":"badkamer","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1680,"y":1480,"wires":[["c391d94.3f66228"]]},{"id":"6d3a4ea22970d3a6","type":"change","z":"af952aeaa20f4f97","name":"entry (fake tado)","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"sensorDataPoints\":{\"insideTemperature\":{\"celsius\":24.7}},\"humidity\":{\"percentage\":44}}","tot":"json"},{"t":"set","p":"topic","pt":"msg","to":"entry","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1660,"y":1540,"wires":[["c391d94.3f66228"]]},{"id":"8fff4443dc0dd699","type":"change","z":"af952aeaa20f4f97","name":"station_data (fake tado)","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"devices\":[{\"modules\":[{\"dashboard_data\":{\"Temperature\":22.8,\"Humidity\":66}}]}]}","tot":"json"},{"t":"set","p":"topic","pt":"msg","to":"station_data","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1690,"y":1600,"wires":[["c391d94.3f66228"]]},{"id":"a348b0ef9d248038","type":"ui_group","name":"Default","tab":"3316deba5234ba30","order":1,"disp":true,"width":"12","collapse":false,"className":""},{"id":"3316deba5234ba30","type":"ui_tab","name":"test","icon":"dashboard","disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

**Author:** ![JeroenKokhuis](https://avatars.discourse-cdn.com/v4/letter/j/2bfe46/32.png) [@JeroenKokhuis](https://discourse.nodered.org/u/JeroenKokhuis)\
**Post date:** [27 September 2021 08:11 UTC](https://discourse.nodered.org/t/empty-values-on-template/51538/9 "2021-09-27T08:11:35Z")

</div>

thanks for your help.

I imported your flow and changed the nodes. But I dont get any output from the join node.

This is the output of a TADO node:

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

The path to my temperature and humidity values are:

```auto
msg.payload.sensorDataPoints.insideTemperature.celsius
msg.payload.sensorDataPoints.humidity.percentage

```

I have 3 Tado nodes and a Netatmo node. Maybe thats my problem

---

<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:** [27 September 2021 08:17 UTC](https://discourse.nodered.org/t/empty-values-on-template/51538/10 "2021-09-27T08:17:58Z")

</div>

> [@JeroenKokhuis](#):
>
> I imported your flow and changed the nodes. But I dont get any output from the join node

That suggests either...

- 1 of the four nodes is not returning a value (check with debug nodes)
- The tado nodes msg don't have a topic. A topic is required to identify the payload when using key/value mode
  - If the tado node dont add a topic to the msg (check the tado nodes configs), then put a change node after every tado node and set unique topic names like I did in my demo.

---

<div class="post-metadata">

**Author:** ![JeroenKokhuis](https://avatars.discourse-cdn.com/v4/letter/j/2bfe46/32.png) [@JeroenKokhuis](https://discourse.nodered.org/u/JeroenKokhuis)\
**Post date:** [27 September 2021 08:22 UTC](https://discourse.nodered.org/t/empty-values-on-template/51538/11 "2021-09-27T08:22:26Z")

</div>

I delete the Netamo node and set the number of messages to 3 and now its working.

How can I join different devices (nodes) in one template?

I did this before without the join node but when the data is comming from the Tado node the Netatmo values are empy and vice versa

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/f/efc1026b48dbdb4762f6f86cec2870b11531126e.png)  
the first three nodes are Tado and the last one is Netatmo

---

<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:** [27 September 2021 08:34 UTC](https://discourse.nodered.org/t/empty-values-on-template/51538/12 "2021-09-27T08:34:19Z")

</div>

You can join as many different types and sources as you wish so long as they have a topic in the message. Use a debug node to check that every message that goes **into the join** has a topic. If it does not have a topic, add one manually with a change node.

* * *

#### Some tips for you...

See [this article in the cookbook](https://cookbook.nodered.org/basic/join-streams) for an example of how to join messages into one object.

Also, I recommend 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:** ![JeroenKokhuis](https://avatars.discourse-cdn.com/v4/letter/j/2bfe46/32.png) [@JeroenKokhuis](https://discourse.nodered.org/u/JeroenKokhuis)\
**Post date:** [27 September 2021 09:00 UTC](https://discourse.nodered.org/t/empty-values-on-template/51538/13 "2021-09-27T09:00:52Z")

</div>

this is the output of the Netatmo node:

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

and this is the output of a Tado node:

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

what value should i use in the Join node?

---

<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:** [27 September 2021 09:14 UTC](https://discourse.nodered.org/t/empty-values-on-template/51538/14 "2021-09-27T09:14:16Z")

</div>

> [@JeroenKokhuis](#):
>
> what value should i use in the Join node

You don't need to do anything with the join node.

As I've said 2 times before simply ensure that the message going into the join node has a topic.

Set your debug nodes to "show complete message" - ensure EVERY msg that GOES INTO the JOIN has a topic.

Then use the "copy path" button as I demonstrated before

> [@Steve-Mcl](#):
>
> Use debug nodes & the copy path feature to avoid mistakes
> 
> ![MqnoZGT9yF](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/9/d99dab6667076195936135123824572728fce58b.gif)

---

<div class="post-metadata">

**Author:** ![JeroenKokhuis](https://avatars.discourse-cdn.com/v4/letter/j/2bfe46/32.png) [@JeroenKokhuis](https://discourse.nodered.org/u/JeroenKokhuis)\
**Post date:** [27 September 2021 09:29 UTC](https://discourse.nodered.org/t/empty-values-on-template/51538/15 "2021-09-27T09:29:31Z")

</div>

That was the problem there was no topic send into the join node. I mixed up "topic" and "path". Sorry.  
But it's working now.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/c/fc9448aaeec9e7f7be1f05ef096aac0ada42c5c0.jpeg)

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![JeroenKokhuis](https://avatars.discourse-cdn.com/v4/letter/j/2bfe46/32.png) [@JeroenKokhuis](https://discourse.nodered.org/u/JeroenKokhuis)\
**Post date:** [28 September 2021 14:15 UTC](https://discourse.nodered.org/t/empty-values-on-template/51538/16 "2021-09-28T14:15:41Z")

</div>

I want to add another device to the floorplan. My lights.  
This is the original flow:

```auto
[{"id":"70bea0a.fec8f6","type":"mqtt in","z":"46d40c7e.15e854","name":"MQTT receiver light","topic":"homie/homey-5d14b942367eb80ccf0c77c3/woonkamer/onoff","qos":"2","datatype":"auto","broker":"a4ac80e1.bc5fe","x":290,"y":260,"wires":[["459d2d4e.cb8bf4"]]},{"id":"459d2d4e.cb8bf4","type":"function","z":"46d40c7e.15e854","name":"Kleur en icoon","func":"// note that this flow is triggered by an mqtt message AND by the repeating timestamp node\n// here we deal with the message payload only\nif (msg.payload === \"true\"){\n\n flow.set(\"statusWoonkamerLamp\", true);\n}\nelse if (msg.payload ===\"false\") {\n flow.set(\"statusWoonkamerLamp\", false);\n}\nelse {\n // don't do anything here as this could be your timestamp trigger\n}\n\n// here we deal with the flow variable.\nif (flow.get(\"statusWoonkamerLamp\")){\n msg.ui_control = {icon:\"icons/light-bulb-on-60.png\", tooltip:\"Licht is aan\"};\n msg.label = \"Licht is aan\"\n}\nelse {\n msg.ui_control = {icon:\"icons/light-bulb-off-60.png\", tooltip:\"Licht is uit\"};\n msg.label = \"Licht is uit\"\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":520,"y":260,"wires":[["acc314d2.fd2e58"]]},{"id":"1feffbb6.1a5754","type":"mqtt out","z":"46d40c7e.15e854","name":"MQTT Transmitter","topic":"homie/homey-5d14b942367eb80ccf0c77c3/woonkamer/onoff/set","qos":"","retain":"","broker":"a4ac80e1.bc5fe","x":1130,"y":260,"wires":[]},{"id":"acc314d2.fd2e58","type":"ui_template","z":"46d40c7e.15e854","group":"b290cc21.d734d","name":"Woonkamer","order":7,"width":4,"height":3,"format":"<md-button class=\"btn1\" id=\"buttonlight\" style=\"background-color:#ff333333\" ng-click=\"send({payload: msg.payload })\"> \n <img id=\"imgofbutton\" src=\"{{msg.ui_control.icon}}\">\n <div class=\"textofbutton\">\n <b id=\"buttonslighttext\">Woonkamer</b>\n </div>\n</md-button>","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"local","x":750,"y":260,"wires":[["4791f9ea.330c68"]]},{"id":"4791f9ea.330c68","type":"function","z":"46d40c7e.15e854","name":"","func":"\nif (msg.payload === \"false\" ){\n msg.payload = \"true\";\n}\nelse { msg.payload = \"false\";\n}\nreturn [msg];","outputs":1,"noerr":0,"initialize":"","finalize":"","x":920,"y":260,"wires":[["1feffbb6.1a5754"]]},{"id":"1c318816.bec408","type":"inject","z":"46d40c7e.15e854","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"15","crontab":"","once":true,"onceDelay":"5","topic":"","payload":"","payloadType":"date","x":310,"y":220,"wires":[["459d2d4e.cb8bf4"]]},{"id":"a4ac80e1.bc5fe","type":"mqtt-broker","z":"","name":"Homey MQTT","broker":"192.168.1.6","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"b290cc21.d734d","type":"ui_group","z":"","name":"Buttons","tab":"2a0bd1d7.7ca9ce","order":1,"disp":false,"width":30,"collapse":false},{"id":"2a0bd1d7.7ca9ce","type":"ui_tab","z":"","name":"Verlcihting","icon":"dashboard","order":3,"disabled":false,"hidden":false}]

```

I added a light to the previous flow:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/4/3447efe2cf0e6382074eaeef27c784bceb0bfc4c.png)  
and I add a change node to set a topic. But now the msg.payload doesn't come out the join node. Anyone know why?

---

<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:** [12 October 2021 14:16 UTC](https://discourse.nodered.org/t/empty-values-on-template/51538/17 "2021-10-12T14:16:40Z")

</div>

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