iobroker.sun2000 0.14.0 → 0.15.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 +6 -0
- package/admin/{jsonConfig.json → jsonConfig.json5} +15 -12
- package/io-package.json +14 -14
- package/lib/modbus/modbus_server.js +23 -9
- package/main.js +13 -18
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -44,6 +44,7 @@ browse in the [wiki](https://github.com/bolliy/ioBroker.sun2000/wiki)
|
|
|
44
44
|
* HUAWEI Luna2000 Battery
|
|
45
45
|
* HUAWEI Smart Power Sensor DTSU666-H or DDSU666-H
|
|
46
46
|
* HUAWEI Smart Logger / min. Softwareversion: V300R023C10SPC311
|
|
47
|
+
* HUAWEI EMMA / min. Softwareversion: V100R024C00SPC101
|
|
47
48
|
|
|
48
49
|
## Feature list
|
|
49
50
|
|
|
@@ -64,6 +65,11 @@ browse in the [wiki](https://github.com/bolliy/ioBroker.sun2000/wiki)
|
|
|
64
65
|
Placeholder for the next version (at the beginning of the line):
|
|
65
66
|
### **WORK IN PROGRESS**
|
|
66
67
|
-->
|
|
68
|
+
### 0.15.0 (2024-10-24)
|
|
69
|
+
* dependency and configuration updates
|
|
70
|
+
* display a clearly legible table bar #121
|
|
71
|
+
* modbus-proxy write data also to the read cache #119
|
|
72
|
+
|
|
67
73
|
### 0.14.0 (2024-10-20)
|
|
68
74
|
* adjust for Responsive Design #121
|
|
69
75
|
* lock on asynchronous modbus code
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"i18n": true,
|
|
3
3
|
"type": "tabs",
|
|
4
|
+
"tabsStyle": {
|
|
5
|
+
"width": "calc(100% - 100px)"
|
|
6
|
+
},
|
|
4
7
|
"items": {
|
|
5
8
|
"mainTab": {
|
|
6
9
|
"type": "panel",
|
|
@@ -89,7 +92,7 @@
|
|
|
89
92
|
"max" : 120,
|
|
90
93
|
"default": 20,
|
|
91
94
|
"newLine": true,
|
|
92
|
-
"tooltip": "Update interval to update the values from the
|
|
95
|
+
"tooltip": "Update interval to update the values from the devices",
|
|
93
96
|
"xs": 12,
|
|
94
97
|
"sm": 12,
|
|
95
98
|
"md": 6,
|
|
@@ -183,7 +186,7 @@
|
|
|
183
186
|
"type": "checkbox",
|
|
184
187
|
"label": "ms.aktive",
|
|
185
188
|
"newLine": true,
|
|
186
|
-
"tooltip": "Modbus-proxy via TCP
|
|
189
|
+
"tooltip": "Modbus-proxy via TCP is active",
|
|
187
190
|
"xs": 12,
|
|
188
191
|
"sm": 12,
|
|
189
192
|
"md": 6,
|
|
@@ -237,14 +240,14 @@
|
|
|
237
240
|
},
|
|
238
241
|
"chipsTxt1": {
|
|
239
242
|
"type": "staticText",
|
|
240
|
-
"text": "This control is set in the opject path
|
|
243
|
+
"text": "This control is set in the opject path `sun2000.0.inverter.x.control.battery`",
|
|
241
244
|
"newLine": true
|
|
242
245
|
},
|
|
243
246
|
"cb_tou": {
|
|
244
247
|
"type": "checkbox",
|
|
245
248
|
"label": "Create default TOU setting",
|
|
246
249
|
"newLine": true,
|
|
247
|
-
"help": "The
|
|
250
|
+
"help": "The `default TOU settings` is interesting for the `force battery charging from the grid` function, which is required for variable energy prices.",
|
|
248
251
|
"xs": 12,
|
|
249
252
|
"sm": 12,
|
|
250
253
|
"md": 6,
|
|
@@ -272,7 +275,7 @@
|
|
|
272
275
|
},
|
|
273
276
|
"chipsTxt2": {
|
|
274
277
|
"type": "staticText",
|
|
275
|
-
"text": "This control is set in the opject path
|
|
278
|
+
"text": "This control is set in the opject path `sun2000.0.inverter.x.control.battery`",
|
|
276
279
|
"newLine": true
|
|
277
280
|
},
|
|
278
281
|
"staticLink2": {
|
|
@@ -296,7 +299,7 @@
|
|
|
296
299
|
},
|
|
297
300
|
"chipsTxt3": {
|
|
298
301
|
"type": "staticText",
|
|
299
|
-
"text": "This control is set in the opject path
|
|
302
|
+
"text": "This control is set in the opject path `sun2000.0.inverter.0.control.grid`",
|
|
300
303
|
"newLine": true
|
|
301
304
|
},
|
|
302
305
|
"staticLink3": {
|
|
@@ -328,7 +331,7 @@
|
|
|
328
331
|
"type": "checkbox",
|
|
329
332
|
"label": "battery units",
|
|
330
333
|
"newLine": true,
|
|
331
|
-
"help": "This register data is stored in the opject path
|
|
334
|
+
"help": "This register data is stored in the opject path `sun2000.x.inverter.x.battery.unit`",
|
|
332
335
|
"xs": 12,
|
|
333
336
|
"sm": 12,
|
|
334
337
|
"md": 6,
|
|
@@ -339,7 +342,7 @@
|
|
|
339
342
|
"type": "checkbox",
|
|
340
343
|
"label": "battery packs",
|
|
341
344
|
"newLine": true,
|
|
342
|
-
"help": "This register data is stored in the opject path
|
|
345
|
+
"help": "This register data is stored in the opject path `sun2000.x.inverter.x.battery.unit.x.pack`",
|
|
343
346
|
"xs": 12,
|
|
344
347
|
"sm": 12,
|
|
345
348
|
"md": 6,
|
|
@@ -364,7 +367,7 @@
|
|
|
364
367
|
"min" : 5000,
|
|
365
368
|
"max" : 30000,
|
|
366
369
|
"newLine": true,
|
|
367
|
-
"tooltip": "
|
|
370
|
+
"tooltip": "Modbus connection timeout",
|
|
368
371
|
"xs": 12,
|
|
369
372
|
"sm": 12,
|
|
370
373
|
"md": 6,
|
|
@@ -377,7 +380,7 @@
|
|
|
377
380
|
"min" : 0,
|
|
378
381
|
"max" : 6000,
|
|
379
382
|
"newLine": true,
|
|
380
|
-
"tooltip": "
|
|
383
|
+
"tooltip": "Delay between modbus requests",
|
|
381
384
|
"xs": 12,
|
|
382
385
|
"sm": 12,
|
|
383
386
|
"md": 6,
|
|
@@ -390,7 +393,7 @@
|
|
|
390
393
|
"min" : 2000,
|
|
391
394
|
"max" : 10000,
|
|
392
395
|
"newLine": true,
|
|
393
|
-
"tooltip": "
|
|
396
|
+
"tooltip": "Delay after modbus connected",
|
|
394
397
|
"xs": 12,
|
|
395
398
|
"sm": 12,
|
|
396
399
|
"md": 6,
|
|
@@ -401,7 +404,7 @@
|
|
|
401
404
|
"type": "checkbox",
|
|
402
405
|
"label": "auto-adjust",
|
|
403
406
|
"newLine": true,
|
|
404
|
-
"tooltip": "
|
|
407
|
+
"tooltip": "Automatic adjustment of the modbus settings",
|
|
405
408
|
"xs": 12,
|
|
406
409
|
"sm": 12,
|
|
407
410
|
"md": 6,
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "sun2000",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.15.0",
|
|
5
5
|
"news": {
|
|
6
|
+
"0.15.0": {
|
|
7
|
+
"en": "dependency and configuration updates\ndisplay a clearly legible table bar #121\nmodbus-proxy write data also to the read cache #119",
|
|
8
|
+
"de": "abhängigkeits- und konfigurationsupdates\neine deutlich lesbare tischleiste #121 anzeigen\nmodbus-proxy schreibdaten auch zum lesespeicher #119",
|
|
9
|
+
"ru": "обновления зависимости и конфигурации\n#121\nmodbus-proxy пишут данные также кэшу #119",
|
|
10
|
+
"pt": "atualizações de dependência e configuração\nexibir uma barra de mesa claramente legível #121\nmodbus-proxy escrever dados também para o cache de leitura #119",
|
|
11
|
+
"nl": "afhankelijkheid en configuratie-updates\neen duidelijk leesbare tafelbalk #121 tonen\nmodbus-proxy schrijf gegevens ook naar de leescache #119",
|
|
12
|
+
"fr": "mises à jour de la dépendance et de la configuration\nafficher une barre de table clairement lisible #121\nmodbus-proxy écrire les données aussi au cache lecture #119",
|
|
13
|
+
"it": "aggiornamenti di dipendenza e configurazione\nvisualizza una barra da tavolo chiaramente leggibile #121\nmodbus-proxy scrivere i dati anche alla cache di lettura #119",
|
|
14
|
+
"es": "actualizaciones de dependencia y configuración\nmostrar una barra de mesa claramente legible #121\nmodbus-proxy escribe datos también al caché de lectura #119",
|
|
15
|
+
"pl": "aktualizacje zależności i konfiguracji\nwyświetla czytelny pasek tabeli # 121\nmodbus- proxy write data also to the read cache # 119",
|
|
16
|
+
"uk": "оновлення залежності та конфігурації\nдисплей чітко нижня білизна #121\nmodbus-proxy пише дані також для читання кеш #119",
|
|
17
|
+
"zh-cn": "依赖和配置更新\n显示清晰可见的表栏 # 121\nmodbus- 代理写入数据到读缓存 # 119"
|
|
18
|
+
},
|
|
6
19
|
"0.14.0": {
|
|
7
20
|
"en": "adjust for Responsive Design #121\nlock on asynchronous modbus code\nwriting data via the modbus-proxy #119\nread additional register data of Huawei Emma",
|
|
8
21
|
"de": "anpassung für Responsive Design #121\nasynchrone modbus-code blockieren\nschreiben von daten über die modbus-proxy #119\nweitere Registrierungsdaten von Huawei Emma lesen",
|
|
@@ -80,19 +93,6 @@
|
|
|
80
93
|
"pl": "aktualizacje zależności i konfiguracji\ndostosować role w ścieżce sterowania\nKontrola baterii: dodać zasilanie awaryjne SOC # 84\nfix: błędna nazwa stanu 'control.battery.ActivitSOC' z przepustnicą",
|
|
81
94
|
"uk": "оновлення залежності та конфігурації\nрегулювання ролі в шляху управління\nКонтроль акумулятора: додаємо резервну потужність SOC #84\nвиправити: неправильне ім'я держави `control.battery.targetSOC` з причепом",
|
|
82
95
|
"zh-cn": "依赖和配置更新\n调整控制路径中的角色\n电池控制: 添加备份功率 SOC #84\n修补:错误的州名`control.battery.targetSOC ' ,带有后端空间"
|
|
83
|
-
},
|
|
84
|
-
"0.9.0": {
|
|
85
|
-
"en": "dependency and configuration updates\nmodbus device remains active in standby on the inverter M2,M3",
|
|
86
|
-
"de": "abhängigkeits- und konfigurationsupdates\nmodbus-Gerät bleibt im Standby am Wechselrichter M2,M3 aktiv",
|
|
87
|
-
"ru": "обновления зависимости и конфигурации\nmodbus device остается активным в режиме ожидания на инверторе M2,M3",
|
|
88
|
-
"pt": "atualizações de dependência e configuração\ndispositivo modbus permanece ativo em espera no inversor M2, M3",
|
|
89
|
-
"nl": "afhankelijkheid en configuratie-updates\nmodbus apparaat blijft actief in stand-by op de omvormer M2,M3",
|
|
90
|
-
"fr": "mises à jour de la dépendance et de la configuration\nmodbus reste actif en veille sur l'onduleur M2,M3",
|
|
91
|
-
"it": "aggiornamenti di dipendenza e configurazione\ndispositivo modbus rimane attivo in standby sull'inverter M2,M3",
|
|
92
|
-
"es": "actualizaciones de dependencia y configuración\ndispositivo modbus permanece activo en espera en el inversor M2,M3",
|
|
93
|
-
"pl": "aktualizacje zależności i konfiguracji\nurządzenie modbus pozostaje aktywne w gotowości na falowniku M2, M3",
|
|
94
|
-
"uk": "оновлення залежності та конфігурації\nмотузковий пристрій залишається активним в автономному режимі на інверторі M2,M3",
|
|
95
|
-
"zh-cn": "依赖和配置更新\nmodbus设备仍然在反转器M2,M3上处于待机状态"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"titleLang": {
|
|
@@ -44,11 +44,10 @@ class ModbusServer {
|
|
|
44
44
|
},
|
|
45
45
|
readDeviceIdentification: () => { //function(addr)
|
|
46
46
|
this._addInfoStat('readDeviceIdentification');
|
|
47
|
-
console.log('DeviceIntification');
|
|
48
47
|
return {
|
|
49
48
|
0x00: 'ioBroker',
|
|
50
49
|
0x01: 'adapter.sun2000',
|
|
51
|
-
0x02:
|
|
50
|
+
0x02: this.adapter.version,
|
|
52
51
|
0x05: 'modbus-proxy',
|
|
53
52
|
0x97: '',
|
|
54
53
|
0xAB: ''
|
|
@@ -149,7 +148,7 @@ class ModbusServer {
|
|
|
149
148
|
//this.adapter.log.debug('Device Info '+JSON.stringify(device?.info));
|
|
150
149
|
const values = device.getHoldingRegisters(startAddr,length);
|
|
151
150
|
if (!this.adapter.isConnected) {
|
|
152
|
-
this._addInfoStat('#WaitForConnected',startAddr, length, unitId);
|
|
151
|
+
//this._addInfoStat('#WaitForConnected',startAddr, length, unitId);
|
|
153
152
|
await this.wait(500);
|
|
154
153
|
callback({ modbusErrorCode: 0x05, msg: 'Acknowledge (requested data will be available later)' });
|
|
155
154
|
} else {
|
|
@@ -176,29 +175,44 @@ class ModbusServer {
|
|
|
176
175
|
|
|
177
176
|
async _handleSetReg(address, data, unitId, callback) {
|
|
178
177
|
try {
|
|
179
|
-
|
|
180
178
|
this.log.debug('Modbus-proxy: Try to write data to id/address ' + unitId + '/' + address +'/'+ data);
|
|
181
|
-
|
|
179
|
+
const device = this.getDeviceInstance(unitId);
|
|
180
|
+
if (!device) {
|
|
181
|
+
await this.wait(500);
|
|
182
|
+
callback({ modbusErrorCode: 0x01, msg: 'Device ID '+unitId+' not supported by device' });
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
182
185
|
if (!this.adapter.isConnected) {
|
|
186
|
+
this.log.info('Modbus-proxy: please wait until connected.');
|
|
183
187
|
callback({ modbusErrorCode: 0x05, msg: 'Acknowledge (requested data will be available later)' });
|
|
184
188
|
return;
|
|
185
189
|
}
|
|
186
|
-
*/
|
|
187
190
|
if (!this.adapter.modbusClient) {
|
|
188
|
-
this.log.error('
|
|
191
|
+
this.log.error('Modbus-proxy: no modbus-client is registered!');
|
|
189
192
|
callback({ modbusErrorCode: 0x04, msg: 'Slave device failure (device reports internal error)' });
|
|
190
193
|
return;
|
|
191
194
|
}
|
|
192
195
|
this.adapter.modbusClient.setID(unitId);
|
|
193
196
|
if (Array.isArray(data)) {
|
|
194
197
|
await this.adapter.modbusClient.writeRegisters(address,data);
|
|
198
|
+
//write also to the read cache
|
|
199
|
+
device.addHoldingRegisters(address,data);
|
|
200
|
+
this._addInfoStat('setRegisterArray',address,data.length, unitId);
|
|
195
201
|
} else {
|
|
196
202
|
await this.adapter.modbusClient.writeRegister(address,data);
|
|
203
|
+
device.addHoldingRegisters(address,[data]);
|
|
204
|
+
this._addInfoStat('setRegister',address,1, unitId);
|
|
197
205
|
}
|
|
198
206
|
callback();
|
|
199
207
|
} catch (err) {
|
|
200
|
-
this.log.warn('Modbus-proxy: '+
|
|
201
|
-
|
|
208
|
+
this.log.warn('Modbus-proxy: can not write data to id/address ' + unitId + '/' + address +'/'+ data);
|
|
209
|
+
this.log.warn('Modbus-proxy: '+err?.message);
|
|
210
|
+
if (Array.isArray(data)) {
|
|
211
|
+
this._addInfoStat('#setRegisterArray',address,data.length, unitId);
|
|
212
|
+
} else {
|
|
213
|
+
this._addInfoStat('#setRegister',address,1, unitId);
|
|
214
|
+
}
|
|
215
|
+
await this.wait(500);
|
|
202
216
|
callback({ modbusErrorCode: err?.modbusCode, msg: err?.message });
|
|
203
217
|
}
|
|
204
218
|
}
|
package/main.js
CHANGED
|
@@ -61,7 +61,7 @@ class Sun2000 extends utils.Adapter {
|
|
|
61
61
|
},
|
|
62
62
|
ds: {
|
|
63
63
|
batteryUnits : true,
|
|
64
|
-
|
|
64
|
+
batteryPacks : false
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
|
|
@@ -379,6 +379,17 @@ class Sun2000 extends utils.Adapter {
|
|
|
379
379
|
meter: (i==0 && this.settings.integration === 0)
|
|
380
380
|
});
|
|
381
381
|
}
|
|
382
|
+
|
|
383
|
+
//SDongle
|
|
384
|
+
if (this.settings.integration === 0 && this.settings.sd.active) {
|
|
385
|
+
this.devices.push({
|
|
386
|
+
index: 0,
|
|
387
|
+
duration: 0,
|
|
388
|
+
modbusId: this.settings.sd.sDongleId,
|
|
389
|
+
driverClass: driverClasses.sdongle
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
|
|
382
393
|
//SmartLogger
|
|
383
394
|
if (this.settings.integration === 1) {
|
|
384
395
|
this.devices.push({
|
|
@@ -398,7 +409,7 @@ class Sun2000 extends utils.Adapter {
|
|
|
398
409
|
}
|
|
399
410
|
}
|
|
400
411
|
|
|
401
|
-
//
|
|
412
|
+
//EMMA
|
|
402
413
|
if (this.settings.integration === 2) {
|
|
403
414
|
this.devices.push({
|
|
404
415
|
index: 0,
|
|
@@ -410,16 +421,6 @@ class Sun2000 extends utils.Adapter {
|
|
|
410
421
|
});
|
|
411
422
|
}
|
|
412
423
|
|
|
413
|
-
//SDongle
|
|
414
|
-
if (this.settings.sd.active) {
|
|
415
|
-
this.devices.push({
|
|
416
|
-
index: 0,
|
|
417
|
-
duration: 0,
|
|
418
|
-
modbusId: this.settings.sd.sDongleId,
|
|
419
|
-
driverClass: driverClasses.sdongle
|
|
420
|
-
});
|
|
421
|
-
}
|
|
422
|
-
|
|
423
424
|
await this.adjustInverval();
|
|
424
425
|
await this.StartProcess();
|
|
425
426
|
} else {
|
|
@@ -451,12 +452,6 @@ class Sun2000 extends utils.Adapter {
|
|
|
451
452
|
}
|
|
452
453
|
await this.state.runPostProcessHooks(dataRefreshRate.high);
|
|
453
454
|
|
|
454
|
-
/*
|
|
455
|
-
if (this.modbusServer) {
|
|
456
|
-
await this.modbusServer.process(this.modbusClient);
|
|
457
|
-
}
|
|
458
|
-
*/
|
|
459
|
-
|
|
460
455
|
//Low Loop
|
|
461
456
|
if (timeLeft(nextLoop) > 0) {
|
|
462
457
|
for (const [i,item] of this.devices.entries()) {
|