Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev restruct #45

Merged
merged 27 commits into from
Feb 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ https://forum.iobroker.net/assets/uploads/files/1699119419919-solar-inverter-mod

## Supported hardware

* HUAWEI Inverter (SUN2000 Serie) M1
* HUAWEI Smart Dongle-WLAN-FE / min. Softwareversion: xxxSPC133 (SDongleA-05)
* HUAWEI Inverter SUN2000 Serie (M0,M1)
* HUAWEI Smart Dongle-WLAN-FE / min. Softwareversion: V100R001C00SPC133 (SDongleA-05)
* HUAWEI Luna2000 Battery
* HUAWEI Smart Power Sensor DTSU666-H or DDSU666-H

Expand Down Expand Up @@ -68,6 +68,13 @@ The development of this adapter was inspired by discussions from the forum threa
Placeholder for the next version (at the beginning of the line):
### **WORK IN PROGRESS**
-->

### **WORK IN PROGRESS**
* add battery unit information for example temperature #40
* modbus timeout and delay can be configured
* device status as plain text `sun2000.0.inverter.x.derived.deviceStatus`
* Introduction of a driver model. A separate driver can be created for each device.

### 0.2.1 (2024-02-02)
* Requirements from [Add sun2000 to latest](https://github.com/ioBroker/ioBroker.repositories/pull/3219)

Expand Down
106 changes: 79 additions & 27 deletions admin/jsonConfig.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,85 @@
{
"i18n": true,
"type": "panel",
"type": "tabs",
"items": {
"address": {
"type": "text",
"label": "address",
"newLine": false,
"tooltip": "The inverters ip address"
"mainTab": {
"type": "panel",
"label": "Main settings",
"items": {
"address": {
"type": "text",
"label": "address",
"newLine": false,
"tooltip": "The inverters ip address",
"sm": 12,
"md": 8,
"lg": 2
},
"port": {
"type": "number",
"label": "port",
"min" : 1,
"max" : 655565,
"default": 502,
"newLine": true,
"tooltip": "The modbus TCP port"
},
"modbusIds": {
"type": "text",
"label": "Modbus Inverter IDs",
"sm": 12,
"md": 8,
"lg": 3,
"default": "1",
"newLine": true,
"tooltip": "The modbus inverter IDs, separated with character ,"
},
"updateInterval": {
"type": "number",
"label": "Update interval (sec)",
"min" : 5,
"max" : 120,
"default": 20,
"newLine": true,
"tooltip": "Update interval to update the values from the inverters"
}
}
},
"port": {
"type": "number",
"label": "port",
"default": 502,
"newLine": true,
"tooltip": "The modbus TCP port"
},
"modbusIds": {
"type": "text",
"label": "Modbus Inverter IDs",
"default": "1",
"newLine": true,
"tooltip": "The modbus inverter IDs, separated with character ,"
},
"updateInterval": {
"type": "number",
"label": "Update interval (s)",
"default": 20,
"newLine": true,
"tooltip": "Update interval to update the values from the inverters"
}
"tab2": {
"type": "panel",
"label": "Modbus timing",
"items": {
"timeout": {
"type": "number",
"label": "timeout (ms)",
"min" : 5000,
"max" : 30000,
"newLine": true,
"tooltip": "modbus connection timeout"
},
"delay": {
"type": "number",
"label": "delay (ms)",
"min" : 0,
"max" : 6000,
"newLine": true,
"tooltip": "delay between modbus requests"
},
"connectDelay": {
"type": "number",
"label": "connect delay (ms)",
"min" : 1000,
"max" : 15000,
"newLine": true,
"tooltip": "delay after modbus connected"
},
"autoAdjust": {
"type": "checkbox",
"label": "auto-adjust",
"newLine": true,
"tooltip": "automatic adjustment of the modbus settings"
}
}
}
}
}
76 changes: 64 additions & 12 deletions io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,17 @@
}
},
"titleLang": {
"en": "Huawei sun2000 inverters",
"de": "Huawei sun2000 Wechselrichtern",
"ru": "Huawei sun2000 inverters",
"pt": "Huawei sun2000 inverters",
"nl": "Huawei sun2000 inverters",
"fr": "Huawei sun2000 inverters",
"it": "Huawei sun2000 inverters",
"es": "Huawei sun2000 inverters",
"pl": "Huawei sun2000 inverters",
"uk": "Huawei sun2000 inverters",
"zh-cn": "Huawei sun2000 inverters"
"en": "Huawei sun2000 inverter",
"de": "Huawei sun2000 Wechselrichter",
"ru": "Huawei sun2000 inverter",
"pt": "Huawei sun2000 inverter",
"nl": "Huawei sun2000 inverter",
"fr": "Huawei sun2000 inverter",
"it": "Huawei sun2000 inverter",
"es": "Huawei sun2000 inverter",
"pl": "Huawei sun2000 inverter",
"uk": "Huawei sun2000 inverter",
"zh-cn": "Huawei sun2000 inverter"
},
"desc": {
"en": "Read data from Huawei SUN2000 inverters and LUNA2000 battery using Modbus TCP\n",
Expand Down Expand Up @@ -136,7 +136,11 @@
"address": "",
"port": 502,
"modbusIds": "1",
"updateInterval": 20
"updateInterval": 20,
"timeout": 10000,
"delay" : 1000,
"connectDelay" : 5000,
"autoAdjust" : true
},
"objects": [],
"instanceObjects": [
Expand Down Expand Up @@ -237,6 +241,54 @@
"unit": "sec"
}
},
{
"_id": "info.modbusTimeout",
"type": "state",
"common": {
"name": {
"en": "modbus timeout",
"de": "modbus timeout"
},
"type": "number",
"role": "value",
"read": true,
"write": false,
"desc": "modbus timeout",
"unit": "ms"
}
},
{
"_id": "info.modbusDelay",
"type": "state",
"common": {
"name": {
"en": "modbus delay",
"de": "modbus delay"
},
"type": "number",
"role": "value",
"read": true,
"write": false,
"desc": "delay between modbus requests",
"unit": "ms"
}
},
{
"_id": "info.modbusConnectDelay",
"type": "state",
"common": {
"name": {
"en": "modbus connect delay",
"de": "modbus connect delay"
},
"type": "number",
"role": "value",
"read": true,
"write": false,
"desc": "delay after modbus connected",
"unit": "ms"
}
},
{
"_id": "info.JSONhealth",
"type": "state",
Expand Down
Loading
Loading