# Adding two values

**URL:** https://discourse.nodered.org/t/adding-two-values/32784
**Category:** General
**Created:** [12 September 2020 16:32 UTC](https://discourse.nodered.org/t/adding-two-values/32784 "2020-09-12T16:32:29Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)
#### Post date: [12 September 2020 16:32 UTC](https://discourse.nodered.org/t/adding-two-values/32784/1 "2020-09-12T16:32:29Z")

</div>

Hi, i just want to add these two values:

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/8/b895a69c55adda6559d4fe963d0f00f8becc674c.png)

I changed the topic:

> var temp = (msg.payload[1])  
> msg.payload = temp;  
> msg.topic = "P1"  
> return msg;

but no matter what I do, it doesn't want to add in a function node.

---

<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: [12 September 2020 16:52 UTC](https://discourse.nodered.org/t/adding-two-values/32784/2 "2020-09-12T16:52:51Z")

</div>

I don't see where you are attempting to add them. If you are trying to add the values from two separate messages then you have to first combine the two messages so that you get both values in one message. See this example in the cookbook [https://cookbook.nodered.org/basic/join-streams](https://cookbook.nodered.org/basic/join-streams)

---

<div class="post-metadata">

### Author: ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)
#### Post date: [12 September 2020 17:21 UTC](https://discourse.nodered.org/t/adding-two-values/32784/3 "2020-09-12T17:21:29Z")

</div>

Thank you, I´ll try it if I get the other problem under controll 🤓  
Yes, I deleted the function where I tried to add 😉

---

<div class="post-metadata">

### Author: ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)
#### Post date: [13 September 2020 09:13 UTC](https://discourse.nodered.org/t/adding-two-values/32784/4 "2020-09-13T09:13:04Z")

</div>

I dont get it ☹

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/6/f61d8d0b304ad49389e74a5e6260390335ed5dad.png)  
 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/d/cde52482861979308f7e7e5feb4eecd365d959bc.png)

---

<div class="post-metadata">

### Author: ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)
#### Post date: [13 September 2020 09:16 UTC](https://discourse.nodered.org/t/adding-two-values/32784/5 "2020-09-13T09:16:13Z")

</div>

I don´t understand why the debug gets alle the values:

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/6/86058a78373f1860e57963119c2e5436e38aed12.png)

it may get only the one value "PAC2"

---

<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: [13 September 2020 09:34 UTC](https://discourse.nodered.org/t/adding-two-values/32784/6 "2020-09-13T09:34:24Z")

</div>

What is coming out of the join node?

---

<div class="post-metadata">

### Author: ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)
#### Post date: [13 September 2020 09:42 UTC](https://discourse.nodered.org/t/adding-two-values/32784/7 "2020-09-13T09:42:22Z")

</div>

something strange:

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/f/6f431aec5dd19f0c4a56650315db636702aaf35b.png)

---

<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: [13 September 2020 09:57 UTC](https://discourse.nodered.org/t/adding-two-values/32784/8 "2020-09-13T09:57:18Z")

</div>

Hi @Becker you might be able to simplify things somewhat using [node-red-contrib-buffer-parser](https://flows.nodered.org/node/node-red-contrib-buffer-parser).

Would you be willing to export your flows in a reply (select all the nodes to export, press CTRL+E) then...  
`````  
`paste flow between backticks like this`  
`````

---

<div class="post-metadata">

### Author: ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)
#### Post date: [13 September 2020 09:59 UTC](https://discourse.nodered.org/t/adding-two-values/32784/9 "2020-09-13T09:59:19Z")

</div>

```auto
[
    {
        "id": "ce4d01f7.fa9ea8",
        "type": "comment",
        "z": "6a66d831.fbce4",
        "name": "SB 3000TL-21",
        "info": "",
        "x": 640,
        "y": 700,
        "wires": []
    },
    {
        "id": "e964bad3.ac9098",
        "type": "comment",
        "z": "6a66d831.fbce4",
        "name": "STP6.0-3AV-40",
        "info": "",
        "x": 640,
        "y": 140,
        "wires": []
    },
    {
        "id": "60ee51c7.35b9d8",
        "type": "modbus-flex-getter",
        "z": "6a66d831.fbce4",
        "name": "",
        "showStatusActivities": false,
        "showErrors": false,
        "logIOActivities": false,
        "server": "101bd986.8eac7e",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 640,
        "y": 180,
        "wires": [
            [
                "c626108f.072ce"
            ],
            []
        ]
    },
    {
        "id": "8c25c3d2.611cf",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "P-bez",
        "func": "msg.payload = { \n 'fc': 4, \n 'unitid': 3, \n 'address': 30865, \n 'quantity': 2 \n}\nmsg.topic = 'Pbez'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 370,
        "y": 80,
        "wires": [
            [
                "60ee51c7.35b9d8"
            ]
        ]
    },
    {
        "id": "4d29173f.9a1778",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "U-L1",
        "func": "msg.payload = { \n 'fc': 4,\n 'unitid': 3, \n 'address': 31253, \n 'quantity': 2 \n} \nmsg.topic = 'UL1'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 370,
        "y": 160,
        "wires": [
            [
                "60ee51c7.35b9d8"
            ]
        ]
    },
    {
        "id": "79b63d2d.40baec",
        "type": "inject",
        "z": "6a66d831.fbce4",
        "name": "",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "repeat": "5",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "x": 170,
        "y": 180,
        "wires": [
            [
                "8c25c3d2.611cf",
                "4d29173f.9a1778",
                "49162280.0d7dec",
                "ed5031f6.c8ff48",
                "a667d1b1.0d5de",
                "bad76825.9eca7",
                "59855b93.2e8594",
                "4ae51e87.e73068",
                "d547b9c4.9213",
                "cee0ebbb.0980b"
            ]
        ]
    },
    {
        "id": "c626108f.072ce",
        "type": "join",
        "z": "6a66d831.fbce4",
        "name": "",
        "mode": "custom",
        "build": "object",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": false,
        "timeout": "",
        "count": "2",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "num",
        "reduceFixup": "",
        "x": 830,
        "y": 180,
        "wires": [
            [
                "a7fe19a5.754b5",
                "a5135b35.34d33",
                "a147915c.0f6988",
                "9a97c10c.2474f8",
                "ae76c4a9.47f878",
                "ba8a42fb.622ba8",
                "ab2050.5c9597b",
                "7ad0b122.97a76",
                "149ad36a.3588cd",
                "bf2603c8.320bb"
            ]
        ]
    },
    {
        "id": "ccf106dd.2c2f28",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "40cc476b.882118",
        "order": 3,
        "width": 0,
        "height": 0,
        "name": "U-L1",
        "label": "Spannung L1",
        "format": "{{msg.payload}} V",
        "layout": "row-spread",
        "x": 1190,
        "y": 160,
        "wires": []
    },
    {
        "id": "49162280.0d7dec",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "U-L2",
        "func": "msg.payload = { \n 'fc': 4,\n 'unitid': 3, \n 'address': 31255, \n 'quantity': 2 \n} \nmsg.topic = 'UL2'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 370,
        "y": 200,
        "wires": [
            [
                "60ee51c7.35b9d8"
            ]
        ]
    },
    {
        "id": "ed5031f6.c8ff48",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "U-L3",
        "func": "msg.payload = { \n 'fc': 4,\n 'unitid': 3, \n 'address': 31257, \n 'quantity': 2 \n} \nmsg.topic = 'UL3'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 370,
        "y": 240,
        "wires": [
            [
                "60ee51c7.35b9d8"
            ]
        ]
    },
    {
        "id": "a7fe19a5.754b5",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "P-bez",
        "func": "var temp = (msg.payload.Pbez[1])\nmsg.payload = temp;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 1010,
        "y": 120,
        "wires": [
            [
                "a144d424.212ea8"
            ]
        ]
    },
    {
        "id": "a5135b35.34d33",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "U-L1",
        "func": "var temp = (msg.payload.UL1[1]) / 100\nmsg.payload = temp;\nmsg.payload = msg.payload.toFixed(1).replace('.', ',')\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 1010,
        "y": 160,
        "wires": [
            [
                "ccf106dd.2c2f28"
            ]
        ]
    },
    {
        "id": "a667d1b1.0d5de",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "Hz",
        "func": "msg.payload = { \n 'fc': 4,\n 'unitid': 3, \n 'address': 31447, \n 'quantity': 2 \n} \nmsg.topic = 'Hz'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 370,
        "y": 280,
        "wires": [
            [
                "60ee51c7.35b9d8"
            ]
        ]
    },
    {
        "id": "a147915c.0f6988",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "Hz",
        "func": "var temp = (msg.payload.Hz[1]) / 100\nmsg.payload = temp;\nmsg.payload = msg.payload.toFixed(2).replace('.', ',')\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 1010,
        "y": 280,
        "wires": [
            [
                "a771dc51.b0b42"
            ]
        ]
    },
    {
        "id": "a771dc51.b0b42",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "40cc476b.882118",
        "order": 6,
        "width": 0,
        "height": 0,
        "name": "Hz",
        "label": "Frequenz",
        "format": "{{msg.payload}} Hz",
        "layout": "row-spread",
        "x": 1190,
        "y": 280,
        "wires": []
    },
    {
        "id": "a144d424.212ea8",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "40cc476b.882118",
        "order": 2,
        "width": 0,
        "height": 0,
        "name": "P-bez",
        "label": "<font color=red> Leistung Bezug",
        "format": "{{msg.payload}} W",
        "layout": "row-spread",
        "x": 1190,
        "y": 120,
        "wires": []
    },
    {
        "id": "c9a6f588.dcf12",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "40cc476b.882118",
        "order": 4,
        "width": 0,
        "height": 0,
        "name": "U-L2",
        "label": "Spannung L2",
        "format": "{{msg.payload}} V",
        "layout": "row-spread",
        "x": 1190,
        "y": 200,
        "wires": []
    },
    {
        "id": "18ccf7cc.3cd628",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "40cc476b.882118",
        "order": 5,
        "width": 0,
        "height": 0,
        "name": "U-L3",
        "label": "Spannung L3",
        "format": "{{msg.payload}} V",
        "layout": "row-spread",
        "x": 1190,
        "y": 240,
        "wires": []
    },
    {
        "id": "9a97c10c.2474f8",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "U-L2",
        "func": "var temp = (msg.payload.UL2[1]) / 100\nmsg.payload = temp;\nmsg.payload = msg.payload.toFixed(1).replace('.', ',')\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 1010,
        "y": 200,
        "wires": [
            [
                "c9a6f588.dcf12"
            ]
        ]
    },
    {
        "id": "ae76c4a9.47f878",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "U-L3",
        "func": "var temp = (msg.payload.UL3[1]) / 100\nmsg.payload = temp;\nmsg.payload = msg.payload.toFixed(1).replace('.', ',')\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 1010,
        "y": 240,
        "wires": [
            [
                "18ccf7cc.3cd628"
            ]
        ]
    },
    {
        "id": "bad76825.9eca7",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "P-ein",
        "func": "msg.payload = { \n 'fc': 4, \n 'unitid': 3, \n 'address': 30867, \n 'quantity': 2 \n}\nmsg.topic = 'Pein'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 370,
        "y": 120,
        "wires": [
            [
                "60ee51c7.35b9d8"
            ]
        ]
    },
    {
        "id": "ba8a42fb.622ba8",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "P-ein",
        "func": "var temp = (msg.payload.Pein[1])\nmsg.payload = temp;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 1010,
        "y": 80,
        "wires": [
            [
                "bcb57e2f.1729a8"
            ]
        ]
    },
    {
        "id": "bcb57e2f.1729a8",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "40cc476b.882118",
        "order": 1,
        "width": 0,
        "height": 0,
        "name": "P-ein",
        "label": "<font color=green> Leistung Einspeisung",
        "format": "{{msg.payload}} W",
        "layout": "row-spread",
        "x": 1190,
        "y": 80,
        "wires": []
    },
    {
        "id": "cd8cf4d5.b2f298",
        "type": "inject",
        "z": "6a66d831.fbce4",
        "name": "",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "repeat": "5",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "x": 150,
        "y": 740,
        "wires": [
            [
                "9f09398a.f67c8",
                "a89e663b.565fd8",
                "af9667b1.31cdd8",
                "521bc6ea.793658",
                "e2d5bbea.55fe08",
                "bff26468.d6f66",
                "ea714aff.811b98"
            ]
        ]
    },
    {
        "id": "93c05f1d.a719e8",
        "type": "modbus-flex-getter",
        "z": "6a66d831.fbce4",
        "name": "",
        "showStatusActivities": false,
        "showErrors": false,
        "logIOActivities": false,
        "server": "15792897.343e87",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 640,
        "y": 740,
        "wires": [
            [
                "dc058580.6edc18"
            ],
            []
        ]
    },
    {
        "id": "9f09398a.f67c8",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "P-AC1",
        "func": "msg.payload = { \n 'fc': 4, \n 'unitid': 3, \n 'address': 30775, \n 'quantity': 2 \n}\nmsg.topic = 'PAC1'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 370,
        "y": 740,
        "wires": [
            [
                "93c05f1d.a719e8"
            ]
        ]
    },
    {
        "id": "dc058580.6edc18",
        "type": "join",
        "z": "6a66d831.fbce4",
        "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": 830,
        "y": 740,
        "wires": [
            [
                "f659e99c.9bdf1",
                "34c7cfbb.3b3008",
                "7c58fa98.8cbadc",
                "687d59de.f9881",
                "155a5486.bf1e23",
                "ad8ec242.afb5b",
                "4c72a26c.d49c6c"
            ]
        ]
    },
    {
        "id": "f659e99c.9bdf1",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "P-AC1",
        "func": "var temp = (msg.payload.PAC1[1])\nmsg.payload = temp;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 1010,
        "y": 740,
        "wires": [
            [
                "4ac1878c.54c978"
            ]
        ]
    },
    {
        "id": "4ac1878c.54c978",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "bad4a5be.f7833",
        "order": 1,
        "width": 0,
        "height": 0,
        "name": "P-AC1",
        "label": "Leistung AC",
        "format": "{{msg.payload}} W",
        "layout": "row-spread",
        "x": 1190,
        "y": 740,
        "wires": []
    },
    {
        "id": "a89e663b.565fd8",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "P-DC1",
        "func": "msg.payload = { \n 'fc': 4, \n 'unitid': 3, \n 'address': 30773, \n 'quantity': 2 \n}\nmsg.topic = 'PDC1'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 370,
        "y": 860,
        "wires": [
            [
                "93c05f1d.a719e8"
            ]
        ]
    },
    {
        "id": "34c7cfbb.3b3008",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "P-DC1",
        "func": "var temp = (msg.payload.PDC1[1])\nmsg.payload = temp;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 1010,
        "y": 860,
        "wires": [
            [
                "a0a40244.a2dea8"
            ]
        ]
    },
    {
        "id": "a0a40244.a2dea8",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "bad4a5be.f7833",
        "order": 5,
        "width": 0,
        "height": 0,
        "name": "P-DC1",
        "label": "<font color=orange> Leistung DC",
        "format": "{{msg.payload}} W",
        "layout": "row-spread",
        "x": 1190,
        "y": 860,
        "wires": []
    },
    {
        "id": "59855b93.2e8594",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "var",
        "func": "msg.payload = { \n 'fc': 4, \n 'unitid': 3, \n 'address': 31497, \n 'quantity': 2 \n}\nmsg.topic = 'var'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 370,
        "y": 320,
        "wires": [
            [
                "60ee51c7.35b9d8"
            ]
        ]
    },
    {
        "id": "ab2050.5c9597b",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "var",
        "func": "var temp = (msg.payload.var[1])\nmsg.payload = temp;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 1010,
        "y": 320,
        "wires": [
            [
                "15c7c8f7.a6af5f"
            ]
        ]
    },
    {
        "id": "15c7c8f7.a6af5f",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "bb3073d1.32cbc8",
        "order": 3,
        "width": 0,
        "height": 0,
        "name": "var",
        "label": "Blindleistung",
        "format": "{{msg.payload}} var",
        "layout": "row-spread",
        "x": 1190,
        "y": 320,
        "wires": []
    },
    {
        "id": "4ae51e87.e73068",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "P-AC2",
        "func": "msg.payload = { \n 'fc': 4, \n 'unitid': 3, \n 'address': 30775, \n 'quantity': 2 \n}\nmsg.topic = 'PAC2'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 370,
        "y": 360,
        "wires": [
            [
                "60ee51c7.35b9d8"
            ]
        ]
    },
    {
        "id": "7ad0b122.97a76",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "P-AC2",
        "func": "var temp = (msg.payload.PAC2[1])\nmsg.payload = temp;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 1010,
        "y": 360,
        "wires": [
            [
                "b7acaac1.247e1"
            ]
        ]
    },
    {
        "id": "b7acaac1.247e1",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "bb3073d1.32cbc8",
        "order": 1,
        "width": 0,
        "height": 0,
        "name": "P-AC2",
        "label": "Leistung AC",
        "format": "{{msg.payload}} W",
        "layout": "row-spread",
        "x": 1190,
        "y": 360,
        "wires": []
    },
    {
        "id": "d547b9c4.9213",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "P-DC2",
        "func": "msg.payload = { \n 'fc': 4, \n 'unitid': 3, \n 'address': 30773, \n 'quantity': 2 \n}\nmsg.topic = 'PDC2'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 370,
        "y": 400,
        "wires": [
            [
                "60ee51c7.35b9d8"
            ]
        ]
    },
    {
        "id": "149ad36a.3588cd",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "P-DC2",
        "func": "var temp = (msg.payload.PDC2[1])\nmsg.payload = temp;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 1010,
        "y": 400,
        "wires": [
            [
                "9e77ba24.d350d8"
            ]
        ]
    },
    {
        "id": "9e77ba24.d350d8",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "bb3073d1.32cbc8",
        "order": 2,
        "width": 0,
        "height": 0,
        "name": "P-DC2",
        "label": "<font color=orange> Leistung DC",
        "format": "{{msg.payload}} W",
        "layout": "row-spread",
        "x": 1190,
        "y": 400,
        "wires": []
    },
    {
        "id": "af9667b1.31cdd8",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "U-L",
        "func": "msg.payload = { \n 'fc': 4,\n 'unitid': 3, \n 'address': 30783, \n 'quantity': 2 \n} \nmsg.topic = 'UL'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 370,
        "y": 780,
        "wires": [
            [
                "93c05f1d.a719e8"
            ]
        ]
    },
    {
        "id": "7c58fa98.8cbadc",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "U-L",
        "func": "var temp = (msg.payload.UL[1]) / 100\nmsg.payload = temp;\nmsg.payload = msg.payload.toFixed(1).replace('.', ',')\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 1010,
        "y": 780,
        "wires": [
            [
                "6abcad41.5d0dbc"
            ]
        ]
    },
    {
        "id": "6abcad41.5d0dbc",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "bad4a5be.f7833",
        "order": 2,
        "width": 0,
        "height": 0,
        "name": "U-L",
        "label": "Spannung AC",
        "format": "{{msg.payload}} V",
        "layout": "row-spread",
        "x": 1190,
        "y": 780,
        "wires": []
    },
    {
        "id": "521bc6ea.793658",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "I-AC1",
        "func": "msg.payload = { \n 'fc': 4,\n 'unitid': 3, \n 'address': 30795, \n 'quantity': 2 \n} \nmsg.topic = 'IAC1'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 370,
        "y": 820,
        "wires": [
            [
                "93c05f1d.a719e8"
            ]
        ]
    },
    {
        "id": "687d59de.f9881",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "I-AC1",
        "func": "var temp = (msg.payload.IAC1[1]) / 1000\nmsg.payload = temp;\nmsg.payload = msg.payload.toFixed(2).replace('.', ',')\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 1010,
        "y": 820,
        "wires": [
            [
                "1d3b6e04.b95c72"
            ]
        ]
    },
    {
        "id": "1d3b6e04.b95c72",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "bad4a5be.f7833",
        "order": 3,
        "width": 0,
        "height": 0,
        "name": "I-AC1",
        "label": "Strom AC",
        "format": "{{msg.payload}} A",
        "layout": "row-spread",
        "x": 1190,
        "y": 820,
        "wires": []
    },
    {
        "id": "e2d5bbea.55fe08",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "U-DC1",
        "func": "msg.payload = { \n 'fc': 4, \n 'unitid': 3, \n 'address': 30771, \n 'quantity': 2 \n}\nmsg.topic = 'UDC1'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 370,
        "y": 900,
        "wires": [
            [
                "93c05f1d.a719e8"
            ]
        ]
    },
    {
        "id": "bff26468.d6f66",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "I-DC1",
        "func": "msg.payload = { \n 'fc': 4,\n 'unitid': 3, \n 'address': 30769, \n 'quantity': 2 \n} \nmsg.topic = 'IDC1'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 370,
        "y": 940,
        "wires": [
            [
                "93c05f1d.a719e8"
            ]
        ]
    },
    {
        "id": "ea714aff.811b98",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "T1",
        "func": "msg.payload = { \n 'fc': 4,\n 'unitid': 3, \n 'address': 30953, \n 'quantity': 2 \n} \nmsg.topic = 'T1'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 370,
        "y": 980,
        "wires": [
            [
                "93c05f1d.a719e8"
            ]
        ]
    },
    {
        "id": "155a5486.bf1e23",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "U-DC1",
        "func": "var temp = (msg.payload.UDC1[1]) / 100\nmsg.payload = temp;\nmsg.payload = msg.payload.toFixed(1).replace('.', ',')\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 1010,
        "y": 900,
        "wires": [
            [
                "d3291a12.49ac3"
            ]
        ]
    },
    {
        "id": "ad8ec242.afb5b",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "I-DC1",
        "func": "var temp = (msg.payload.IDC1[1]) / 1000\nmsg.payload = temp;\nmsg.payload = msg.payload.toFixed(2).replace('.', ',')\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 1010,
        "y": 940,
        "wires": [
            [
                "1aaaa335.7ec4ed"
            ]
        ]
    },
    {
        "id": "4c72a26c.d49c6c",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "T1",
        "func": "var temp = (msg.payload.T1[1]) / 10\nmsg.payload = temp;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 1010,
        "y": 980,
        "wires": [
            [
                "82f6ca5c.2ac3a"
            ]
        ]
    },
    {
        "id": "d3291a12.49ac3",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "bad4a5be.f7833",
        "order": 6,
        "width": 0,
        "height": 0,
        "name": "U-DC1",
        "label": "<font color=orange> Spannung DC",
        "format": "{{msg.payload}} V",
        "layout": "row-spread",
        "x": 1190,
        "y": 900,
        "wires": []
    },
    {
        "id": "1aaaa335.7ec4ed",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "bad4a5be.f7833",
        "order": 7,
        "width": 0,
        "height": 0,
        "name": "I-DC1",
        "label": "<font color=orange> Strom DC",
        "format": "{{msg.payload}} A",
        "layout": "row-spread",
        "x": 1190,
        "y": 940,
        "wires": []
    },
    {
        "id": "82f6ca5c.2ac3a",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "bad4a5be.f7833",
        "order": 9,
        "width": 0,
        "height": 0,
        "name": "T1",
        "label": "Temperatur",
        "format": "{{msg.payload}} °C",
        "layout": "row-spread",
        "x": 1190,
        "y": 980,
        "wires": []
    },
    {
        "id": "cee0ebbb.0980b",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "T2",
        "func": "msg.payload = { \n 'fc': 4,\n 'unitid': 3, \n 'address': 30953, \n 'quantity': 2 \n} \nmsg.topic = 'T2'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 370,
        "y": 440,
        "wires": [
            [
                "60ee51c7.35b9d8"
            ]
        ]
    },
    {
        "id": "bf2603c8.320bb",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "T2",
        "func": "var temp = (msg.payload.T2[1]) / 10\nmsg.payload = temp;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 1010,
        "y": 440,
        "wires": [
            [
                "13c0b3a5.750d5c"
            ]
        ]
    },
    {
        "id": "13c0b3a5.750d5c",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "bb3073d1.32cbc8",
        "order": 3,
        "width": 0,
        "height": 0,
        "name": "T2",
        "label": "Temperatur",
        "format": "{{msg.payload}} °C",
        "layout": "row-spread",
        "x": 1190,
        "y": 440,
        "wires": []
    },
    {
        "id": "101bd986.8eac7e",
        "type": "modbus-client",
        "z": "",
        "name": "STP6.0",
        "clienttype": "tcp",
        "bufferCommands": true,
        "stateLogEnabled": false,
        "queueLogEnabled": false,
        "tcpHost": "192.168.168.50",
        "tcpPort": "502",
        "tcpType": "TPC-RTU-BUFFERED",
        "serialPort": "/dev/ttyUSB",
        "serialType": "RTU-BUFFERD",
        "serialBaudrate": "9600",
        "serialDatabits": "8",
        "serialStopbits": "1",
        "serialParity": "none",
        "serialConnectionDelay": "100",
        "unit_id": 3,
        "commandDelay": 200,
        "clientTimeout": 1000,
        "reconnectOnTimeout": true,
        "reconnectTimeout": 2000,
        "parallelUnitIdsAllowed": true
    },
    {
        "id": "40cc476b.882118",
        "type": "ui_group",
        "z": "",
        "name": "Energy Meter",
        "tab": "31d3365a.5f4a02",
        "order": 2,
        "disp": true,
        "width": "6",
        "collapse": false
    },
    {
        "id": "15792897.343e87",
        "type": "modbus-client",
        "z": "",
        "name": "SB3000",
        "clienttype": "tcp",
        "bufferCommands": true,
        "stateLogEnabled": false,
        "queueLogEnabled": false,
        "tcpHost": "192.168.168.24",
        "tcpPort": "503",
        "tcpType": "TPC-RTU-BUFFERED",
        "serialPort": "/dev/ttyUSB",
        "serialType": "RTU-BUFFERD",
        "serialBaudrate": "9600",
        "serialDatabits": "8",
        "serialStopbits": "1",
        "serialParity": "none",
        "serialConnectionDelay": "100",
        "unit_id": 3,
        "commandDelay": 200,
        "clientTimeout": 1000,
        "reconnectOnTimeout": true,
        "reconnectTimeout": 2000,
        "parallelUnitIdsAllowed": true
    },
    {
        "id": "bad4a5be.f7833",
        "type": "ui_group",
        "z": "",
        "name": "Sunny Boy",
        "tab": "31d3365a.5f4a02",
        "order": 3,
        "disp": true,
        "width": "6",
        "collapse": false
    },
    {
        "id": "bb3073d1.32cbc8",
        "type": "ui_group",
        "z": "",
        "name": "Sunny Tripower",
        "tab": "31d3365a.5f4a02",
        "order": 2,
        "disp": true,
        "width": "6",
        "collapse": false
    },
    {
        "id": "31d3365a.5f4a02",
        "type": "ui_tab",
        "z": "",
        "name": "Photovoltaik",
        "icon": "dashboard",
        "order": 2,
        "disabled": false,
        "hidden": false
    }
]

```

every second there are error:

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/4/849867a144545c6689561ae699104dac1abb75ec.png)

---

<div class="post-metadata">

### Author: ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)
#### Post date: [13 September 2020 10:02 UTC](https://discourse.nodered.org/t/adding-two-values/32784/10 "2020-09-13T10:02:17Z")

</div>

The reason you cannot add the two values is because these values dont arrive in the + function node simultaneously and one or the other is undefined at that specific time.

As Colin suggested further up, you have to join **again** the values .. so the'll be in the same message and accessible for addition.

[EDIT]  
[Merging Flows - Node-RED Essentials](https://www.youtube.com/watch?v=t8T-JMnQHMk)

---

<div class="post-metadata">

### Author: ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)
#### Post date: [13 September 2020 10:07 UTC](https://discourse.nodered.org/t/adding-two-values/32784/11 "2020-09-13T10:07:00Z")

</div>

aah!

but there is a problem with the first join node, i changed to "10":

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

now all the values are in "T2"

---

<div class="post-metadata">

### Author: ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)
#### Post date: [13 September 2020 10:19 UTC](https://discourse.nodered.org/t/adding-two-values/32784/12 "2020-09-13T10:19:40Z")

</div>

> [@Becker](#):
>
> but there is a problem with the first join node, i changed to "10"

The join node does its job .. waits for 10 messages from the 10 different topics, as defined in the preceding functions, and joins them. And its not in T2 .. its in msg.payload

now for the addition issue: add a join node between the two (2nd column) functions to join the messages.  
you have to fully understand how this join node works .. i hope the video tutorial from the developers makes it more clear

[EDIT]

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

---

<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: [13 September 2020 10:20 UTC](https://discourse.nodered.org/t/adding-two-values/32784/13 "2020-09-13T10:20:58Z")

</div>

I haven't studied the flow in detail, but why is it necessary to have the first Join node? Could that not just be a Switch node to send the data off to the displays?

---

<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: [13 September 2020 11:33 UTC](https://discourse.nodered.org/t/adding-two-values/32784/14 "2020-09-13T11:33:08Z")

</div>

Hi again, as mensioned earlier, this is how you can do it with buffer parser...

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/0/60bf7ef0baeb69e419ebed9e7d28aab13eed11a9.png)  
(obviously I dont have your invertor so all values are simulated - zero)

this is the flow i did...

```auto
[{"id":"3c70a20c.01d53e","type":"inject","z":"15164b61.40f905","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":220,"y":300,"wires":[["bb340a9c.a81c58","7bdb6cd4.f23b24","58e3fd6c.ca7b04","4d07d7f8.99b288"]]},{"id":"bb340a9c.a81c58","type":"modbus-getter","z":"15164b61.40f905","name":"30773 ~ 30869","showStatusActivities":false,"showErrors":true,"logIOActivities":false,"unitid":"","dataType":"InputRegister","adr":"30773","quantity":"96","server":"7b9a0315.71ca9c","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"x":480,"y":220,"wires":[["768c153b.df699c"],[]]},{"id":"7bdb6cd4.f23b24","type":"modbus-getter","z":"15164b61.40f905","name":"30953 ~ 30955","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"unitid":"","dataType":"InputRegister","adr":"30953","quantity":"2","server":"7b9a0315.71ca9c","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"x":480,"y":280,"wires":[["5e0a1ec.aeb7ce"],[]]},{"id":"58e3fd6c.ca7b04","type":"modbus-getter","z":"15164b61.40f905","name":"31253 ~ 31259","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"unitid":"","dataType":"InputRegister","adr":"31253","quantity":"6","server":"7b9a0315.71ca9c","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"x":480,"y":340,"wires":[["7cdd5a8a.43b644"],[]]},{"id":"4d07d7f8.99b288","type":"modbus-getter","z":"15164b61.40f905","name":"31447 ~ 31499","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"unitid":"","dataType":"InputRegister","adr":"31447","quantity":"52","server":"7b9a0315.71ca9c","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"x":480,"y":400,"wires":[["b7162329.e0cc4"],[]]},{"id":"768c153b.df699c","type":"buffer-parser","z":"15164b61.40f905","name":"","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"int32le","name":"PDC2","offset":0,"length":1,"offsetbit":0,"mask":""},{"type":"int32le","name":"PAC2","offset":4,"length":1,"offsetbit":0,"mask":""},{"type":"int32le","name":"Pbez","offset":184,"length":1,"offsetbit":0,"mask":""},{"type":"int32le","name":"Pein","offset":188,"length":1,"offsetbit":0,"mask":""}],"swap1":"swap16","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"setTopic":true,"x":670,"y":220,"wires":[["bc60faef.9b6c08","15f17a3a.bf22a6","c2e5e0ec.242a1","865fdaa3.0ff7b8","52e8c22d.52cb6c"]]},{"id":"5e0a1ec.aeb7ce","type":"buffer-parser","z":"15164b61.40f905","name":"","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"int32le","name":"T2","offset":0,"length":1,"offsetbit":0,"mask":""}],"swap1":"swap16","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"setTopic":true,"x":670,"y":280,"wires":[["ed2f8fed.778a1","121cd028.592a7"]]},{"id":"7cdd5a8a.43b644","type":"buffer-parser","z":"15164b61.40f905","name":"","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"int32le","name":"UL1","offset":0,"length":1,"offsetbit":0,"mask":""},{"type":"int32le","name":"UL2","offset":4,"length":1,"offsetbit":0,"mask":""},{"type":"int32le","name":"UL3","offset":8,"length":1,"offsetbit":0,"mask":""}],"swap1":"swap16","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"setTopic":true,"x":670,"y":340,"wires":[["e77c39b2.ab0da8","96e6d1a4.95cf5","b7d0340e.8bd868","25aca7ac.e71e78"]]},{"id":"b7162329.e0cc4","type":"buffer-parser","z":"15164b61.40f905","name":"","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"int32le","name":"Hz","offset":0,"length":1,"offsetbit":0,"mask":""},{"type":"int32be","name":"var","offset":50,"length":1,"offsetbit":0,"mask":""}],"swap1":"swap16","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"setTopic":true,"x":670,"y":400,"wires":[["d8a23fa6.0a779","d0023be2.999bb8","2405d4f1.155f9c"]]},{"id":"bc60faef.9b6c08","type":"debug","z":"15164b61.40f905","name":"parser1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":920,"y":60,"wires":[]},{"id":"15f17a3a.bf22a6","type":"ui_text","z":"15164b61.40f905","group":"8a11e8c7.342528","order":1,"width":0,"height":0,"name":"P-ein","label":"<font color=green> Leistung Einspeisung","format":"{{msg.payload.Pein}} W","layout":"row-spread","x":910,"y":100,"wires":[]},{"id":"c2e5e0ec.242a1","type":"ui_text","z":"15164b61.40f905","group":"8a11e8c7.342528","order":2,"width":0,"height":0,"name":"P-bez","label":"<font color=red> Leistung Bezug","format":"{{msg.payload.Pbez}} W","layout":"row-spread","x":910,"y":140,"wires":[]},{"id":"865fdaa3.0ff7b8","type":"ui_text","z":"15164b61.40f905","group":"5be273cb.ceaddc","order":1,"width":0,"height":0,"name":"P-AC2","label":"Leistung AC","format":"{{msg.payload.PAC2}} W","layout":"row-spread","x":910,"y":180,"wires":[]},{"id":"52e8c22d.52cb6c","type":"ui_text","z":"15164b61.40f905","group":"5be273cb.ceaddc","order":2,"width":0,"height":0,"name":"P-DC2","label":"<font color=orange> Leistung DC","format":"{{msg.payload.PDC2}} W","layout":"row-spread","x":910,"y":220,"wires":[]},{"id":"ed2f8fed.778a1","type":"ui_text","z":"15164b61.40f905","group":"5be273cb.ceaddc","order":3,"width":0,"height":0,"name":"T2","label":"Temperatur","format":"{{msg.payload.T2}} °C","layout":"row-spread","x":910,"y":320,"wires":[]},{"id":"121cd028.592a7","type":"debug","z":"15164b61.40f905","name":"parser2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":920,"y":280,"wires":[]},{"id":"e77c39b2.ab0da8","type":"ui_text","z":"15164b61.40f905","group":"8a11e8c7.342528","order":3,"width":0,"height":0,"name":"U-L1","label":"Spannung L1","format":"{{msg.payload.UL1}} V","layout":"row-spread","x":910,"y":420,"wires":[]},{"id":"96e6d1a4.95cf5","type":"ui_text","z":"15164b61.40f905","group":"8a11e8c7.342528","order":4,"width":0,"height":0,"name":"U-L2","label":"Spannung L2","format":"{{msg.payload.UL2}} V","layout":"row-spread","x":910,"y":460,"wires":[]},{"id":"b7d0340e.8bd868","type":"ui_text","z":"15164b61.40f905","group":"8a11e8c7.342528","order":5,"width":0,"height":0,"name":"U-L3","label":"Spannung L3","format":"{{msg.payload.UL3}} V","layout":"row-spread","x":910,"y":500,"wires":[]},{"id":"25aca7ac.e71e78","type":"debug","z":"15164b61.40f905","name":"parser3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":920,"y":380,"wires":[]},{"id":"d8a23fa6.0a779","type":"ui_text","z":"15164b61.40f905","group":"8a11e8c7.342528","order":6,"width":0,"height":0,"name":"Hz","label":"Frequenz","format":"{{msg.payload}} Hz","layout":"row-spread","x":910,"y":600,"wires":[]},{"id":"d0023be2.999bb8","type":"ui_text","z":"15164b61.40f905","group":"5be273cb.ceaddc","order":3,"width":0,"height":0,"name":"var","label":"Blindleistung","format":"{{msg.payload}} var","layout":"row-spread","x":910,"y":640,"wires":[]},{"id":"2405d4f1.155f9c","type":"debug","z":"15164b61.40f905","name":"parser4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":920,"y":560,"wires":[]},{"id":"870d2fa5.fa314","type":"comment","z":"15164b61.40f905","name":"STP6.0-3AV-40","info":"","x":220,"y":260,"wires":[]},{"id":"7b9a0315.71ca9c","type":"modbus-client","z":"","name":"STP6.0","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"192.168.168.50","tcpPort":"502","tcpType":"TPC-RTU-BUFFERED","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":3,"commandDelay":200,"clientTimeout":1000,"reconnectOnTimeout":true,"reconnectTimeout":2000,"parallelUnitIdsAllowed":true},{"id":"8a11e8c7.342528","type":"ui_group","z":"","name":"Energy Meter","tab":"78892c6f.892384","order":2,"disp":true,"width":"6","collapse":false},{"id":"5be273cb.ceaddc","type":"ui_group","z":"","name":"Sunny Tripower","tab":"78892c6f.892384","order":2,"disp":true,"width":"6","collapse":false},{"id":"78892c6f.892384","type":"ui_tab","z":"","name":"Photovoltaik","icon":"dashboard","order":2,"disabled":false,"hidden":false}]

```

These are how i decided to group the reads up into 4 parts & the offsets I used in the buffer parser...

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

NOTE: I couldnt find an exact manual but [this one](http://files.sma.de/dl/2585/WEBBOX-MODBUS-TB-en-19.pdf) suggests values are S32 (Signed 32 bit integers)

So if you find the values comming out of `buffer parser` values are not correct, then simply change the settings...

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/5/455be9091c4941f4602e108745140e71b1c7e933.png)

---

<div class="post-metadata">

### Author: ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)
#### Post date: [13 September 2020 13:39 UTC](https://discourse.nodered.org/t/adding-two-values/32784/15 "2020-09-13T13:39:57Z")

</div>

Thank you Steve, but your flow doesn´t work.  
I get the solution with join (array):

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/9/9948cb8640c6951cf2510684ad4b9415fef71298.png)

if you like to look at:

```auto
[
    {
        "id": "ce4d01f7.fa9ea8",
        "type": "comment",
        "z": "6a66d831.fbce4",
        "name": "SB 3000TL-21",
        "info": "",
        "x": 620,
        "y": 680,
        "wires": []
    },
    {
        "id": "e964bad3.ac9098",
        "type": "comment",
        "z": "6a66d831.fbce4",
        "name": "STP6.0-3AV-40",
        "info": "",
        "x": 620,
        "y": 120,
        "wires": []
    },
    {
        "id": "60ee51c7.35b9d8",
        "type": "modbus-flex-getter",
        "z": "6a66d831.fbce4",
        "name": "",
        "showStatusActivities": false,
        "showErrors": false,
        "logIOActivities": false,
        "server": "101bd986.8eac7e",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 620,
        "y": 160,
        "wires": [
            [
                "9d0e7872.eed048"
            ],
            []
        ]
    },
    {
        "id": "8c25c3d2.611cf",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "P-bez",
        "func": "msg.payload = { \n 'fc': 4, \n 'unitid': 3, \n 'address': 30865, \n 'quantity': 2 \n}\nmsg.topic = 'Pbez'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 350,
        "y": 60,
        "wires": [
            [
                "60ee51c7.35b9d8"
            ]
        ]
    },
    {
        "id": "4d29173f.9a1778",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "U-L1",
        "func": "msg.payload = { \n 'fc': 4,\n 'unitid': 3, \n 'address': 31253, \n 'quantity': 2 \n} \nmsg.topic = 'UL1'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 350,
        "y": 140,
        "wires": [
            [
                "60ee51c7.35b9d8"
            ]
        ]
    },
    {
        "id": "79b63d2d.40baec",
        "type": "inject",
        "z": "6a66d831.fbce4",
        "name": "",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "repeat": "5",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "x": 150,
        "y": 160,
        "wires": [
            [
                "8c25c3d2.611cf",
                "4d29173f.9a1778",
                "49162280.0d7dec",
                "ed5031f6.c8ff48",
                "a667d1b1.0d5de",
                "bad76825.9eca7",
                "59855b93.2e8594",
                "4ae51e87.e73068",
                "d547b9c4.9213",
                "cee0ebbb.0980b"
            ]
        ]
    },
    {
        "id": "ccf106dd.2c2f28",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "40cc476b.882118",
        "order": 3,
        "width": 0,
        "height": 0,
        "name": "U-L1",
        "label": "Spannung L1",
        "format": "{{msg.payload}} V",
        "layout": "row-spread",
        "x": 1170,
        "y": 140,
        "wires": []
    },
    {
        "id": "49162280.0d7dec",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "U-L2",
        "func": "msg.payload = { \n 'fc': 4,\n 'unitid': 3, \n 'address': 31255, \n 'quantity': 2 \n} \nmsg.topic = 'UL2'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 350,
        "y": 180,
        "wires": [
            [
                "60ee51c7.35b9d8"
            ]
        ]
    },
    {
        "id": "ed5031f6.c8ff48",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "U-L3",
        "func": "msg.payload = { \n 'fc': 4,\n 'unitid': 3, \n 'address': 31257, \n 'quantity': 2 \n} \nmsg.topic = 'UL3'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 350,
        "y": 220,
        "wires": [
            [
                "60ee51c7.35b9d8"
            ]
        ]
    },
    {
        "id": "a7fe19a5.754b5",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "P-bez",
        "func": "var temp = (msg.payload.Pbez[1])\nmsg.payload = temp;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 990,
        "y": 100,
        "wires": [
            [
                "a144d424.212ea8"
            ]
        ]
    },
    {
        "id": "a5135b35.34d33",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "U-L1",
        "func": "var temp = (msg.payload.UL1[1]) / 100\nmsg.payload = temp;\nmsg.payload = msg.payload.toFixed(1).replace('.', ',')\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 990,
        "y": 140,
        "wires": [
            [
                "ccf106dd.2c2f28"
            ]
        ]
    },
    {
        "id": "a667d1b1.0d5de",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "Hz",
        "func": "msg.payload = { \n 'fc': 4,\n 'unitid': 3, \n 'address': 31447, \n 'quantity': 2 \n} \nmsg.topic = 'Hz'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 350,
        "y": 260,
        "wires": [
            [
                "60ee51c7.35b9d8"
            ]
        ]
    },
    {
        "id": "a147915c.0f6988",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "Hz",
        "func": "var temp = (msg.payload.Hz[1]) / 100\nmsg.payload = temp;\nmsg.payload = msg.payload.toFixed(2).replace('.', ',')\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 990,
        "y": 260,
        "wires": [
            [
                "a771dc51.b0b42"
            ]
        ]
    },
    {
        "id": "a771dc51.b0b42",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "40cc476b.882118",
        "order": 6,
        "width": 0,
        "height": 0,
        "name": "Hz",
        "label": "Frequenz",
        "format": "{{msg.payload}} Hz",
        "layout": "row-spread",
        "x": 1170,
        "y": 260,
        "wires": []
    },
    {
        "id": "a144d424.212ea8",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "40cc476b.882118",
        "order": 2,
        "width": 0,
        "height": 0,
        "name": "P-bez",
        "label": "<font color=red> Leistung Bezug",
        "format": "{{msg.payload}} W",
        "layout": "row-spread",
        "x": 1170,
        "y": 100,
        "wires": []
    },
    {
        "id": "c9a6f588.dcf12",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "40cc476b.882118",
        "order": 4,
        "width": 0,
        "height": 0,
        "name": "U-L2",
        "label": "Spannung L2",
        "format": "{{msg.payload}} V",
        "layout": "row-spread",
        "x": 1170,
        "y": 180,
        "wires": []
    },
    {
        "id": "18ccf7cc.3cd628",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "40cc476b.882118",
        "order": 5,
        "width": 0,
        "height": 0,
        "name": "U-L3",
        "label": "Spannung L3",
        "format": "{{msg.payload}} V",
        "layout": "row-spread",
        "x": 1170,
        "y": 220,
        "wires": []
    },
    {
        "id": "9a97c10c.2474f8",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "U-L2",
        "func": "var temp = (msg.payload.UL2[1]) / 100\nmsg.payload = temp;\nmsg.payload = msg.payload.toFixed(1).replace('.', ',')\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 990,
        "y": 180,
        "wires": [
            [
                "c9a6f588.dcf12"
            ]
        ]
    },
    {
        "id": "ae76c4a9.47f878",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "U-L3",
        "func": "var temp = (msg.payload.UL3[1]) / 100\nmsg.payload = temp;\nmsg.payload = msg.payload.toFixed(1).replace('.', ',')\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 990,
        "y": 220,
        "wires": [
            [
                "18ccf7cc.3cd628"
            ]
        ]
    },
    {
        "id": "bad76825.9eca7",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "P-ein",
        "func": "msg.payload = { \n 'fc': 4, \n 'unitid': 3, \n 'address': 30867, \n 'quantity': 2 \n}\nmsg.topic = 'Pein'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 350,
        "y": 100,
        "wires": [
            [
                "60ee51c7.35b9d8"
            ]
        ]
    },
    {
        "id": "ba8a42fb.622ba8",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "P-ein",
        "func": "var temp = (msg.payload.Pein[1])\nmsg.payload = temp;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 990,
        "y": 60,
        "wires": [
            [
                "bcb57e2f.1729a8"
            ]
        ]
    },
    {
        "id": "bcb57e2f.1729a8",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "40cc476b.882118",
        "order": 1,
        "width": 0,
        "height": 0,
        "name": "P-ein",
        "label": "<font color=green> Leistung Einspeisung",
        "format": "{{msg.payload}} W",
        "layout": "row-spread",
        "x": 1170,
        "y": 60,
        "wires": []
    },
    {
        "id": "cd8cf4d5.b2f298",
        "type": "inject",
        "z": "6a66d831.fbce4",
        "name": "",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "repeat": "5",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "x": 130,
        "y": 720,
        "wires": [
            [
                "9f09398a.f67c8",
                "a89e663b.565fd8",
                "af9667b1.31cdd8",
                "521bc6ea.793658",
                "e2d5bbea.55fe08",
                "bff26468.d6f66",
                "ea714aff.811b98"
            ]
        ]
    },
    {
        "id": "93c05f1d.a719e8",
        "type": "modbus-flex-getter",
        "z": "6a66d831.fbce4",
        "name": "",
        "showStatusActivities": false,
        "showErrors": false,
        "logIOActivities": false,
        "server": "15792897.343e87",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 620,
        "y": 720,
        "wires": [
            [
                "dc058580.6edc18"
            ],
            []
        ]
    },
    {
        "id": "9f09398a.f67c8",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "P-AC1",
        "func": "msg.payload = { \n 'fc': 4, \n 'unitid': 3, \n 'address': 30775, \n 'quantity': 2 \n}\nmsg.topic = 'PAC1'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 350,
        "y": 720,
        "wires": [
            [
                "93c05f1d.a719e8"
            ]
        ]
    },
    {
        "id": "dc058580.6edc18",
        "type": "join",
        "z": "6a66d831.fbce4",
        "name": "",
        "mode": "custom",
        "build": "object",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": false,
        "timeout": "",
        "count": "7",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "",
        "reduceFixup": "",
        "x": 810,
        "y": 720,
        "wires": [
            [
                "f659e99c.9bdf1",
                "34c7cfbb.3b3008",
                "7c58fa98.8cbadc",
                "687d59de.f9881",
                "155a5486.bf1e23",
                "ad8ec242.afb5b",
                "4c72a26c.d49c6c"
            ]
        ]
    },
    {
        "id": "f659e99c.9bdf1",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "P-AC1",
        "func": "var temp = (msg.payload.PAC1[1])\nmsg.payload = temp;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 990,
        "y": 720,
        "wires": [
            [
                "4ac1878c.54c978",
                "199ab703.b06cd1"
            ]
        ]
    },
    {
        "id": "4ac1878c.54c978",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "bad4a5be.f7833",
        "order": 1,
        "width": 0,
        "height": 0,
        "name": "P-AC1",
        "label": "Leistung AC",
        "format": "{{msg.payload}} W",
        "layout": "row-spread",
        "x": 1170,
        "y": 720,
        "wires": []
    },
    {
        "id": "a89e663b.565fd8",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "P-DC1",
        "func": "msg.payload = { \n 'fc': 4, \n 'unitid': 3, \n 'address': 30773, \n 'quantity': 2 \n}\nmsg.topic = 'PDC1'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 350,
        "y": 840,
        "wires": [
            [
                "93c05f1d.a719e8"
            ]
        ]
    },
    {
        "id": "34c7cfbb.3b3008",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "P-DC1",
        "func": "var temp = (msg.payload.PDC1[1])\nmsg.payload = temp;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 990,
        "y": 840,
        "wires": [
            [
                "a0a40244.a2dea8",
                "199ab703.b06cd1"
            ]
        ]
    },
    {
        "id": "a0a40244.a2dea8",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "bad4a5be.f7833",
        "order": 5,
        "width": 0,
        "height": 0,
        "name": "P-DC1",
        "label": "<font color=orange> Leistung DC",
        "format": "{{msg.payload}} W",
        "layout": "row-spread",
        "x": 1170,
        "y": 840,
        "wires": []
    },
    {
        "id": "59855b93.2e8594",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "var",
        "func": "msg.payload = { \n 'fc': 4, \n 'unitid': 3, \n 'address': 31497, \n 'quantity': 2 \n}\nmsg.topic = 'var'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 350,
        "y": 300,
        "wires": [
            [
                "60ee51c7.35b9d8"
            ]
        ]
    },
    {
        "id": "ab2050.5c9597b",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "var",
        "func": "var temp = (msg.payload.var[1])\nmsg.payload = temp;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 990,
        "y": 300,
        "wires": [
            [
                "15c7c8f7.a6af5f"
            ]
        ]
    },
    {
        "id": "15c7c8f7.a6af5f",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "bb3073d1.32cbc8",
        "order": 3,
        "width": 0,
        "height": 0,
        "name": "var",
        "label": "Blindleistung",
        "format": "{{msg.payload}} var",
        "layout": "row-spread",
        "x": 1170,
        "y": 300,
        "wires": []
    },
    {
        "id": "4ae51e87.e73068",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "P-AC2",
        "func": "msg.payload = { \n 'fc': 4, \n 'unitid': 3, \n 'address': 30775, \n 'quantity': 2 \n}\nmsg.topic = 'PAC2'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 350,
        "y": 340,
        "wires": [
            [
                "60ee51c7.35b9d8"
            ]
        ]
    },
    {
        "id": "7ad0b122.97a76",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "P-AC2",
        "func": "var temp = (msg.payload.PAC2[1])\nmsg.payload = temp;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 990,
        "y": 340,
        "wires": [
            [
                "b7acaac1.247e1",
                "34ecae33.a428aa"
            ]
        ]
    },
    {
        "id": "b7acaac1.247e1",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "bb3073d1.32cbc8",
        "order": 1,
        "width": 0,
        "height": 0,
        "name": "P-AC2",
        "label": "Leistung AC",
        "format": "{{msg.payload}} W",
        "layout": "row-spread",
        "x": 1170,
        "y": 340,
        "wires": []
    },
    {
        "id": "d547b9c4.9213",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "P-DC2",
        "func": "msg.payload = { \n 'fc': 4, \n 'unitid': 3, \n 'address': 30773, \n 'quantity': 2 \n}\nmsg.topic = 'PDC2'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 350,
        "y": 380,
        "wires": [
            [
                "60ee51c7.35b9d8"
            ]
        ]
    },
    {
        "id": "149ad36a.3588cd",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "P-DC2",
        "func": "var temp = (msg.payload.PDC2[1])\nmsg.payload = temp;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 990,
        "y": 380,
        "wires": [
            [
                "9e77ba24.d350d8",
                "34ecae33.a428aa"
            ]
        ]
    },
    {
        "id": "9e77ba24.d350d8",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "bb3073d1.32cbc8",
        "order": 2,
        "width": 0,
        "height": 0,
        "name": "P-DC2",
        "label": "<font color=orange> Leistung DC",
        "format": "{{msg.payload}} W",
        "layout": "row-spread",
        "x": 1170,
        "y": 380,
        "wires": []
    },
    {
        "id": "af9667b1.31cdd8",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "U-L",
        "func": "msg.payload = { \n 'fc': 4,\n 'unitid': 3, \n 'address': 30783, \n 'quantity': 2 \n} \nmsg.topic = 'UL'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 350,
        "y": 760,
        "wires": [
            [
                "93c05f1d.a719e8"
            ]
        ]
    },
    {
        "id": "7c58fa98.8cbadc",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "U-L",
        "func": "var temp = (msg.payload.UL[1]) / 100\nmsg.payload = temp;\nmsg.payload = msg.payload.toFixed(1).replace('.', ',')\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 990,
        "y": 760,
        "wires": [
            [
                "6abcad41.5d0dbc"
            ]
        ]
    },
    {
        "id": "6abcad41.5d0dbc",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "bad4a5be.f7833",
        "order": 2,
        "width": 0,
        "height": 0,
        "name": "U-L",
        "label": "Spannung AC",
        "format": "{{msg.payload}} V",
        "layout": "row-spread",
        "x": 1170,
        "y": 760,
        "wires": []
    },
    {
        "id": "521bc6ea.793658",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "I-AC1",
        "func": "msg.payload = { \n 'fc': 4,\n 'unitid': 3, \n 'address': 30795, \n 'quantity': 2 \n} \nmsg.topic = 'IAC1'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 350,
        "y": 800,
        "wires": [
            [
                "93c05f1d.a719e8"
            ]
        ]
    },
    {
        "id": "687d59de.f9881",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "I-AC1",
        "func": "var temp = (msg.payload.IAC1[1]) / 1000\nmsg.payload = temp;\nmsg.payload = msg.payload.toFixed(2).replace('.', ',')\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 990,
        "y": 800,
        "wires": [
            [
                "1d3b6e04.b95c72"
            ]
        ]
    },
    {
        "id": "1d3b6e04.b95c72",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "bad4a5be.f7833",
        "order": 3,
        "width": 0,
        "height": 0,
        "name": "I-AC1",
        "label": "Strom AC",
        "format": "{{msg.payload}} A",
        "layout": "row-spread",
        "x": 1170,
        "y": 800,
        "wires": []
    },
    {
        "id": "e2d5bbea.55fe08",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "U-DC1",
        "func": "msg.payload = { \n 'fc': 4, \n 'unitid': 3, \n 'address': 30771, \n 'quantity': 2 \n}\nmsg.topic = 'UDC1'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 350,
        "y": 880,
        "wires": [
            [
                "93c05f1d.a719e8"
            ]
        ]
    },
    {
        "id": "bff26468.d6f66",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "I-DC1",
        "func": "msg.payload = { \n 'fc': 4,\n 'unitid': 3, \n 'address': 30769, \n 'quantity': 2 \n} \nmsg.topic = 'IDC1'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 350,
        "y": 920,
        "wires": [
            [
                "93c05f1d.a719e8"
            ]
        ]
    },
    {
        "id": "ea714aff.811b98",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "T1",
        "func": "msg.payload = { \n 'fc': 4,\n 'unitid': 3, \n 'address': 30953, \n 'quantity': 2 \n} \nmsg.topic = 'T1'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 350,
        "y": 960,
        "wires": [
            [
                "93c05f1d.a719e8"
            ]
        ]
    },
    {
        "id": "155a5486.bf1e23",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "U-DC1",
        "func": "var temp = (msg.payload.UDC1[1]) / 100\nmsg.payload = temp;\nmsg.payload = msg.payload.toFixed(1).replace('.', ',')\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 990,
        "y": 880,
        "wires": [
            [
                "d3291a12.49ac3"
            ]
        ]
    },
    {
        "id": "ad8ec242.afb5b",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "I-DC1",
        "func": "var temp = (msg.payload.IDC1[1]) / 1000\nmsg.payload = temp;\nmsg.payload = msg.payload.toFixed(2).replace('.', ',')\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 990,
        "y": 920,
        "wires": [
            [
                "1aaaa335.7ec4ed"
            ]
        ]
    },
    {
        "id": "4c72a26c.d49c6c",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "T1",
        "func": "var temp = (msg.payload.T1[1]) / 10\nmsg.payload = temp;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 990,
        "y": 960,
        "wires": [
            [
                "82f6ca5c.2ac3a"
            ]
        ]
    },
    {
        "id": "d3291a12.49ac3",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "bad4a5be.f7833",
        "order": 6,
        "width": 0,
        "height": 0,
        "name": "U-DC1",
        "label": "<font color=orange> Spannung DC",
        "format": "{{msg.payload}} V",
        "layout": "row-spread",
        "x": 1170,
        "y": 880,
        "wires": []
    },
    {
        "id": "1aaaa335.7ec4ed",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "bad4a5be.f7833",
        "order": 7,
        "width": 0,
        "height": 0,
        "name": "I-DC1",
        "label": "<font color=orange> Strom DC",
        "format": "{{msg.payload}} A",
        "layout": "row-spread",
        "x": 1170,
        "y": 920,
        "wires": []
    },
    {
        "id": "82f6ca5c.2ac3a",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "bad4a5be.f7833",
        "order": 9,
        "width": 0,
        "height": 0,
        "name": "T1",
        "label": "Temperatur",
        "format": "{{msg.payload}} °C",
        "layout": "row-spread",
        "x": 1170,
        "y": 960,
        "wires": []
    },
    {
        "id": "cee0ebbb.0980b",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "T2",
        "func": "msg.payload = { \n 'fc': 4,\n 'unitid': 3, \n 'address': 30953, \n 'quantity': 2 \n} \nmsg.topic = 'T2'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 350,
        "y": 420,
        "wires": [
            [
                "60ee51c7.35b9d8"
            ]
        ]
    },
    {
        "id": "bf2603c8.320bb",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "T2",
        "func": "var temp = (msg.payload.T2[1]) / 10\nmsg.payload = temp;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 990,
        "y": 420,
        "wires": [
            [
                "13c0b3a5.750d5c"
            ]
        ]
    },
    {
        "id": "13c0b3a5.750d5c",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "bb3073d1.32cbc8",
        "order": 3,
        "width": 0,
        "height": 0,
        "name": "T2",
        "label": "Temperatur",
        "format": "{{msg.payload}} °C",
        "layout": "row-spread",
        "x": 1170,
        "y": 420,
        "wires": []
    },
    {
        "id": "9d0e7872.eed048",
        "type": "join",
        "z": "6a66d831.fbce4",
        "name": "",
        "mode": "custom",
        "build": "object",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": false,
        "timeout": "",
        "count": "10",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "",
        "reduceFixup": "",
        "x": 810,
        "y": 160,
        "wires": [
            [
                "ba8a42fb.622ba8",
                "a5135b35.34d33",
                "a7fe19a5.754b5",
                "9a97c10c.2474f8",
                "ae76c4a9.47f878",
                "a147915c.0f6988",
                "ab2050.5c9597b",
                "7ad0b122.97a76",
                "149ad36a.3588cd",
                "bf2603c8.320bb"
            ]
        ]
    },
    {
        "id": "34ecae33.a428aa",
        "type": "join",
        "z": "6a66d831.fbce4",
        "name": "",
        "mode": "custom",
        "build": "array",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": false,
        "timeout": "",
        "count": "2",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "",
        "reduceFixup": "",
        "x": 1190,
        "y": 480,
        "wires": [
            [
                "3f77cf78.f2e02"
            ]
        ]
    },
    {
        "id": "3f77cf78.f2e02",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "Wirkungsgrad",
        "func": "var temp = (msg.payload[0] / msg.payload[1]) * 100\nmsg.payload = temp; \nmsg.payload = msg.payload.toFixed(1).replace('.', ',');\nmsg.topic = \"W2\"\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 1360,
        "y": 480,
        "wires": [
            [
                "7222c624.d349a8"
            ]
        ]
    },
    {
        "id": "ab0ab8e8.0eabd",
        "type": "function",
        "z": "6a66d831.fbce4",
        "name": "Wirkungsgrad",
        "func": "var temp = (msg.payload[0] / msg.payload[1]) * 100\nmsg.payload = temp; \nmsg.payload = msg.payload.toFixed(1).replace('.', ',');\nmsg.topic = \"W1\"\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 1360,
        "y": 1020,
        "wires": [
            [
                "9482f39b.e17b78"
            ]
        ]
    },
    {
        "id": "199ab703.b06cd1",
        "type": "join",
        "z": "6a66d831.fbce4",
        "name": "",
        "mode": "custom",
        "build": "array",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": false,
        "timeout": "",
        "count": "2",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "",
        "reduceFixup": "",
        "x": 1190,
        "y": 1020,
        "wires": [
            [
                "ab0ab8e8.0eabd"
            ]
        ]
    },
    {
        "id": "7222c624.d349a8",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "bb3073d1.32cbc8",
        "order": 4,
        "width": 0,
        "height": 0,
        "name": "Wirkungsgrad",
        "label": "Wirkungsgrad",
        "format": "{{msg.payload}} %",
        "layout": "row-spread",
        "x": 1360,
        "y": 520,
        "wires": []
    },
    {
        "id": "9482f39b.e17b78",
        "type": "ui_text",
        "z": "6a66d831.fbce4",
        "group": "bad4a5be.f7833",
        "order": 7,
        "width": 0,
        "height": 0,
        "name": "Wirkungsgrad",
        "label": "Wirkungsgrad",
        "format": "{{msg.payload}} %",
        "layout": "row-spread",
        "x": 1360,
        "y": 1060,
        "wires": []
    },
    {
        "id": "101bd986.8eac7e",
        "type": "modbus-client",
        "z": "",
        "name": "STP6.0",
        "clienttype": "tcp",
        "bufferCommands": true,
        "stateLogEnabled": false,
        "queueLogEnabled": false,
        "tcpHost": "192.168.168.50",
        "tcpPort": "502",
        "tcpType": "TPC-RTU-BUFFERED",
        "serialPort": "/dev/ttyUSB",
        "serialType": "RTU-BUFFERD",
        "serialBaudrate": "9600",
        "serialDatabits": "8",
        "serialStopbits": "1",
        "serialParity": "none",
        "serialConnectionDelay": "100",
        "unit_id": 3,
        "commandDelay": 200,
        "clientTimeout": 1000,
        "reconnectOnTimeout": true,
        "reconnectTimeout": 2000,
        "parallelUnitIdsAllowed": true
    },
    {
        "id": "40cc476b.882118",
        "type": "ui_group",
        "z": "",
        "name": "Energy Meter",
        "tab": "31d3365a.5f4a02",
        "order": 2,
        "disp": true,
        "width": "6",
        "collapse": false
    },
    {
        "id": "15792897.343e87",
        "type": "modbus-client",
        "z": "",
        "name": "SB3000",
        "clienttype": "tcp",
        "bufferCommands": true,
        "stateLogEnabled": false,
        "queueLogEnabled": false,
        "tcpHost": "192.168.168.24",
        "tcpPort": "503",
        "tcpType": "TPC-RTU-BUFFERED",
        "serialPort": "/dev/ttyUSB",
        "serialType": "RTU-BUFFERD",
        "serialBaudrate": "9600",
        "serialDatabits": "8",
        "serialStopbits": "1",
        "serialParity": "none",
        "serialConnectionDelay": "100",
        "unit_id": 3,
        "commandDelay": 200,
        "clientTimeout": 1000,
        "reconnectOnTimeout": true,
        "reconnectTimeout": 2000,
        "parallelUnitIdsAllowed": true
    },
    {
        "id": "bad4a5be.f7833",
        "type": "ui_group",
        "z": "",
        "name": "Sunny Boy",
        "tab": "31d3365a.5f4a02",
        "order": 3,
        "disp": true,
        "width": "6",
        "collapse": false
    },
    {
        "id": "bb3073d1.32cbc8",
        "type": "ui_group",
        "z": "",
        "name": "Sunny Tripower",
        "tab": "31d3365a.5f4a02",
        "order": 2,
        "disp": true,
        "width": "6",
        "collapse": false
    },
    {
        "id": "31d3365a.5f4a02",
        "type": "ui_tab",
        "z": "",
        "name": "Photovoltaik",
        "icon": "dashboard",
        "order": 2,
        "disabled": false,
        "hidden": false
    }
]

```

---

<div class="post-metadata">

### Author: ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)
#### Post date: [13 September 2020 13:43 UTC](https://discourse.nodered.org/t/adding-two-values/32784/16 "2020-09-13T13:43:13Z")

</div>

it was important that every "join" has the right value:

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/b/0ba8e55fc1d517c565f285ac8fd7b7851f73195e.png)  
at the beginning of this thread it was wrong (2), so every function node got all the values.

---

<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: [13 September 2020 18:04 UTC](https://discourse.nodered.org/t/adding-two-values/32784/17 "2020-09-13T18:04:23Z")

</div>

Its good that you have a solution - though i do suspect you will soon find an issue since your flow doesnt calculate int32 values (you only take the hi WORD in msg.payload[1]) where as the `buffer parser` takes care of number type conversion from a 2 WORDS to signed int 32 bit. As soon as any of your numbers go over `32767` will have incorrect values in your flow. 🤷‍♂️

The reason my flow didnt work for you is likely due to the byte swapping or me selecting the `int32 (le)` data types (you only needed to tweak them as I documented on the screen shot).

---

<div class="post-metadata">

### Author: ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)
#### Post date: [14 September 2020 00:26 UTC](https://discourse.nodered.org/t/adding-two-values/32784/18 "2020-09-14T00:26:56Z")

</div>

Hi Becker,

Steve is right. I searched also on the SMA website and it seems your devices use 32bit values and need to be parsed the correct way with Steve's solution.

I guess that explains why when we were trying to request for a value, [in your other topic](https://discourse.nodered.org/t/query-modbus-registers-for-sma-inverter-without-crash/32788/12), with **quantity 1** you were getting an error.

---

<div class="post-metadata">

### Author: ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)
#### Post date: [14 September 2020 05:36 UTC](https://discourse.nodered.org/t/adding-two-values/32784/19 "2020-09-14T05:36:38Z")

</div>

yes, but I works fine.

I don´t understand the grouped registers with the buffer parser, its too complicated for me. 😥

> [@Steve-Mcl](#):
>
> As soon as any of your numbers go over `32767`

it works:  
 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/2/b2653025aa6e922930d2b9537afc7b3ae574946c.png)

32bit:  
 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/c/7c4304e37fc6a46e4ca4aa2bb449d36b1da37d7a.png)  
=trash

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

---

<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: [14 September 2020 06:16 UTC](https://discourse.nodered.org/t/adding-two-values/32784/20 "2020-09-14T06:16:36Z")

</div>

> [@Steve-Mcl](#):
>
> As soon as any of your numbers go over `32767`

Sorry I assumed signed values.

When any of the values go above 16bit max 65535, the values in your node-red flow will be incorrect as you are only using element 1. The buffer parser takes care to correctly convert the 2 values into 32bit numbers.

[Next page](https://discourse.nodered.org/t/adding-two-values/32784.md?page=2)
