iobroker.sun2000 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -5
- package/admin/jsonConfig.json +79 -27
- package/io-package.json +91 -13
- package/lib/drivers.js +822 -0
- package/lib/modbus_connect.js +206 -37
- package/lib/register.js +46 -635
- package/lib/tools.js +58 -9
- package/lib/types.js +53 -3
- package/main.js +142 -75
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -21,8 +21,8 @@ https://forum.iobroker.net/assets/uploads/files/1699119419919-solar-inverter-mod
|
|
|
21
21
|
|
|
22
22
|
## Supported hardware
|
|
23
23
|
|
|
24
|
-
* HUAWEI Inverter
|
|
25
|
-
* HUAWEI Smart Dongle-WLAN-FE / min. Softwareversion:
|
|
24
|
+
* HUAWEI Inverter SUN2000 Serie (M0,M1)
|
|
25
|
+
* HUAWEI Smart Dongle-WLAN-FE / min. Softwareversion: V100R001C00SPC133 (SDongleA-05)
|
|
26
26
|
* HUAWEI Luna2000 Battery
|
|
27
27
|
* HUAWEI Smart Power Sensor DTSU666-H or DDSU666-H
|
|
28
28
|
|
|
@@ -30,17 +30,21 @@ https://forum.iobroker.net/assets/uploads/files/1699119419919-solar-inverter-mod
|
|
|
30
30
|
|
|
31
31
|
## Feature list
|
|
32
32
|
|
|
33
|
-
* Maximum 5 inverters (master/slave) can be processed, each with a battery module (max.
|
|
33
|
+
* Maximum 5 inverters (master/slave) can be processed, each with a battery module (max. 15kWh).
|
|
34
34
|
* Real-time values such as input power, output power, charging/discharging power and the grid consumption are read out at a fixed interval.
|
|
35
35
|
* States are only written for changed data from the inverter. This relieves the burden on the iobroker instance.
|
|
36
36
|
* The states “inputPower” or “activePower” in the “collected” path can be monitored with a “was updated” trigger element. Because these states are always written within the set interval.
|
|
37
37
|
|
|
38
|
-
## Settings
|
|
39
|
-
|
|
38
|
+
## Main Settings
|
|
40
39
|
* `address`: Inverter IP address
|
|
41
40
|
* `port`: Inverter modbus port (default: 502)
|
|
42
41
|
* `modbusIds`: inverter IDs, separated with "," (default: 1, max. 5 inverters)
|
|
43
42
|
* `updateInterval`: Fast update interval (default: 20 sec, smallest 5 seconds per inverter)
|
|
43
|
+
## Modbus timing
|
|
44
|
+
* `timeout`: modbus connection timeout (default: 10000 ms)
|
|
45
|
+
* `delay`: delay between modbus requests (default: 0 ms)
|
|
46
|
+
* `connect delay`: delay after modbus connected (default: 5000 ms)
|
|
47
|
+
* `auto-adjust`: automatic adjustment of the modbus settings
|
|
44
48
|
|
|
45
49
|
## Configure inverters
|
|
46
50
|
|
|
@@ -68,6 +72,15 @@ The development of this adapter was inspired by discussions from the forum threa
|
|
|
68
72
|
Placeholder for the next version (at the beginning of the line):
|
|
69
73
|
### **WORK IN PROGRESS**
|
|
70
74
|
-->
|
|
75
|
+
### 0.3.0 (2024-02-10)
|
|
76
|
+
* add battery unit information for example temperature #40
|
|
77
|
+
* modbus timeout, connect delay and delay can be configured #34
|
|
78
|
+
* device status as plain text `sun2000.0.inverter.x.derived.deviceStatus`
|
|
79
|
+
* Introduction of a driver model. A separate driver can be created for each device #41
|
|
80
|
+
|
|
81
|
+
### 0.2.1 (2024-02-02)
|
|
82
|
+
* Requirements from [Add sun2000 to latest](https://github.com/ioBroker/ioBroker.repositories/pull/3219)
|
|
83
|
+
|
|
71
84
|
### 0.2.0 (2024-01-24)
|
|
72
85
|
* [Add sun2000 to latest](https://github.com/ioBroker/ioBroker.repositories/pull/3219)
|
|
73
86
|
* improve error handling (#34)
|
package/admin/jsonConfig.json
CHANGED
|
@@ -1,33 +1,85 @@
|
|
|
1
1
|
{
|
|
2
2
|
"i18n": true,
|
|
3
|
-
"type": "
|
|
3
|
+
"type": "tabs",
|
|
4
4
|
"items": {
|
|
5
|
-
"
|
|
6
|
-
"type": "
|
|
7
|
-
"label": "
|
|
8
|
-
"
|
|
9
|
-
|
|
5
|
+
"mainTab": {
|
|
6
|
+
"type": "panel",
|
|
7
|
+
"label": "Main settings",
|
|
8
|
+
"items": {
|
|
9
|
+
"address": {
|
|
10
|
+
"type": "text",
|
|
11
|
+
"label": "address",
|
|
12
|
+
"newLine": false,
|
|
13
|
+
"tooltip": "The inverters ip address",
|
|
14
|
+
"sm": 12,
|
|
15
|
+
"md": 8,
|
|
16
|
+
"lg": 2
|
|
17
|
+
},
|
|
18
|
+
"port": {
|
|
19
|
+
"type": "number",
|
|
20
|
+
"label": "port",
|
|
21
|
+
"min" : 1,
|
|
22
|
+
"max" : 655565,
|
|
23
|
+
"default": 502,
|
|
24
|
+
"newLine": true,
|
|
25
|
+
"tooltip": "The modbus TCP port"
|
|
26
|
+
},
|
|
27
|
+
"modbusIds": {
|
|
28
|
+
"type": "text",
|
|
29
|
+
"label": "Modbus Inverter IDs",
|
|
30
|
+
"sm": 12,
|
|
31
|
+
"md": 8,
|
|
32
|
+
"lg": 3,
|
|
33
|
+
"default": "1",
|
|
34
|
+
"newLine": true,
|
|
35
|
+
"tooltip": "The modbus inverter IDs, separated with character ,"
|
|
36
|
+
},
|
|
37
|
+
"updateInterval": {
|
|
38
|
+
"type": "number",
|
|
39
|
+
"label": "Update interval (sec)",
|
|
40
|
+
"min" : 5,
|
|
41
|
+
"max" : 120,
|
|
42
|
+
"default": 20,
|
|
43
|
+
"newLine": true,
|
|
44
|
+
"tooltip": "Update interval to update the values from the inverters"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
10
47
|
},
|
|
11
|
-
"
|
|
12
|
-
"type": "
|
|
13
|
-
"label": "
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
48
|
+
"tab2": {
|
|
49
|
+
"type": "panel",
|
|
50
|
+
"label": "Modbus timing",
|
|
51
|
+
"items": {
|
|
52
|
+
"timeout": {
|
|
53
|
+
"type": "number",
|
|
54
|
+
"label": "timeout (ms)",
|
|
55
|
+
"min" : 5000,
|
|
56
|
+
"max" : 30000,
|
|
57
|
+
"newLine": true,
|
|
58
|
+
"tooltip": "modbus connection timeout"
|
|
59
|
+
},
|
|
60
|
+
"delay": {
|
|
61
|
+
"type": "number",
|
|
62
|
+
"label": "delay (ms)",
|
|
63
|
+
"min" : 0,
|
|
64
|
+
"max" : 6000,
|
|
65
|
+
"newLine": true,
|
|
66
|
+
"tooltip": "delay between modbus requests"
|
|
67
|
+
},
|
|
68
|
+
"connectDelay": {
|
|
69
|
+
"type": "number",
|
|
70
|
+
"label": "connect delay (ms)",
|
|
71
|
+
"min" : 1000,
|
|
72
|
+
"max" : 15000,
|
|
73
|
+
"newLine": true,
|
|
74
|
+
"tooltip": "delay after modbus connected"
|
|
75
|
+
},
|
|
76
|
+
"autoAdjust": {
|
|
77
|
+
"type": "checkbox",
|
|
78
|
+
"label": "auto-adjust",
|
|
79
|
+
"newLine": true,
|
|
80
|
+
"tooltip": "automatic adjustment of the modbus settings"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
32
84
|
}
|
|
33
85
|
}
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "sun2000",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.0",
|
|
5
5
|
"news": {
|
|
6
|
+
"0.3.0": {
|
|
7
|
+
"en": "add battery unit information for example temperature #40\nmodbus timeout, connect delay and delay can be configured #34\ndevice status as plain text `sun2000.0.inverter.x.derived.deviceStatus`\nIntroduction of a driver model. A separate driver can be created for each device #41",
|
|
8
|
+
"de": "batterieeinheitsinformationen hinzufügen, zum beispiel temperatur #40\nmodbus timeout, verbinden verzögerung und verzögerung kann #34 konfiguriert werden\ngerätestatus als Klartext `sun2000.0.inverter.x.derived.deviceStatus `\nEinführung eines Fahrermodells. Ein separater Treiber kann für jedes Gerät #41 erstellt werden",
|
|
9
|
+
"ru": "добавить информацию аккумулятора, например, температуру #40\nmodbus timeout, подключить задержку и задержку можно настроить #34\nстатус устройства как простой текст `sun2000.0.inverter.x.derived.deviceStatus \"\nВведение модели водителя. Для каждого устройства может быть создан отдельный драйвер #41",
|
|
10
|
+
"pt": "adicionar informações da unidade de bateria, por exemplo, temperatura #40\nmodbus timeout, conectar delay e delay pode ser configurado #34\nstatus do dispositivo como texto simples `sun2000.0.inverter.x.derived.deviceStatus \"\nIntrodução de um modelo de driver. Um driver separado pode ser criado para cada dispositivo #41",
|
|
11
|
+
"nl": "toe te voegen batterij eenheid informatie bijvoorbeeld temperatuur #40\nmodbus timeout, verbind vertraging en vertraging kan worden geconfigureerd #34\napparaatstatus als platte tekst Wat\nInvoering van een bestuurdersmodel. Voor elk apparaat kan een aparte driver #41 aangemaakt worden",
|
|
12
|
+
"fr": "ajouter des informations sur l'unité de batterie par exemple température #40\nmodbus timeout, connecter le délai et le délai peuvent être configurés #34\nstatut du périphérique comme texte simple `sun2000.0.inverter.x.derived.deviceStatus \"\nIntroduction d'un modèle de pilote. Un pilote séparé peut être créé pour chaque périphérique #41",
|
|
13
|
+
"it": "aggiungere le informazioni dell'unità della batteria per esempio la temperatura #40\nmodbus timeout, collegare ritardo e ritardo può essere configurato #34\nstato del dispositivo come testo normale `sun2000.0.inverter.x.derived.deviceStatus #\nIntroduzione di un modello di driver. Un driver separato può essere creato per ogni dispositivo #41",
|
|
14
|
+
"es": "añadir información de la unidad de la batería por ejemplo temperatura #40\nmodbus timeout, conectar retraso y retraso se puede configurar #34\nestado del dispositivo como texto simple `sun2000.0.inverter.x.derived.deviceStatus `\nIntroducción de un modelo de piloto. Un controlador separado se puede crear para cada dispositivo #41",
|
|
15
|
+
"pl": "dodaj informacje o akumulatorze np. temperatura # 40\nmodbus timeout, connect opóźnienie i opóźnienie można skonfigurować # 34\nstatus urządzenia jako zwykłego tekstu 'Sun2000.0.inverter.x.derived.deviceStatus'\nWprowadzenie modelu kierowcy. Dla każdego urządzenia # 41 można utworzyć oddzielny sterownik",
|
|
16
|
+
"uk": "додати інформацію акумулятора для прикладної температури #40\nмодульний час, затримки з'єднання та затримки можна налаштувати #34\nстатус на сервери й\nВступ моделі драйвера. Для кожного пристрою No41 призначений окремий драйвер",
|
|
17
|
+
"zh-cn": "添加电池单位信息, 如温度# 40\nmodbus 超时, 连接延迟和延迟可以配置 # 34\n设备状态为纯文本 `sun2000.0.inverter.x. exterm.device status ' `\n引入驱动模式. 每个设备都可以创建单独的驱动程序 # 41"
|
|
18
|
+
},
|
|
19
|
+
"0.2.1": {
|
|
20
|
+
"en": "Requirements from [Add sun2000 to latest](https://github.com/ioBroker/ioBroker.repositories/pull/3219)",
|
|
21
|
+
"de": "Anforderungen von [Sonnen 2000 bis spätestens](https://github.com/ioBroker/ioBroker.repositories/pull/3219)",
|
|
22
|
+
"ru": "Требования от [Add sun2000 до последнего] (https://github.com/ioBroker/ioBroker.repositories/pull/3219)",
|
|
23
|
+
"pt": "Requisitos de [Adicionar sun2000 para o mais recente](https://github.com/ioBroker/ioBroker.repositories/pull/3219)",
|
|
24
|
+
"nl": "Vereisten van [Toevoegen aan sun2000 laatste](https://github.com/ioBroker/ioBroker.repositoria/pull/3219)",
|
|
25
|
+
"fr": "Exigences de [Ajouter sun2000 à la dernière](https://github.com/ioBroker/ioBroker.repositories/pull/3219)",
|
|
26
|
+
"it": "Requisiti da [Add sun2000 to more](https://github.com/ioBroker/ioBroker.repositories/pull/3219)",
|
|
27
|
+
"es": "Necesidades de [Agregar el sol 2000 a más tardar](https://github.com/ioBroker/ioBroker.repositories/pull/3219)",
|
|
28
|
+
"pl": "Data umieszczenia w wykazie",
|
|
29
|
+
"uk": "Вимоги до [Додати сонце2000 to last](https://github.com/ioBroker/ioBroker.repositories/pull/3219)",
|
|
30
|
+
"zh-cn": "(https://github.com/ioBroker/ioBroker.repositories/pul/3219) 需求"
|
|
31
|
+
},
|
|
6
32
|
"0.2.0": {
|
|
7
33
|
"en": "improve error handling (#34)\nadd simple optimizer info \nRiemann sum of input power with energy loss for new state `dailySolarYield`\ntry to recreate the `yield today` from the fusion portal",
|
|
8
34
|
"de": "fehlerbehandlung verbessern (#34)\neinfache optimierer-info hinzufügen\nRiemann Summe der Eingangsleistung mit Energieverlust für neuen Zustand `dailySolarYield `\nversuchen, den `yield heute` aus dem fusionsportal wiederherzustellen",
|
|
@@ -57,17 +83,17 @@
|
|
|
57
83
|
}
|
|
58
84
|
},
|
|
59
85
|
"titleLang": {
|
|
60
|
-
"en": "Huawei sun2000
|
|
61
|
-
"de": "Huawei sun2000
|
|
62
|
-
"ru": "Huawei sun2000
|
|
63
|
-
"pt": "Huawei sun2000
|
|
64
|
-
"nl": "Huawei sun2000
|
|
65
|
-
"fr": "Huawei sun2000
|
|
66
|
-
"it": "Huawei sun2000
|
|
67
|
-
"es": "Huawei sun2000
|
|
68
|
-
"pl": "Huawei sun2000
|
|
69
|
-
"uk": "Huawei sun2000
|
|
70
|
-
"zh-cn": "Huawei sun2000
|
|
86
|
+
"en": "Huawei sun2000 inverter",
|
|
87
|
+
"de": "Huawei sun2000 Wechselrichter",
|
|
88
|
+
"ru": "Huawei sun2000 inverter",
|
|
89
|
+
"pt": "Huawei sun2000 inverter",
|
|
90
|
+
"nl": "Huawei sun2000 inverter",
|
|
91
|
+
"fr": "Huawei sun2000 inverter",
|
|
92
|
+
"it": "Huawei sun2000 inverter",
|
|
93
|
+
"es": "Huawei sun2000 inverter",
|
|
94
|
+
"pl": "Huawei sun2000 inverter",
|
|
95
|
+
"uk": "Huawei sun2000 inverter",
|
|
96
|
+
"zh-cn": "Huawei sun2000 inverter"
|
|
71
97
|
},
|
|
72
98
|
"desc": {
|
|
73
99
|
"en": "Read data from Huawei SUN2000 inverters and LUNA2000 battery using Modbus TCP\n",
|
|
@@ -123,7 +149,11 @@
|
|
|
123
149
|
"address": "",
|
|
124
150
|
"port": 502,
|
|
125
151
|
"modbusIds": "1",
|
|
126
|
-
"updateInterval": 20
|
|
152
|
+
"updateInterval": 20,
|
|
153
|
+
"timeout": 10000,
|
|
154
|
+
"delay": 0,
|
|
155
|
+
"connectDelay": 5000,
|
|
156
|
+
"autoAdjust": true
|
|
127
157
|
},
|
|
128
158
|
"objects": [],
|
|
129
159
|
"instanceObjects": [
|
|
@@ -224,6 +254,54 @@
|
|
|
224
254
|
"unit": "sec"
|
|
225
255
|
}
|
|
226
256
|
},
|
|
257
|
+
{
|
|
258
|
+
"_id": "info.modbusTimeout",
|
|
259
|
+
"type": "state",
|
|
260
|
+
"common": {
|
|
261
|
+
"name": {
|
|
262
|
+
"en": "modbus timeout",
|
|
263
|
+
"de": "modbus timeout"
|
|
264
|
+
},
|
|
265
|
+
"type": "number",
|
|
266
|
+
"role": "value",
|
|
267
|
+
"read": true,
|
|
268
|
+
"write": false,
|
|
269
|
+
"desc": "modbus timeout",
|
|
270
|
+
"unit": "ms"
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"_id": "info.modbusDelay",
|
|
275
|
+
"type": "state",
|
|
276
|
+
"common": {
|
|
277
|
+
"name": {
|
|
278
|
+
"en": "modbus delay",
|
|
279
|
+
"de": "modbus delay"
|
|
280
|
+
},
|
|
281
|
+
"type": "number",
|
|
282
|
+
"role": "value",
|
|
283
|
+
"read": true,
|
|
284
|
+
"write": false,
|
|
285
|
+
"desc": "delay between modbus requests",
|
|
286
|
+
"unit": "ms"
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"_id": "info.modbusConnectDelay",
|
|
291
|
+
"type": "state",
|
|
292
|
+
"common": {
|
|
293
|
+
"name": {
|
|
294
|
+
"en": "modbus connect delay",
|
|
295
|
+
"de": "modbus connect delay"
|
|
296
|
+
},
|
|
297
|
+
"type": "number",
|
|
298
|
+
"role": "value",
|
|
299
|
+
"read": true,
|
|
300
|
+
"write": false,
|
|
301
|
+
"desc": "delay after modbus connected",
|
|
302
|
+
"unit": "ms"
|
|
303
|
+
}
|
|
304
|
+
},
|
|
227
305
|
{
|
|
228
306
|
"_id": "info.JSONhealth",
|
|
229
307
|
"type": "state",
|