I have a modul from ABB ILPH RS232-485 / Ethernet module to read a old PV-converter from Kostal. The type 7.0 don't have TCP/ip and only modbus-rtu.
The configuration 9600 bps is the default baudrate, even parity is used and there is one stop bit.
The adress is 4
So I want to read with the code bellow but it isn't work.
Have someone a sulution
[
{
"id": "bfdd49cd1e73e611",
"type": "inject",
"z": "15b82a934ddc1472",
"name": "Inject",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": "5",
"topic": "SMA25000TL-30",
"payload": "",
"payloadType": "date",
"x": 110,
"y": 960,
"wires": [
[
"da54883a5083fa64"
]
]
},
{
"id": "da54883a5083fa64",
"type": "modbus-getter",
"z": "15b82a934ddc1472",
"name": "DC1 - AC",
"showStatusActivities": true,
"showErrors": true,
"showWarnings": true,
"logIOActivities": false,
"unitid": "255",
"dataType": "HoldingRegister",
"adr": "30000",
"quantity": "5",
"server": "dd344a256284af8a",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": true,
"keepMsgProperties": true,
"delayOnStart": true,
"startDelayTime": "60",
"x": 240,
"y": 960,
"wires": [
[
"78790f650acc318e",
"2af2bc9d067e14a6"
],
]
},
{
"id": "78790f650acc318e",
"type": "function",
"z": "15b82a934ddc1472",
"name": "extract buffer data",
"func": "let DCCurrent1 = msg.payload[1] / 1000; // 30769\nlet DCVoltage1 = msg.payload[3] / 100; // 30771\nlet DCPower1 = msg.payload[5]; // 30773\nlet PowerTot = msg.payload[7]; // 30775\nlet PowerL1 = msg.payload[9]; // 30777\n\nlet GridVoltagePhase1= 0;\nif (msg.payload[15] !== 65535) {\n GridVoltagePhase1 = msg.payload[15] / 100; // 30783\n\tflow.set('VoltageSMA_L1', GridVoltagePhase1)\n}\n\nlet GridVoltagePhase2= 0;\nif (msg.payload[17] !== 65535) {\n GridVoltagePhase2 = msg.payload[17] / 100; // 30785\n\tflow.set('VoltageSMA_L2', GridVoltagePhase2)\n}\n\nlet GridVoltagePhase3= 0;\nif (msg.payload[19] !== 65535) {\n GridVoltagePhase3 = msg.payload[19] / 100; // 30787\n\tflow.set('VoltageSMA_L3', GridVoltagePhase3)\n}\n\nlet GridCurrent = 0;\nif (msg.payload[27] !== 65535) {\n GridCurrent = msg.payload[27] / 1000; // 30795\n}\n\nlet GridFrequency = 0;\nif (msg.payload[35] !== 65535) {\n GridFrequency = msg.payload[35] / 100; // 30803\n}\n\nlet _msg = {\n payload: \n};\n\n_msg.payload=\n {\n\t\t\tdc_current1: DCCurrent1,\n\t\t\tdc_voltage1: DCVoltage1,\n\t\t\tdc_power1: DCPower1, \n\t\t\tac_power_tot: PowerTot,\n\t\t\tac_power1: PowerL1,\n\t\t\tac_voltage1: GridVoltagePhase1,\n\t\t\tac_voltage2: GridVoltagePhase2,\n\t\t\tac_voltage3: GridVoltagePhase3,\n\t\t\tac_current1: GridCurrent,\n\t\t\tac_frequency: GridFrequency\n\t}\n\n\nreturn _msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": ,
"x": 470,
"y": 960,
"wires": [
[
"983fa3cb48b01d09",
"4fd3ed8f87c689bf"
]
]
},
{
"id": "983fa3cb48b01d09",
"type": "join",
"z": "15b82a934ddc1472",
"name": "",
"mode": "custom",
"build": "merged",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\n",
"joinerType": "str",
"accumulate": false,
"timeout": "5",
"count": "",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "",
"reduceFixup": "",
"x": 690,
"y": 960,
"wires": [
[
"854d5f4d8afdcd02"
]
]
},
{
"id": "854d5f4d8afdcd02",
"type": "json",
"z": "15b82a934ddc1472",
"name": "",
"property": "payload",
"action": "str",
"pretty": false,
"x": 830,
"y": 960,
"wires": [
[
"815c6d0d01991880"
]
]
},
{
"id": "815c6d0d01991880",
"type": "function",
"z": "15b82a934ddc1472",
"name": "Filter",
"func": "inputjson = JSON.parse(msg.payload);\n\nvar _fields = {};\nfor(var item in inputjson){\n _fields[item] = inputjson[item];\n}\n\nmsg.payload = [\n {\n measurement: "energy",\n fields: _fields,\n timestamp: new Date(),\n tags:{\n\t\t device: "SMA_25000TL-30",\n\t\t },\n },\n ];\nreturn msg;\n\n",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": ,
"x": 730,
"y": 1020,
"wires": [
[
"cd6923678fb5b094"
]
]
},
{
"id": "dd344a256284af8a",
"type": "modbus-client",
"name": "Piko inverter",
"clienttype": "tcp",
"bufferCommands": true,
"stateLogEnabled": true,
"queueLogEnabled": false,
"failureLogEnabled": false,
"tcpHost": "192.168.1.29",
"tcpPort": "502",
"tcpType": "TCP-RTU-BUFFERED",
"serialPort": "/dev/ttyUSB",
"serialType": "RTU-BUFFERD",
"serialBaudrate": "9600",
"serialDatabits": "8",
"serialStopbits": "1",
"serialParity": "none",
"serialConnectionDelay": "100",
"serialAsciiResponseStartDelimiter": "",
"unit_id": "255",
"commandDelay": 100,
"clientTimeout": 2000,
"reconnectOnTimeout": true,
"reconnectTimeout": 2000,
"parallelUnitIdsAllowed": true,
"showErrors": false,
"showWarnings": true,
"showLogs": true
}
]