maybe you can tell me why I can not make a formula without "join" node, here is the flow:
[
{
"id": "be7272e9.9bf7b8",
"type": "tab",
"label": "Batterie",
"disabled": false,
"info": ""
},
{
"id": "3890d21.274caae",
"type": "inject",
"z": "be7272e9.9bf7b8",
"name": "5s Abfrage",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "5",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 130,
"y": 80,
"wires": [
[
"55af0f5b.836618"
]
]
},
{
"id": "55af0f5b.836618",
"type": "modbus-getter",
"z": "be7272e9.9bf7b8",
"name": "30843 - 30852",
"showStatusActivities": false,
"showErrors": false,
"logIOActivities": false,
"unitid": "3",
"dataType": "InputRegister",
"adr": "30843",
"quantity": "10",
"server": "8d503b14.f14ac8",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": false,
"keepMsgProperties": false,
"x": 340,
"y": 80,
"wires": [
[
"24b3a002.d81888"
],
[]
]
},
{
"id": "24b3a002.d81888",
"type": "buffer-parser",
"z": "be7272e9.9bf7b8",
"name": "",
"data": "responseBuffer.buffer",
"dataType": "msg",
"specification": "spec",
"specificationType": "ui",
"items": [
{
"type": "int32be",
"name": "BattA",
"offset": 0,
"length": 1,
"offsetbit": 0,
"scale": 0.001,
"mask": ""
},
{
"type": "uint32be",
"name": "SoC",
"offset": 4,
"length": 1,
"offsetbit": 0,
"scale": 1,
"mask": ""
},
{
"type": "uint32be",
"name": "SoH",
"offset": 8,
"length": 1,
"offsetbit": 0,
"scale": 1,
"mask": ""
},
{
"type": "int32be",
"name": "BattT",
"offset": 12,
"length": 1,
"offsetbit": 0,
"scale": 0.1,
"mask": ""
},
{
"type": "uint32be",
"name": "BattV",
"offset": 16,
"length": 1,
"offsetbit": 0,
"scale": 0.01,
"mask": ""
}
],
"swap1": "",
"swap2": "",
"swap3": "",
"swap1Type": "swap",
"swap2Type": "swap",
"swap3Type": "swap",
"msgProperty": "payload",
"msgPropertyType": "str",
"resultType": "keyvalue",
"resultTypeType": "output",
"multipleResult": false,
"setTopic": true,
"x": 570,
"y": 80,
"wires": [
[
"3f876e04.e9cbf2",
"a7642778.21ef4",
"c73fb64f.fea6a8",
"1157fdc7.cccc4a",
"24ab137d.291274",
"f7f34f80.fe991"
]
]
},
{
"id": "fa7304ff.0f313",
"type": "ui_text",
"z": "be7272e9.9bf7b8",
"group": "a4ae5bd.929ca28",
"order": 2,
"width": 0,
"height": 0,
"name": "BYD Spannung",
"label": "Spannung",
"format": "{{msg.payload}} V",
"layout": "row-spread",
"x": 1120,
"y": 120,
"wires": []
},
{
"id": "469f11a7.915cc8",
"type": "ui_text",
"z": "be7272e9.9bf7b8",
"group": "a4ae5bd.929ca28",
"order": 3,
"width": 0,
"height": 0,
"name": "BYD Strom",
"label": "Strom ",
"format": "{{msg.payload}} A",
"layout": "row-spread",
"x": 1110,
"y": 160,
"wires": []
},
{
"id": "cc5afbaf.b0cfb8",
"type": "ui_text",
"z": "be7272e9.9bf7b8",
"group": "a4ae5bd.929ca28",
"order": 6,
"width": 0,
"height": 0,
"name": "SoH",
"label": "Kapazität",
"format": "{{msg.payload}} %",
"layout": "row-spread",
"x": 1090,
"y": 240,
"wires": []
},
{
"id": "3ec936b3.624aa2",
"type": "ui_text",
"z": "be7272e9.9bf7b8",
"group": "a4ae5bd.929ca28",
"order": 5,
"width": 0,
"height": 0,
"name": "BYD Temperatur",
"label": "Temperatur",
"format": "{{msg.payload}} °C",
"layout": "row-spread",
"x": 1130,
"y": 200,
"wires": []
},
{
"id": "3f876e04.e9cbf2",
"type": "modbus-getter",
"z": "be7272e9.9bf7b8",
"name": "30775 - 30776",
"showStatusActivities": false,
"showErrors": false,
"logIOActivities": false,
"unitid": "3",
"dataType": "InputRegister",
"adr": "30775",
"quantity": "2",
"server": "8d503b14.f14ac8",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": false,
"keepMsgProperties": false,
"x": 340,
"y": 320,
"wires": [
[
"786a5e09.e964d8"
],
[]
]
},
{
"id": "786a5e09.e964d8",
"type": "buffer-parser",
"z": "be7272e9.9bf7b8",
"name": "",
"data": "responseBuffer.buffer",
"dataType": "msg",
"specification": "spec",
"specificationType": "ui",
"items": [
{
"type": "int32be",
"name": "PAC3",
"offset": 0,
"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": 570,
"y": 320,
"wires": [
[
"c534e4d0.2a2868",
"6b2fe76f.cde508"
]
]
},
{
"id": "398184ff.974bfc",
"type": "ui_text",
"z": "be7272e9.9bf7b8",
"group": "e035cd18.8c0fd8",
"order": 1,
"width": 0,
"height": 0,
"name": "SBS Leistung AC",
"label": "Leistung AC",
"format": "{{msg.payload}} W",
"layout": "row-spread",
"x": 1090,
"y": 320,
"wires": []
},
{
"id": "a7642778.21ef4",
"type": "function",
"z": "be7272e9.9bf7b8",
"name": "SoC",
"func": "msg.payload = msg.payload.SoC\nmsg.topic = \"SoC\"\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 790,
"y": 80,
"wires": [
[
"c0ca0117.42f7"
]
]
},
{
"id": "c73fb64f.fea6a8",
"type": "function",
"z": "be7272e9.9bf7b8",
"name": "Batt V",
"func": "msg.payload = msg.payload.BattV\nmsg.topic = \"BattV\"\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 790,
"y": 120,
"wires": [
[
"96c7fa66.435148",
"ee79b693.bcc4e8"
]
]
},
{
"id": "1157fdc7.cccc4a",
"type": "function",
"z": "be7272e9.9bf7b8",
"name": "Batt A",
"func": "msg.payload = msg.payload.BattA\nmsg.topic = \"BattA\"\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 790,
"y": 160,
"wires": [
[
"96c7fa66.435148",
"ebdb2054.bc52e8"
]
]
},
{
"id": "24ab137d.291274",
"type": "function",
"z": "be7272e9.9bf7b8",
"name": "Batt T",
"func": "msg.payload = msg.payload.BattT\nmsg.topic = \"BattT\"\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 790,
"y": 200,
"wires": [
[
"3ec936b3.624aa2"
]
]
},
{
"id": "f7f34f80.fe991",
"type": "function",
"z": "be7272e9.9bf7b8",
"name": "SoH",
"func": "msg.payload = msg.payload.SoH\nmsg.topic = \"SoH\"\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 790,
"y": 240,
"wires": [
[
"cc5afbaf.b0cfb8"
]
]
},
{
"id": "c534e4d0.2a2868",
"type": "function",
"z": "be7272e9.9bf7b8",
"name": "PAC SBS2.5",
"func": "msg.payload = msg.payload.PAC3\nmsg.topic = \"PAC3\"\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 810,
"y": 320,
"wires": [
[
"398184ff.974bfc",
"6cdf85eb.70da6c"
]
]
},
{
"id": "96c7fa66.435148",
"type": "join",
"z": "be7272e9.9bf7b8",
"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": "",
"reduceFixup": "",
"x": 1350,
"y": 140,
"wires": [
[
"e3ceb624.b07098",
"8dfa6082.02ded"
]
]
},
{
"id": "e3ceb624.b07098",
"type": "function",
"z": "be7272e9.9bf7b8",
"name": "Leistung DC",
"func": "var temp = (msg.payload[\"BattV\"] * msg.payload[\"BattA\"]);\nvar temp2 = parseFloat(temp.toFixed(0));\nmsg.payload = temp2; \nmsg.topic = \"BattP\";\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1530,
"y": 140,
"wires": [
[
"bc0ec570.681ff",
"6cdf85eb.70da6c"
]
]
},
{
"id": "bc0ec570.681ff",
"type": "ui_text",
"z": "be7272e9.9bf7b8",
"group": "a4ae5bd.929ca28",
"order": 4,
"width": 0,
"height": 0,
"name": "Leistung DC",
"label": "Leistung DC",
"format": "{{msg.payload}} W",
"layout": "row-spread",
"x": 1770,
"y": 140,
"wires": []
},
{
"id": "6cdf85eb.70da6c",
"type": "join",
"z": "be7272e9.9bf7b8",
"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": 1350,
"y": 200,
"wires": [
[
"bee87067.f715d"
]
]
},
{
"id": "ed1d5c0e.a95a6",
"type": "ui_text",
"z": "be7272e9.9bf7b8",
"group": "e035cd18.8c0fd8",
"order": 1,
"width": 0,
"height": 0,
"name": "Wirkungsgrad",
"label": "Wirkungsgrad",
"format": "{{msg.payload}} %",
"layout": "row-spread",
"x": 1780,
"y": 200,
"wires": []
},
{
"id": "6b2fe76f.cde508",
"type": "modbus-getter",
"z": "be7272e9.9bf7b8",
"name": "30953 - 30954",
"showStatusActivities": false,
"showErrors": false,
"logIOActivities": false,
"unitid": "3",
"dataType": "InputRegister",
"adr": "30953",
"quantity": "2",
"server": "8d503b14.f14ac8",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": false,
"keepMsgProperties": false,
"x": 340,
"y": 400,
"wires": [
[
"372c08ce.4b36b"
],
[]
]
},
{
"id": "372c08ce.4b36b",
"type": "buffer-parser",
"z": "be7272e9.9bf7b8",
"name": "",
"data": "responseBuffer.buffer",
"dataType": "msg",
"specification": "spec",
"specificationType": "ui",
"items": [
{
"type": "int32be",
"name": "T3",
"offset": 0,
"length": 1,
"offsetbit": 0,
"scale": 0.1,
"mask": ""
}
],
"swap1": "",
"swap2": "",
"swap3": "",
"swap1Type": "swap",
"swap2Type": "swap",
"swap3Type": "swap",
"msgProperty": "payload",
"msgPropertyType": "str",
"resultType": "keyvalue",
"resultTypeType": "output",
"multipleResult": false,
"setTopic": true,
"x": 570,
"y": 400,
"wires": [
[
"a409e237.96c3a"
]
]
},
{
"id": "a409e237.96c3a",
"type": "function",
"z": "be7272e9.9bf7b8",
"name": "T3",
"func": "msg.payload = msg.payload.T3\nmsg.payload = msg.payload.toFixed(1).replace('.', ',');\nmsg.topic = \"T3\"\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 790,
"y": 400,
"wires": [
[
"e78414e2.08ed"
]
]
},
{
"id": "e78414e2.08ed",
"type": "ui_text",
"z": "be7272e9.9bf7b8",
"group": "e035cd18.8c0fd8",
"order": 1,
"width": 0,
"height": 0,
"name": "SBS Temperatur",
"label": "Temperatur",
"format": "{{msg.payload}} °C",
"layout": "row-spread",
"x": 1080,
"y": 400,
"wires": []
},
{
"id": "ee79b693.bcc4e8",
"type": "function",
"z": "be7272e9.9bf7b8",
"name": ". zu ,",
"func": "msg.payload = msg.payload.toFixed(1).replace('.', ',')\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 930,
"y": 120,
"wires": [
[
"fa7304ff.0f313"
]
]
},
{
"id": "ebdb2054.bc52e8",
"type": "function",
"z": "be7272e9.9bf7b8",
"name": ". zu ,",
"func": "msg.payload = msg.payload.toFixed(2).replace('.', ',')\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 930,
"y": 160,
"wires": [
[
"469f11a7.915cc8"
]
]
},
{
"id": "c0ca0117.42f7",
"type": "ui_gauge",
"z": "be7272e9.9bf7b8",
"name": "SoC",
"group": "a4ae5bd.929ca28",
"order": 1,
"width": 0,
"height": 0,
"gtype": "gage",
"title": "Ladezustand",
"label": "",
"format": "{{value}} %",
"min": 0,
"max": "100",
"colors": [
"#b30206",
"#f9f900",
"#00f400"
],
"seg1": "",
"seg2": "",
"x": 1090,
"y": 80,
"wires": []
},
{
"id": "bee87067.f715d",
"type": "function",
"z": "be7272e9.9bf7b8",
"name": "Wirkungsgrad AC/DC",
"func": "var BattP = msg.payload[\"BattP\"];\nvar PAC3 = msg.payload[\"PAC3\"];\nvar temp; \n\nif(BattP > 0 || PAC3 > 0) {\n temp = ((PAC3 / BattP) * 100);\n} else {\n temp = ((BattP / PAC3) * 100);\n}\n\nmsg.payload = parseFloat(temp.toFixed(0)); \nmsg.topic = \"W3\";\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1560,
"y": 200,
"wires": [
[
"ed1d5c0e.a95a6"
]
]
},
{
"id": "8dfa6082.02ded",
"type": "function",
"z": "be7272e9.9bf7b8",
"name": "Zellspannung",
"func": "var temp = (msg.payload[\"BattV\"] / 96);\nmsg.payload = parseFloat(temp.toFixed(2)); \nmsg.topic = \"BattZV\";\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1440,
"y": 80,
"wires": [
[
"e0993c71.eef048"
]
]
},
{
"id": "d034f9e4.5d602",
"type": "ui_text",
"z": "be7272e9.9bf7b8",
"group": "a4ae5bd.929ca28",
"order": 2,
"width": 0,
"height": 0,
"name": "BYD Zellspannung",
"label": "Zellspannung",
"format": "{{msg.payload}} V",
"layout": "row-spread",
"x": 1790,
"y": 80,
"wires": []
},
{
"id": "e0993c71.eef048",
"type": "function",
"z": "be7272e9.9bf7b8",
"name": ". zu ,",
"func": "msg.payload = msg.payload.toFixed(2).replace('.', ',')\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1610,
"y": 80,
"wires": [
[
"d034f9e4.5d602"
]
]
},
{
"id": "8d503b14.f14ac8",
"type": "modbus-client",
"z": "",
"name": "SBS2.5",
"clienttype": "tcp",
"bufferCommands": true,
"stateLogEnabled": false,
"queueLogEnabled": false,
"tcpHost": "192.168.168.55",
"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": 1,
"clientTimeout": 1000,
"reconnectOnTimeout": true,
"reconnectTimeout": 2000,
"parallelUnitIdsAllowed": true
},
{
"id": "a4ae5bd.929ca28",
"type": "ui_group",
"z": "",
"name": "BYD",
"tab": "8d2f0b42.f2aa68",
"order": 1,
"disp": true,
"width": "5",
"collapse": false
},
{
"id": "e035cd18.8c0fd8",
"type": "ui_group",
"z": "",
"name": "SBS 2.5",
"tab": "8d2f0b42.f2aa68",
"order": 2,
"disp": true,
"width": "5",
"collapse": false
},
{
"id": "8d2f0b42.f2aa68",
"type": "ui_tab",
"z": "",
"name": "Batterie",
"icon": "fa-battery-half",
"order": 2,
"disabled": false,
"hidden": false
}
]
If I connect here:
the output is always "NaN". Don´t know why.
I always need a join, even if the formula only contains one input value !