iobroker.sun2000 0.17.1 → 0.18.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 CHANGED
@@ -21,7 +21,7 @@ Sentry reporting is used starting with js-controller 3.0.
21
21
 
22
22
  ## sun2000 adapter for ioBroker
23
23
 
24
- Read and write register data from Huawei SUN2000 inverter and LUNA2000 battery using Modbus TCP. Third-party devices can be integrated via the modbus proxy. Even a Huawei SmartLogger can be integrated.
24
+ Read and write register data from Huawei SUN2000 inverter and LUNA2000 battery using Modbus TCP. Third-party devices can access via the modbus proxy. Even a Huawei SmartLogger or an Huawei Emma can be integrated.
25
25
 
26
26
  [Huawei product information](https://solar.huawei.com/en/professionals/all-products?residential-smart-pv)
27
27
 
@@ -65,6 +65,10 @@ browse in the [wiki](https://github.com/bolliy/ioBroker.sun2000/wiki)
65
65
  Placeholder for the next version (at the beginning of the line):
66
66
  ### **WORK IN PROGRESS**
67
67
  -->
68
+ ### 0.18.0 (2024-12-11)
69
+ * dependency and configuration updates
70
+ * modbus-proxy: the modbus ID 250 is mapped to ID 0
71
+
68
72
  ### 0.17.1 (2024-11-21)
69
73
  * during the device status "Standby: detecting irradiation" (0x0002) register data is now also read from the inverter
70
74
  * The reading order of the battery data has been adjusted
package/io-package.json CHANGED
@@ -1,8 +1,21 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "sun2000",
4
- "version": "0.17.1",
4
+ "version": "0.18.0",
5
5
  "news": {
6
+ "0.18.0": {
7
+ "en": "dependency and configuration updates\nmodbus-proxy: the modbus ID 250 is mapped to ID 0",
8
+ "de": "abhängigkeits- und konfigurationsupdates\nmodbus-proxy: die modbus ID 250 wird auf ID 0 abgebildet",
9
+ "ru": "обновления зависимости и конфигурации\nmodbus-proxy: modbus ID 250 отображается на ID 0",
10
+ "pt": "atualizações de dependência e configuração\nmodbus-proxy: o modbus ID 250 é mapeado para ID 0",
11
+ "nl": "afhankelijkheid en configuratie-updates\nmodbus-proxy: de modbus ID 250 is toegewezen aan ID 0",
12
+ "fr": "mises à jour de la dépendance et de la configuration\nmodbus-proxy: le modbus ID 250 est mapé à ID 0",
13
+ "it": "aggiornamenti di dipendenza e configurazione\nmodbus-proxy: il modbus ID 250 è mappato su ID 0",
14
+ "es": "actualizaciones de dependencia y configuración\nmodbus-proxy: el modbus ID 250 se asigna al ID 0",
15
+ "pl": "aktualizacje zależności i konfiguracji\nmodbus- proxy: modbus ID 250 jest odwzorowany na ID 0",
16
+ "uk": "оновлення залежності та конфігурації\nmodbus-proxy: modbus ID 250 is mapped to ID 0",
17
+ "zh-cn": "依赖和配置更新\nmodbus-代用:modbus ID 250被映射到ID 0"
18
+ },
6
19
  "0.17.1": {
7
20
  "en": "during the device status \"Standby: detecting irradiation\" (0x0002) register data is now also read from the inverter\nThe reading order of the battery data has been adjusted",
8
21
  "de": "während des Gerätestatus \"Standby: Detektion von Bestrahlung\" (0x0002) werden nun auch Registerdaten aus dem Wechselrichter gelesen\nDie Lesereihenfolge der Batteriedaten wurde angepasst",
@@ -80,19 +93,6 @@
80
93
  "pl": "aktualizacje zależności i konfiguracji\nwyświetla czytelny pasek tabeli # 121\nmodbus- proxy write data also to the read cache # 119",
81
94
  "uk": "оновлення залежності та конфігурації\nдисплей чітко нижня білизна #121\nmodbus-proxy пише дані також для читання кеш #119",
82
95
  "zh-cn": "依赖和配置更新\n显示清晰可见的表栏 # 121\nmodbus- 代理写入数据到读缓存 # 119"
83
- },
84
- "0.14.0": {
85
- "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",
86
- "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",
87
- "ru": "#121\nзамок на асинхронном коде modbus\nзаписи данных через modbus-proxy #119\nпрочитать дополнительные данные реестра Huawei Эмма",
88
- "pt": "ajustar para Design responsivo #121\nbloqueio no código modbus assíncrono\nescrever dados através do modbus-proxy #119\nleia dados de registro adicionais de Huawei Emma",
89
- "nl": "aanpassen voor Responsive Design #121\nvergrendelen op asynchrone modbus-code\nschrijven van gegevens via de modbus-proxy #119\nlees extra registergegevens van Huawei Emma",
90
- "fr": "ajuster pour Responsive Design #121\nverrouillage du code modbus asynchrone\nécrire des données via le modbus-proxy #119\nlire les données supplémentaires du registre de Huawei Emma",
91
- "it": "regolazione per Responsive Design #121\nblocco su codice modbus asincrono\ndati di scrittura tramite il modbus-proxy #119\nleggere ulteriori dati di registro di Huawei Emma",
92
- "es": "ajuste para el diseño responsable #121\nbloqueo en código modbus asincrónico\nescribir datos a través del modbus-proxy #119\nleer más datos de registro de Huawei Emma",
93
- "pl": "dostosowanie do projektu Responsive Design # 121\nblokada asynchronicznego kodu modbusa\nzapisywanie danych za pośrednictwem modbus- proxy # 119\nprzeczytaj dodatkowe dane rejestru Huawei Emma",
94
- "uk": "регульований для відповідального дизайну #121\nблокування на коді asynchronous modbus\nнаписання даних через modbus-proxy #119\nчитати додаткові реєстраційні дані Huawei Emma",
95
- "zh-cn": "适应设计 # 121\n锁定同步调制解码\n通过modbus- 代理 119 写入数据\n读取 Huawei Emma 的额外注册数据"
96
96
  }
97
97
  },
98
98
  "titleLang": {
@@ -114,6 +114,10 @@ class ModbusServer {
114
114
  }
115
115
 
116
116
 
117
+ /**
118
+ * Close the Modbus-proxy server.
119
+ * @returns {Promise<void>}
120
+ */
117
121
  close() {
118
122
  return new Promise((resolve) => {
119
123
  this._isConnected = false;
@@ -128,9 +132,15 @@ class ModbusServer {
128
132
  });
129
133
  }
130
134
 
135
+ /**
136
+ * Finds the device instance (like InverterInfo) for a given modbus unitId.
137
+ * @param {number} unitId the modbus unitId
138
+ * @returns {InverterInfo|undefined} the device instance or undefined
139
+ */
131
140
  getDeviceInstance(unitId) {
132
141
  for (const device of this.adapter.devices) {
133
142
  if (device.instance) {
143
+ if (unitId === 250 && device.instance?.modbusId === 0) return device.instance;
134
144
  if (device.instance?.modbusId === unitId) return device.instance;
135
145
  }
136
146
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.sun2000",
3
- "version": "0.17.1",
3
+ "version": "0.18.0",
4
4
  "description": "sun2000",
5
5
  "author": {
6
6
  "name": "bolliy",
@@ -27,7 +27,7 @@
27
27
  "node": ">= 18.18.0"
28
28
  },
29
29
  "dependencies": {
30
- "@iobroker/adapter-core": "^3.2.2",
30
+ "@iobroker/adapter-core": "^3.2.3",
31
31
  "modbus-serial": "^8.0.17",
32
32
  "suncalc2": "^1.8.1",
33
33
  "tcp-port-used": "^1.0.2"
@@ -37,22 +37,22 @@
37
37
  "@alcalzone/release-script-plugin-iobroker": "^3.7.2",
38
38
  "@alcalzone/release-script-plugin-license": "^3.7.0",
39
39
  "@alcalzone/release-script-plugin-manual-review": "^3.7.0",
40
- "@eslint/eslintrc": "^3.1.0",
40
+ "@eslint/eslintrc": "^3.2.0",
41
41
  "@eslint/js": "^9.14.0",
42
42
  "@iobroker/adapter-dev": "^1.3.0",
43
43
  "@iobroker/testing": "^5.0.0",
44
44
  "@tsconfig/node16": "^16.1.3",
45
45
  "@types/chai": "^4.3.20",
46
46
  "@types/chai-as-promised": "^7.1.8",
47
- "@types/mocha": "^10.0.9",
48
- "@types/node": "^22.8.6",
47
+ "@types/mocha": "^10.0.10",
48
+ "@types/node": "^22.10.1",
49
49
  "@types/proxyquire": "^1.3.31",
50
50
  "@types/sinon": "^17.0.3",
51
51
  "@types/sinon-chai": "^3.2.12",
52
52
  "chai": "^4.5.0",
53
53
  "chai-as-promised": "^7.1.2",
54
- "eslint": "^9.14.0",
55
- "globals": "^15.11.0",
54
+ "eslint": "^9.16.0",
55
+ "globals": "^15.13.0",
56
56
  "mocha": "^10.8.2",
57
57
  "proxyquire": "^2.1.3",
58
58
  "sinon": "^19.0.2",