# Modbus Solaredge Inverters -\> Floating point

**URL:** https://discourse.nodered.org/t/modbus-solaredge-inverters-floating-point/33701
**Category:** General
**Created:** [3 October 2020 15:33 UTC](https://discourse.nodered.org/t/modbus-solaredge-inverters-floating-point/33701 "2020-10-03T15:33:14Z")
**Posts on this page:** 8
**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: [3 October 2020 15:33 UTC](https://discourse.nodered.org/t/modbus-solaredge-inverters-floating-point/33701/1 "2020-10-03T15:33:14Z")

</div>

Hello,  
last week I finished my SMA Modbus Query.  
Today a friend asked me if we can query his Solaredge Inverter.  
It´s the same way with Modbus Getter + Buffer Parser (as @Steve-Mcl showed me):

```auto
[
    {
        "id": "2127eb3c.6814d4",
        "type": "tab",
        "label": "Modbus",
        "disabled": false,
        "info": ""
    },
    {
        "id": "19146a4b.e60106",
        "type": "inject",
        "z": "2127eb3c.6814d4",
        "name": "",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "repeat": "5",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "x": 110,
        "y": 40,
        "wires": [
            [
                "4b847dc3.be22c4"
            ]
        ]
    },
    {
        "id": "4b847dc3.be22c4",
        "type": "modbus-getter",
        "z": "2127eb3c.6814d4",
        "name": "40072 - 40084 (-1)",
        "showStatusActivities": false,
        "showErrors": false,
        "logIOActivities": false,
        "unitid": "1",
        "dataType": "HoldingRegister",
        "adr": "40071",
        "quantity": "14",
        "server": "c92ba865.93cb78",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 290,
        "y": 40,
        "wires": [
            [
                "7a31131f.01636c"
            ],
            []
        ]
    },
    {
        "id": "7a31131f.01636c",
        "type": "buffer-parser",
        "z": "2127eb3c.6814d4",
        "name": "",
        "data": "responseBuffer.buffer",
        "dataType": "msg",
        "specification": "spec",
        "specificationType": "ui",
        "items": [
            {
                "type": "uint16be",
                "name": "Iges",
                "offset": 0,
                "length": 1,
                "offsetbit": 0,
                "scale": 0.01,
                "mask": ""
            },
            {
                "type": "uint16be",
                "name": "IL1",
                "offset": 2,
                "length": 1,
                "offsetbit": 0,
                "scale": 0.01,
                "mask": ""
            },
            {
                "type": "uint16be",
                "name": "IL2",
                "offset": 4,
                "length": 1,
                "offsetbit": 0,
                "scale": 0.01,
                "mask": ""
            },
            {
                "type": "uint16be",
                "name": "IL3",
                "offset": 6,
                "length": 1,
                "offsetbit": 0,
                "scale": 0.01,
                "mask": ""
            },
            {
                "type": "int16be",
                "name": "Is",
                "offset": 8,
                "length": 1,
                "offsetbit": 0,
                "scale": 1,
                "mask": ""
            },
            {
                "type": "uint16be",
                "name": "UL1-L2",
                "offset": 10,
                "length": 1,
                "offsetbit": 0,
                "scale": 0.1,
                "mask": ""
            },
            {
                "type": "uint16be",
                "name": "UL2-L3",
                "offset": 12,
                "length": 1,
                "offsetbit": 0,
                "scale": 0.1,
                "mask": ""
            },
            {
                "type": "uint16be",
                "name": "UL3-L1",
                "offset": 14,
                "length": 1,
                "offsetbit": 0,
                "scale": 0.1,
                "mask": ""
            },
            {
                "type": "uint16be",
                "name": "UL1",
                "offset": 16,
                "length": 1,
                "offsetbit": 0,
                "scale": 0.1,
                "mask": ""
            },
            {
                "type": "uint16be",
                "name": "UL2",
                "offset": 18,
                "length": 1,
                "offsetbit": 0,
                "scale": 0.1,
                "mask": ""
            },
            {
                "type": "uint16be",
                "name": "UL3",
                "offset": 20,
                "length": 1,
                "offsetbit": 0,
                "scale": 0.1,
                "mask": ""
            },
            {
                "type": "int16be",
                "name": "Us",
                "offset": 22,
                "length": 1,
                "offsetbit": 0,
                "scale": 1,
                "mask": ""
            },
            {
                "type": "int16be",
                "name": "PAC",
                "offset": 24,
                "length": 1,
                "offsetbit": 0,
                "scale": 1,
                "mask": ""
            },
            {
                "type": "int16be",
                "name": "PACs",
                "offset": 26,
                "length": 1,
                "offsetbit": 0,
                "scale": 1,
                "mask": ""
            }
        ],
        "swap1": "",
        "swap2": "",
        "swap3": "",
        "swap1Type": "swap",
        "swap2Type": "swap",
        "swap3Type": "swap",
        "msgProperty": "payload",
        "msgPropertyType": "str",
        "resultType": "keyvalue",
        "resultTypeType": "output",
        "multipleResult": false,
        "setTopic": true,
        "x": 490,
        "y": 40,
        "wires": [
            [
                "f3d16609.f976a8",
                "1b0d5f97.9f644",
                "1e7a0541.83c83b",
                "9127c82a.f2ab38",
                "2f0cb353.8381ec",
                "d77664d1.6c5658",
                "a7ecd9a9.463568",
                "66e6ae2d.916fb",
                "ad1404c5.aaf398",
                "fb87d1d2.8ea21",
                "81483328.8b80d"
            ]
        ]
    },
    {
        "id": "ad1404c5.aaf398",
        "type": "ui_text",
        "z": "2127eb3c.6814d4",
        "group": "fe019157.1eea2",
        "order": 5,
        "width": 0,
        "height": 0,
        "name": "Leistung AC",
        "label": "Leistung AC",
        "format": "{{msg.payload.PAC}} W",
        "layout": "row-spread",
        "x": 890,
        "y": 40,
        "wires": []
    },
    {
        "id": "8baa2487.7d8968",
        "type": "modbus-getter",
        "z": "2127eb3c.6814d4",
        "name": "40206 - 40209",
        "showStatusActivities": false,
        "showErrors": false,
        "logIOActivities": false,
        "unitid": "1",
        "dataType": "HoldingRegister",
        "adr": "40206",
        "quantity": "4",
        "server": "c92ba865.93cb78",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 280,
        "y": 640,
        "wires": [
            [
                "e82f5f3.bd01aa"
            ],
            []
        ]
    },
    {
        "id": "e82f5f3.bd01aa",
        "type": "buffer-parser",
        "z": "2127eb3c.6814d4",
        "name": "",
        "data": "responseBuffer.buffer",
        "dataType": "msg",
        "specification": "spec",
        "specificationType": "ui",
        "items": [
            {
                "type": "int16be",
                "name": "Preal",
                "offset": 0,
                "length": 1,
                "offsetbit": 0,
                "scale": 1,
                "mask": ""
            },
            {
                "type": "int16be",
                "name": "P1",
                "offset": 2,
                "length": 1,
                "offsetbit": 0,
                "scale": 1,
                "mask": ""
            },
            {
                "type": "int16be",
                "name": "P2",
                "offset": 4,
                "length": 1,
                "offsetbit": 0,
                "scale": 1,
                "mask": ""
            },
            {
                "type": "int16be",
                "name": "P3",
                "offset": 6,
                "length": 1,
                "offsetbit": 0,
                "scale": 1,
                "mask": ""
            }
        ],
        "swap1": "",
        "swap2": "",
        "swap3": "",
        "swap1Type": "swap",
        "swap2Type": "swap",
        "swap3Type": "swap",
        "msgProperty": "payload",
        "msgPropertyType": "str",
        "resultType": "keyvalue",
        "resultTypeType": "output",
        "multipleResult": false,
        "setTopic": true,
        "x": 490,
        "y": 640,
        "wires": [
            [
                "24c741da.df716e",
                "5c52c195.e8155",
                "dc730127.c3f32",
                "f1f782e3.ba0d6"
            ]
        ]
    },
    {
        "id": "24c741da.df716e",
        "type": "ui_text",
        "z": "2127eb3c.6814d4",
        "group": "fe019157.1eea2",
        "order": 1,
        "width": 0,
        "height": 0,
        "name": "Leistung Hausanschluss",
        "label": "Leistung Hausanschluss",
        "format": "{{msg.payload.Preal}} W",
        "layout": "row-spread",
        "x": 930,
        "y": 640,
        "wires": []
    },
    {
        "id": "f3d16609.f976a8",
        "type": "modbus-getter",
        "z": "2127eb3c.6814d4",
        "name": "40097 40102 (-1)",
        "showStatusActivities": false,
        "showErrors": false,
        "logIOActivities": false,
        "unitid": "1",
        "dataType": "HoldingRegister",
        "adr": "40096",
        "quantity": "6",
        "server": "c92ba865.93cb78",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 290,
        "y": 380,
        "wires": [
            [
                "db80a042.41df7"
            ],
            []
        ]
    },
    {
        "id": "db80a042.41df7",
        "type": "buffer-parser",
        "z": "2127eb3c.6814d4",
        "name": "responseBuffer.buffer",
        "data": "payload",
        "dataType": "msg",
        "specification": "spec",
        "specificationType": "ui",
        "items": [
            {
                "type": "uint16be",
                "name": "IDC",
                "offset": 0,
                "length": 1,
                "offsetbit": 0,
                "scale": 1,
                "mask": ""
            },
            {
                "type": "int16be",
                "name": "IDCs",
                "offset": 2,
                "length": 1,
                "offsetbit": 0,
                "scale": 1,
                "mask": ""
            },
            {
                "type": "uint16be",
                "name": "UDC",
                "offset": 4,
                "length": 1,
                "offsetbit": 0,
                "scale": 1,
                "mask": ""
            },
            {
                "type": "int16be",
                "name": "UDCs",
                "offset": 6,
                "length": 1,
                "offsetbit": 0,
                "scale": 1,
                "mask": ""
            },
            {
                "type": "int16be",
                "name": "PDC",
                "offset": 8,
                "length": 1,
                "offsetbit": 0,
                "scale": 1,
                "mask": ""
            },
            {
                "type": "int16be",
                "name": "PDCs",
                "offset": 10,
                "length": 1,
                "offsetbit": 0,
                "scale": 1,
                "mask": ""
            }
        ],
        "swap1": "",
        "swap2": "",
        "swap3": "",
        "swap1Type": "swap",
        "swap2Type": "swap",
        "swap3Type": "swap",
        "msgProperty": "payload",
        "msgPropertyType": "str",
        "resultType": "keyvalue",
        "resultTypeType": "output",
        "multipleResult": false,
        "setTopic": true,
        "x": 520,
        "y": 380,
        "wires": [
            [
                "8baa2487.7d8968",
                "29a8657d.44b83a",
                "c9bb3ae3.00b3c8",
                "fc90172e.45ee38",
                "668e64a7.e4191c",
                "af5050b8.104d7",
                "12cef69a.0cfee9"
            ]
        ]
    },
    {
        "id": "29a8657d.44b83a",
        "type": "ui_text",
        "z": "2127eb3c.6814d4",
        "group": "f7b812c8.ec053",
        "order": 1,
        "width": 0,
        "height": 0,
        "name": "Leistung DC",
        "label": "Leistung DC",
        "format": "{{msg.payload.PDC}} W",
        "layout": "row-spread",
        "x": 890,
        "y": 380,
        "wires": []
    },
    {
        "id": "5c52c195.e8155",
        "type": "ui_text",
        "z": "2127eb3c.6814d4",
        "group": "fe019157.1eea2",
        "order": 2,
        "width": 0,
        "height": 0,
        "name": "Leistung L1",
        "label": "Leistung L1",
        "format": "{{msg.payload.P1}} W",
        "layout": "row-spread",
        "x": 890,
        "y": 680,
        "wires": []
    },
    {
        "id": "dc730127.c3f32",
        "type": "ui_text",
        "z": "2127eb3c.6814d4",
        "group": "fe019157.1eea2",
        "order": 3,
        "width": 0,
        "height": 0,
        "name": "Leistung L2",
        "label": "Leistung L2",
        "format": "{{msg.payload.P2}} W",
        "layout": "row-spread",
        "x": 890,
        "y": 720,
        "wires": []
    },
    {
        "id": "f1f782e3.ba0d6",
        "type": "ui_text",
        "z": "2127eb3c.6814d4",
        "group": "fe019157.1eea2",
        "order": 4,
        "width": 0,
        "height": 0,
        "name": "Leistung L3",
        "label": "Leistung L3",
        "format": "{{msg.payload.P3}} W",
        "layout": "row-spread",
        "x": 890,
        "y": 760,
        "wires": []
    },
    {
        "id": "b5f04be0.2747a8",
        "type": "ui_text",
        "z": "2127eb3c.6814d4",
        "group": "c4de61b1.27c67",
        "order": 7,
        "width": 0,
        "height": 0,
        "name": "Gesamt Strom",
        "label": "Gesamt Strom",
        "format": "{{msg.payload}} A",
        "layout": "row-spread",
        "x": 900,
        "y": 80,
        "wires": []
    },
    {
        "id": "4d083e9d.662f",
        "type": "ui_text",
        "z": "2127eb3c.6814d4",
        "group": "c4de61b1.27c67",
        "order": 4,
        "width": 0,
        "height": 0,
        "name": "Strom L1",
        "label": "Strom L1",
        "format": "{{msg.payload}} A",
        "layout": "row-spread",
        "x": 880,
        "y": 120,
        "wires": []
    },
    {
        "id": "2db805ab.5260fa",
        "type": "ui_text",
        "z": "2127eb3c.6814d4",
        "group": "c4de61b1.27c67",
        "order": 5,
        "width": 0,
        "height": 0,
        "name": "Strom L2",
        "label": "Strom L2",
        "format": "{{msg.payload}} A",
        "layout": "row-spread",
        "x": 880,
        "y": 160,
        "wires": []
    },
    {
        "id": "19cd1999.1ad9a6",
        "type": "ui_text",
        "z": "2127eb3c.6814d4",
        "group": "c4de61b1.27c67",
        "order": 6,
        "width": 0,
        "height": 0,
        "name": "Strom L3",
        "label": "Strom L3",
        "format": "{{msg.payload}} A",
        "layout": "row-spread",
        "x": 880,
        "y": 200,
        "wires": []
    },
    {
        "id": "1b0d5f97.9f644",
        "type": "function",
        "z": "2127eb3c.6814d4",
        "name": "runden",
        "func": "var temp = (msg.payload.Iges)\nmsg.payload = temp;\nmsg.payload = msg.payload.toFixed(2).replace('.', ',');\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 700,
        "y": 80,
        "wires": [
            [
                "b5f04be0.2747a8"
            ]
        ]
    },
    {
        "id": "9127c82a.f2ab38",
        "type": "function",
        "z": "2127eb3c.6814d4",
        "name": "runden",
        "func": "var temp = (msg.payload.IL2)\nmsg.payload = temp;\nmsg.payload = msg.payload.toFixed(2).replace('.', ',');\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 700,
        "y": 160,
        "wires": [
            [
                "2db805ab.5260fa"
            ]
        ]
    },
    {
        "id": "2f0cb353.8381ec",
        "type": "function",
        "z": "2127eb3c.6814d4",
        "name": "runden",
        "func": "var temp = (msg.payload.IL3)\nmsg.payload = temp;\nmsg.payload = msg.payload.toFixed(2).replace('.', ',');\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 700,
        "y": 200,
        "wires": [
            [
                "19cd1999.1ad9a6"
            ]
        ]
    },
    {
        "id": "1e7a0541.83c83b",
        "type": "function",
        "z": "2127eb3c.6814d4",
        "name": "runden",
        "func": "var temp = (msg.payload.IL1)\nmsg.payload = temp;\nmsg.payload = msg.payload.toFixed(2).replace('.', ',');\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 700,
        "y": 120,
        "wires": [
            [
                "4d083e9d.662f"
            ]
        ]
    },
    {
        "id": "bdd904c1.172508",
        "type": "ui_text",
        "z": "2127eb3c.6814d4",
        "group": "c4de61b1.27c67",
        "order": 1,
        "width": 0,
        "height": 0,
        "name": "Spannung L1",
        "label": "<font color=brown> Spannung L1",
        "format": "{{msg.payload}} V",
        "layout": "row-spread",
        "x": 900,
        "y": 240,
        "wires": []
    },
    {
        "id": "a2343877.49dc28",
        "type": "ui_text",
        "z": "2127eb3c.6814d4",
        "group": "c4de61b1.27c67",
        "order": 3,
        "width": 0,
        "height": 0,
        "name": "Spannung L3",
        "label": "<font color=grey> Spannung L3",
        "format": "{{msg.payload}} V",
        "layout": "row-spread",
        "x": 900,
        "y": 320,
        "wires": []
    },
    {
        "id": "b5da9954.b979d8",
        "type": "ui_text",
        "z": "2127eb3c.6814d4",
        "group": "c4de61b1.27c67",
        "order": 2,
        "width": 0,
        "height": 0,
        "name": "Spannung L2",
        "label": "Spannung L2",
        "format": "{{msg.payload}} V",
        "layout": "row-spread",
        "x": 900,
        "y": 280,
        "wires": []
    },
    {
        "id": "d77664d1.6c5658",
        "type": "function",
        "z": "2127eb3c.6814d4",
        "name": "runden",
        "func": "var temp = (msg.payload.UL1)\nmsg.payload = temp;\nmsg.payload = msg.payload.toFixed(2).replace('.', ',');\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 700,
        "y": 240,
        "wires": [
            [
                "bdd904c1.172508"
            ]
        ]
    },
    {
        "id": "a7ecd9a9.463568",
        "type": "function",
        "z": "2127eb3c.6814d4",
        "name": "runden",
        "func": "var temp = (msg.payload.UL2)\nmsg.payload = temp;\nmsg.payload = msg.payload.toFixed(2).replace('.', ',');\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 700,
        "y": 280,
        "wires": [
            [
                "b5da9954.b979d8"
            ]
        ]
    },
    {
        "id": "66e6ae2d.916fb",
        "type": "function",
        "z": "2127eb3c.6814d4",
        "name": "runden",
        "func": "var temp = (msg.payload.UL3)\nmsg.payload = temp;\nmsg.payload = msg.payload.toFixed(2).replace('.', ',');\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 700,
        "y": 320,
        "wires": [
            [
                "a2343877.49dc28"
            ]
        ]
    },
    {
        "id": "fb87d1d2.8ea21",
        "type": "debug",
        "z": "2127eb3c.6814d4",
        "name": "",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "x": 310,
        "y": 120,
        "wires": []
    },
    {
        "id": "c9bb3ae3.00b3c8",
        "type": "ui_text",
        "z": "2127eb3c.6814d4",
        "group": "f7b812c8.ec053",
        "order": 3,
        "width": 0,
        "height": 0,
        "name": "Spannung DC",
        "label": "Spannung DC",
        "format": "{{msg.payload.UDC}}",
        "layout": "row-spread",
        "x": 900,
        "y": 460,
        "wires": []
    },
    {
        "id": "fc90172e.45ee38",
        "type": "ui_text",
        "z": "2127eb3c.6814d4",
        "group": "f7b812c8.ec053",
        "order": 4,
        "width": 0,
        "height": 0,
        "name": "Spannung DC Faktor",
        "label": "Spannung DC Faktor",
        "format": "{{msg.payload.UDCs}}",
        "layout": "row-spread",
        "x": 920,
        "y": 500,
        "wires": []
    },
    {
        "id": "668e64a7.e4191c",
        "type": "ui_text",
        "z": "2127eb3c.6814d4",
        "group": "f7b812c8.ec053",
        "order": 5,
        "width": 0,
        "height": 0,
        "name": "Strom DC",
        "label": "Strom DC",
        "format": "{{msg.payload.IDC}} A",
        "layout": "row-spread",
        "x": 880,
        "y": 540,
        "wires": []
    },
    {
        "id": "12cef69a.0cfee9",
        "type": "ui_text",
        "z": "2127eb3c.6814d4",
        "group": "f7b812c8.ec053",
        "order": 6,
        "width": 0,
        "height": 0,
        "name": "Strom DC Faktor",
        "label": "Strom DC Faktor",
        "format": "{{msg.payload.IDCs}}",
        "layout": "row-spread",
        "x": 910,
        "y": 580,
        "wires": []
    },
    {
        "id": "af5050b8.104d7",
        "type": "ui_text",
        "z": "2127eb3c.6814d4",
        "group": "f7b812c8.ec053",
        "order": 2,
        "width": 0,
        "height": 0,
        "name": "Leistung DC Faktor",
        "label": "Leistung DC Faktor",
        "format": "{{msg.payload.PDCs}}",
        "layout": "row-spread",
        "x": 910,
        "y": 420,
        "wires": []
    },
    {
        "id": "81483328.8b80d",
        "type": "ui_text",
        "z": "2127eb3c.6814d4",
        "group": "fe019157.1eea2",
        "order": 6,
        "width": 0,
        "height": 0,
        "name": "Leistung AC Faktor",
        "label": "Leistung AC Faktor",
        "format": "{{msg.payload.PACs}}",
        "layout": "row-spread",
        "x": 710,
        "y": 20,
        "wires": []
    },
    {
        "id": "c92ba865.93cb78",
        "type": "modbus-client",
        "z": "",
        "name": "SolarEdge",
        "clienttype": "tcp",
        "bufferCommands": true,
        "stateLogEnabled": false,
        "queueLogEnabled": false,
        "tcpHost": "192.168.1.187",
        "tcpPort": "502",
        "tcpType": "TPC-RTU-BUFFERED",
        "serialPort": "/dev/ttyUSB",
        "serialType": "RTU-BUFFERD",
        "serialBaudrate": "9600",
        "serialDatabits": "8",
        "serialStopbits": "1",
        "serialParity": "none",
        "serialConnectionDelay": "100",
        "unit_id": "1",
        "commandDelay": "200",
        "clientTimeout": "1000",
        "reconnectOnTimeout": true,
        "reconnectTimeout": "2000",
        "parallelUnitIdsAllowed": true
    },
    {
        "id": "fe019157.1eea2",
        "type": "ui_group",
        "z": "",
        "name": "Sensoren (1)",
        "tab": "e0ab68c7.17d7f8",
        "disp": true,
        "width": "6",
        "collapse": false
    },
    {
        "id": "f7b812c8.ec053",
        "type": "ui_group",
        "z": "",
        "name": "DC Werte",
        "tab": "e0ab68c7.17d7f8",
        "order": 3,
        "disp": true,
        "width": "6",
        "collapse": false
    },
    {
        "id": "c4de61b1.27c67",
        "type": "ui_group",
        "z": "",
        "name": "Sensoren (2)",
        "tab": "e0ab68c7.17d7f8",
        "order": 2,
        "disp": true,
        "width": "6",
        "collapse": false
    },
    {
        "id": "e0ab68c7.17d7f8",
        "type": "ui_tab",
        "z": "",
        "name": "Solaredge",
        "icon": "dashboard",
        "order": 1,
        "disabled": false,
        "hidden": false
    }
]

```

but there is one hitch, the scale factor:

 ![gleitkomma](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/1/715ea1f64406c853fb86520faa5479c5444c55a4.png)  
the point changes dynamically

 ![tabelle](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/a/ea9da913adb7830f8ce3a8c1e04fa3f08e6dcc93.png) ![Dashboard](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/4/84e8496212195ea7317bb070eaab54256845f1ec.png) ![Dashboard2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/b/8b2b19ebf52b69841e84e3ba13413d0ad4766488.png)

Now is the question: How can I use the value in a function to correct the actual value dynamically.

Greetings

---

<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: [3 October 2020 16:39 UTC](https://discourse.nodered.org/t/modbus-solaredge-inverters-floating-point/33701/2 "2020-10-03T16:39:46Z")

</div>

Hi Becker,

use a Join node after the Buffer parsers as suggested in your previous thread.

> [@Modbus query SMA Inverter - the right way](https://discourse.nodered.org/t/modbus-query-sma-inverter-the-right-way/33400/19):
>
> basically i was just going to suggest, adding a Join node after the buffer parsers in order to wait and merge the 11 separate parser replies into one merged Object .. so you'll have all your values simultaneously available for calculations. This way you can avoid the separate joins and makes the flow a little cleaner. maybe wink [image] ps. I didnt have your new flow imported at the time and my post was rushed so i deleted. and also you had other more important things to sort out…

and once you have all the values simultaneously available use javascript's **Math.pow()** in a function to do the conversion.

> **[Math.pow() - JavaScript | MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow)**
>
> The Math.pow() static method returns the value of a base raised to a power. That is

---

<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: [3 October 2020 17:47 UTC](https://discourse.nodered.org/t/modbus-solaredge-inverters-floating-point/33701/3 "2020-10-03T17:47:55Z")

</div>

Have you updated buffer parser to latest version V1.4.0?

It now has a scale property for each item...

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

From the built in documentation...

> - scale A multiplier to apply to the final value. e.g. entering 0.1 will divide the final value by 10. Entering 10 will multiply the final value by 10

so each item you need scaling, you can do it without extra nodes.

edit...  
After re-reading - I may have missed something.  
Are you saying this "scale factor" is dynamic as in "it changes while the invertor runs"?

---

<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: [3 October 2020 18:10 UTC](https://discourse.nodered.org/t/modbus-solaredge-inverters-floating-point/33701/4 "2020-10-03T18:10:54Z")

</div>

> [@Steve-Mcl](#):
>
> Are you saying this "scale factor" is dynamic as in "it changes while the invertor runs"?

It seems like it .. from his modbus address table there is a SF (scale factor) for each value  
so most probably they need a function after a Join node with something like

```auto
msg.payload = msg.payload.PDC * Math.pow(10, msg.payload.PDCs)

```

[EDIT] looking at each of your buffer parser configuration maybe you dont need the Join node after all .. because both the Value and the Scale Factor are read simultaneously by each buffer parser. Just the function will do for this dynamic calculation.

---

<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: [3 October 2020 18:34 UTC](https://discourse.nodered.org/t/modbus-solaredge-inverters-floating-point/33701/5 "2020-10-03T18:34:40Z")

</div>

thanks, I tried a lot with Math.pow before your last post.  
I get the Factor, but if I multiply with "PDC" (\_\_\_W \* 0,01) i always get NaN:

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/3/d38caa80b24ecf440cd4922180b1a1aa86aaba96.jpeg)

I tried also "PDC", [PDC], ["PDC"] 😤

@Steve-Mcl the scale factore changes every minute or second

edit:

```auto
msg.payload = msg.payload.PDC * Math.pow(10, msg.payload.PDCs)

```

works 🥴 😬

---

<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: [3 October 2020 18:40 UTC](https://discourse.nodered.org/t/modbus-solaredge-inverters-floating-point/33701/6 "2020-10-03T18:40:58Z")

</div>

yes .. there was mistake in your right function (screenshot)  
["PDC"] doesnt get the value .. msg.payload["PDC"] would with that systax 😉

---

<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: [3 October 2020 19:00 UTC](https://discourse.nodered.org/t/modbus-solaredge-inverters-floating-point/33701/7 "2020-10-03T19:00:18Z")

</div>

![2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/4/44ea5f8eeb503e0bd1054e86ea0ffce6b9a20fbb.png)

🥳

the Inverter needs ~100W from the Accu for doing his work.

accu 48V -\> Inverter 800V

I got a HV-Accu with 350V and a separate inverter... but firmware is still missing 🤪

---

<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: [17 October 2020 19:00 UTC](https://discourse.nodered.org/t/modbus-solaredge-inverters-floating-point/33701/8 "2020-10-17T19:00:21Z")

</div>

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