# Problem with join Node and AHOY DTU PV data

**URL:** <https://discourse.nodered.org/t/problem-with-join-node-and-ahoy-dtu-pv-data/72989>\
**Category:** General\
**Created:** [31 December 2022 09:13 UTC](https://discourse.nodered.org/t/problem-with-join-node-and-ahoy-dtu-pv-data/72989 "2022-12-31T09:13:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![stefan2210](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@stefan2210](https://discourse.nodered.org/u/stefan2210)\
**Post date:** [31 December 2022 09:13 UTC](https://discourse.nodered.org/t/problem-with-join-node-and-ahoy-dtu-pv-data/72989/1 "2022-12-31T09:13:19Z")

</div>

Hello,  
I am a newbee with Node-Red and just got stuck a bit.

I have some data from by PV-inverter:

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

Now I want to join them all together, so that I can store them in InfluxDB.

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

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

But there come no data through to my test/out topic. If I transfer just 1 value, then data comes to my MQTT test/out-Topic. I just need to use this, as debug nodes do not work at the moment.

Actually it should be very easy to join the data togehther:

the output JSON should look sth. like:  
{P1\_DC: 46.3, P2\_DC: 53.5}

## and so on...

I also tried to create a json manually with a function node:

```auto
msg.payload = {
    P1_DC: msg.payload,
}
return msg;

```

This works for 1 value or I can create different function nodes for each value, but I do not know how to combine it into i JSON-Object.  
{"P1\_DC": 46.3}

What is the best solution to combine such values or is there an even easier solution?

Stefan

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [31 December 2022 09:41 UTC](https://discourse.nodered.org/t/problem-with-join-node-and-ahoy-dtu-pv-data/72989/2 "2022-12-31T09:41:18Z")

</div>

Your join node has no count so will never output a message unless it receives a msg.complete. Add a count of 2.  
Here is an example to get the output format you wish after the join. It uses a template node.  
e.g.

```auto
[{"id":"0cdeae66f0415454","type":"inject","z":"da8a6ef0b3c9a5c8","name":"ch1","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"ch1/p_dc","payload":"{\"p_dc\":10,\"otherproperties\":10}","payloadType":"json","x":110,"y":2160,"wires":[["63e1903885bbc34a"]]},{"id":"63e1903885bbc34a","type":"join","z":"da8a6ef0b3c9a5c8","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":330,"y":2180,"wires":[["85388a7f93835ad3"]]},{"id":"05088f33f95829a7","type":"inject","z":"da8a6ef0b3c9a5c8","name":"ch2","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"ch2/p_dc","payload":"{\"p_dc\":20,\"otherproperties\":20}","payloadType":"json","x":110,"y":2220,"wires":[["63e1903885bbc34a"]]},{"id":"85388a7f93835ad3","type":"template","z":"da8a6ef0b3c9a5c8","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\n \"P1_DC\": {{payload.ch1/p_dc.p_dc}}, \n \"P2_DC\": {{payload.ch2/p_dc.p_dc}}\n}","output":"json","x":480,"y":2180,"wires":[["06c36bc61f4cdf5a"]]},{"id":"06c36bc61f4cdf5a","type":"debug","z":"da8a6ef0b3c9a5c8","name":"debug 219","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":590,"y":2140,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![stefan2210](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@stefan2210](https://discourse.nodered.org/u/stefan2210)\
**Post date:** [31 December 2022 10:32 UTC](https://discourse.nodered.org/t/problem-with-join-node-and-ahoy-dtu-pv-data/72989/3 "2022-12-31T10:32:36Z")

</div>

Thank you very much. Now it works 🙂

---

<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:** [14 January 2023 10:32 UTC](https://discourse.nodered.org/t/problem-with-join-node-and-ahoy-dtu-pv-data/72989/4 "2023-01-14T10:32:51Z")

</div>

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