Replies: 9 comments 37 replies
|
I had the RS485 connected to 3/5 instead of 1/3. Now I am receiving data from the SUN2000 when I define ModBrTx and ModBrRx and do for example So now i just need some guidance on the syntax of the SML script/meter definition... |
|
@pkkrusty I suspect you don't have it on Ethernet or Wifi, right? I'd be careful in messing with the Modbus on the SUN2000 if it is connected to the cloud, also if you want to add a backup box (not the one that is from Huawei) because of warranty issues. I think it calls home to the EMEA servers occasionally. I ended up using the TCP protocol and the modbus package to pipe things into node-red. If you are familiar with that, in node-red it works somewhat like this: [
{
"id": "b88b6574d56ef461",
"type": "modbus-getter",
"z": "43643082ec7e300c",
"name": "32080",
"showStatusActivities": false,
"showErrors": false,
"logIOActivities": false,
"unitid": "1",
"dataType": "HoldingRegister",
"adr": "32080",
"quantity": "2",
"server": "70220ecd.1ca1e",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": false,
"keepMsgProperties": false,
"x": 290,
"y": 2500,
"wires": [
[
"6cd123d226deaa96"
],
[
"c6ae93e907d20880"
]
]
},
{
"id": "6cd123d226deaa96",
"type": "buffer-parser",
"z": "43643082ec7e300c",
"name": "",
"data": "payload",
"dataType": "msg",
"specification": "spec",
"specificationType": "ui",
"items": [
{
"type": "int32be",
"name": "Active Power",
"offset": 0,
"length": 1,
"offsetbit": 0,
"scale": "1",
"mask": ""
}
],
"swap1": "",
"swap2": "",
"swap3": "",
"swap1Type": "swap",
"swap2Type": "swap",
"swap3Type": "swap",
"msgProperty": "payload",
"msgPropertyType": "str",
"resultType": "value",
"resultTypeType": "output",
"multipleResult": false,
"fanOutMultipleResult": false,
"setTopic": true,
"outputs": 1,
"x": 470,
"y": 2500,
"wires": [
[
"9efb69d6834bfe6e"
]
]
},
{
"id": "9efb69d6834bfe6e",
"type": "calculator",
"z": "43643082ec7e300c",
"name": "",
"inputMsgField": "payload",
"outputMsgField": "payload",
"operation": "div",
"constant": "1",
"round": true,
"decimals": "0",
"x": 630,
"y": 2500,
"wires": [
[
"f2c43b3f9855a2d2",
"908ab92b8223d602",
"9fae2ace5a750514"
]
]
},
{
"id": "fe721ef316ce2431",
"type": "calculator",
"z": "43643082ec7e300c",
"name": "",
"inputMsgField": "payload",
"outputMsgField": "payload",
"operation": "div",
"constant": "1",
"round": true,
"decimals": "0",
"x": 630,
"y": 2280,
"wires": [
[
"107145cec1d3e177",
"bd8b3801a4dd4f35",
"cbf7131f2ab87a6b"
]
]
},
{
"id": "eafde78ee735f583",
"type": "buffer-parser",
"z": "43643082ec7e300c",
"name": "",
"data": "payload",
"dataType": "msg",
"specification": "spec",
"specificationType": "ui",
"items": [
{
"type": "int32be",
"name": "Meter Power",
"offset": 0,
"length": 1,
"offsetbit": 0,
"scale": "1",
"mask": ""
}
],
"swap1": "",
"swap2": "",
"swap3": "",
"swap1Type": "swap",
"swap2Type": "swap",
"swap3Type": "swap",
"msgProperty": "payload",
"msgPropertyType": "str",
"resultType": "value",
"resultTypeType": "output",
"multipleResult": false,
"fanOutMultipleResult": false,
"setTopic": true,
"outputs": 1,
"x": 470,
"y": 2280,
"wires": [
[
"fe721ef316ce2431"
]
]
},
{
"id": "4273b3319d082ee0",
"type": "modbus-getter",
"z": "43643082ec7e300c",
"name": "37113",
"showStatusActivities": false,
"showErrors": false,
"logIOActivities": false,
"unitid": "1",
"dataType": "HoldingRegister",
"adr": "37113",
"quantity": "2",
"server": "70220ecd.1ca1e",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": false,
"keepMsgProperties": false,
"x": 290,
"y": 2280,
"wires": [
[
"eafde78ee735f583"
],
[
"01d1b3c7dc289c7f"
]
]
},
{
"id": "01d1b3c7dc289c7f",
"type": "modbus-getter",
"z": "43643082ec7e300c",
"name": "37001",
"showStatusActivities": false,
"showErrors": false,
"logIOActivities": false,
"unitid": "1",
"dataType": "HoldingRegister",
"adr": "37001",
"quantity": "2",
"server": "70220ecd.1ca1e",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": false,
"keepMsgProperties": false,
"x": 290,
"y": 2360,
"wires": [
[
"ceb2f6cd6d3e1f74"
],
[
"fefb6e6db0337e66"
]
]
},
{
"id": "ceb2f6cd6d3e1f74",
"type": "buffer-parser",
"z": "43643082ec7e300c",
"name": "",
"data": "payload",
"dataType": "msg",
"specification": "spec",
"specificationType": "ui",
"items": [
{
"type": "int32be",
"name": "Battery Charging",
"offset": 0,
"length": 1,
"offsetbit": 0,
"scale": "1",
"mask": ""
}
],
"swap1": "",
"swap2": "",
"swap3": "",
"swap1Type": "swap",
"swap2Type": "swap",
"swap3Type": "swap",
"msgProperty": "payload",
"msgPropertyType": "str",
"resultType": "value",
"resultTypeType": "output",
"multipleResult": false,
"fanOutMultipleResult": false,
"setTopic": true,
"outputs": 1,
"x": 470,
"y": 2360,
"wires": [
[
"d2bf14d65d271a2b"
]
]
},
{
"id": "d2bf14d65d271a2b",
"type": "calculator",
"z": "43643082ec7e300c",
"name": "",
"inputMsgField": "payload",
"outputMsgField": "payload",
"operation": "div",
"constant": "1",
"round": true,
"decimals": "0",
"x": 630,
"y": 2360,
"wires": [
[
"16e34fcea77299b7",
"d04dfd81845f0670",
"edcc896017129dd7"
]
]
},
{
"id": "fefb6e6db0337e66",
"type": "modbus-getter",
"z": "43643082ec7e300c",
"name": "37004",
"showStatusActivities": false,
"showErrors": false,
"logIOActivities": false,
"unitid": "1",
"dataType": "HoldingRegister",
"adr": "37004",
"quantity": "1",
"server": "70220ecd.1ca1e",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": false,
"keepMsgProperties": false,
"x": 290,
"y": 2420,
"wires": [
[
"4de4701af5175cc7"
],
[
"b88b6574d56ef461"
]
]
},
{
"id": "4de4701af5175cc7",
"type": "buffer-parser",
"z": "43643082ec7e300c",
"name": "",
"data": "payload",
"dataType": "msg",
"specification": "spec",
"specificationType": "ui",
"items": [
{
"type": "uint16be",
"name": "Battery SOC",
"offset": 0,
"length": 1,
"offsetbit": 0,
"scale": "1",
"mask": ""
}
],
"swap1": "",
"swap2": "",
"swap3": "",
"swap1Type": "swap",
"swap2Type": "swap",
"swap3Type": "swap",
"msgProperty": "payload",
"msgPropertyType": "str",
"resultType": "value",
"resultTypeType": "output",
"multipleResult": false,
"fanOutMultipleResult": false,
"setTopic": true,
"outputs": 1,
"x": 470,
"y": 2420,
"wires": [
[
"6a965186ad6d3025"
]
]
},
{
"id": "6a965186ad6d3025",
"type": "calculator",
"z": "43643082ec7e300c",
"name": "",
"inputMsgField": "payload",
"outputMsgField": "payload",
"operation": "div",
"constant": "10",
"round": true,
"decimals": "1",
"x": 630,
"y": 2420,
"wires": [
[
"570deb8c6dd59d98",
"3ce3a1626ffcad72",
"2764b5e90fe10f8f"
]
]
},
{
"id": "bf0919fb75e9424d",
"type": "comment",
"z": "43643082ec7e300c",
"name": "Battery",
"info": "",
"x": 110,
"y": 2380,
"wires": []
},
{
"id": "107145cec1d3e177",
"type": "debug",
"z": "43643082ec7e300c",
"name": "meter power",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 810,
"y": 2280,
"wires": []
},
{
"id": "3e9af4313968d8e7",
"type": "inject",
"z": "43643082ec7e300c",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "30",
"crontab": "",
"once": true,
"onceDelay": "10",
"topic": "",
"payloadType": "date",
"x": 170,
"y": 2220,
"wires": [
[
"4273b3319d082ee0"
]
]
},
{
"id": "f2c43b3f9855a2d2",
"type": "debug",
"z": "43643082ec7e300c",
"name": "active power",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 810,
"y": 2480,
"wires": []
},
{
"id": "16e34fcea77299b7",
"type": "debug",
"z": "43643082ec7e300c",
"name": "battery flow",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 810,
"y": 2360,
"wires": []
},
{
"id": "570deb8c6dd59d98",
"type": "debug",
"z": "43643082ec7e300c",
"name": "battery state",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 810,
"y": 2420,
"wires": []
},
{
"id": "70220ecd.1ca1e",
"type": "modbus-client",
"name": "WLAN-FE",
"clienttype": "tcp",
"bufferCommands": true,
"stateLogEnabled": false,
"queueLogEnabled": false,
"tcpHost": "192.168.0.34",
"tcpPort": "502",
"tcpType": "DEFAULT",
"serialPort": "/dev/ttyUSB",
"serialType": "RTU-BUFFERD",
"serialBaudrate": "9600",
"serialDatabits": "8",
"serialStopbits": "1",
"serialParity": "none",
"serialConnectionDelay": "100",
"serialAsciiResponseStartDelimiter": "",
"unit_id": 1,
"commandDelay": 1,
"clientTimeout": 5000,
"reconnectOnTimeout": false,
"reconnectTimeout": 2000,
"parallelUnitIdsAllowed": true
}
] |
|
Smart meter script for Huawei SUN2000-10KTL is as follows. Not all registers are read, just the important ones: |
|
Can you please post the fully working solution? I am also interested in
that… thx
pkkrusty ***@***.***> schrieb am Mi. 28. Juni 2023 um 18:30:
… Ah got it. The meter number in the line below was wrong. Now it's working.
—
Reply to this email directly, view it on GitHub
<#18917 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA3R4GG5N2XKAKGOSCV4LTXNRL35ANCNFSM6AAAAAAZM6DQX4>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
|
@pkkrusty thanks for your Work! With great help, I am on the way to evaluating the Huawei system with Tasmota via Modbus TCP. I already get the default values. ,502,HUAWEI,0,10,r01037D100004,01037D00,01037D08,01037D40,r01037D450003,r01037D48000A,01037D55,01037D57,01037D59,01037D6A,01037D72 1,010308SSss@i0:10,PV1 Voltage,V,PV1_Voltage,1 Since I still can't understand the Huawei numbers via the app, I now want to bring together as many values as possible from the inverter and the battery. How do I get the other report sizes? |
|
Hi @pkkrusty , I'm making little good steps in my Tasmota project. However, I was told that you shouldn't overload the modbus. I get the values into Tasmota via “M” and not under “S”. Can I have any influence at all? How stable is the Modbus and do I have to be careful? |
|
Hello, |







Here's my script using modbus bridge to get values into MQTT and InfluxDB. Text values are commented out because I'm decoding in Grafana, which saves memory on ESP8266. Note this uses gemu's ScriptEditor.
In userconfig_override, I have the following defines: