iobroker.sun2000 2.3.1 → 2.3.2

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
@@ -65,6 +65,9 @@ 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
+ ### 2.3.2 (2025-10-24)
69
+ * allows again `control.battery.chargeFromGridFunction` when using the Emma
70
+
68
71
  ### 2.3.1 (2025-10-21)
69
72
  * fix: handle potential null values in set method of RegisterMap
70
73
 
@@ -75,7 +78,7 @@ browse in the [wiki](https://github.com/bolliy/ioBroker.sun2000/wiki)
75
78
  * inverter control: add same state for startup and shutdown an inverter [#199](https://github.com/bolliy/ioBroker.sun2000/issues/199)
76
79
  * fix: Device status name has been corrected [#202](https://github.com/bolliy/ioBroker.sun2000/pull/202)
77
80
  * add undocumented device status `Shutdown: End of the ESS discharge process`
78
- * emma control: new state ` emma.control.battery.ESSControlMode`. You can now configure EMMA with TOU-mode (Time of Use) to charge the battery from grid. [#200](https://github.com/bolliy/ioBroker.sun2000/discussions/200)
81
+ * emma control: new state `emma.control.battery.ESSControlMode`. You can now configure EMMA with TOU-mode (Time of Use) to charge the battery from grid. [#200](https://github.com/bolliy/ioBroker.sun2000/discussions/200)
79
82
  * if an Emma is installed, some control states of the inverter are deactivated (read only). Mainly for the grid settings.
80
83
  * deprecated control states have been removed.
81
84
  * a workaround for issue [#582](https://github.com/yaacov/node-modbus-serial/issues/582) of node-modbus-serial has been implemented.
package/io-package.json CHANGED
@@ -1,8 +1,21 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "sun2000",
4
- "version": "2.3.1",
4
+ "version": "2.3.2",
5
5
  "news": {
6
+ "2.3.2": {
7
+ "en": "allows again `control.battery.chargeFromGridFunction` when using the Emma",
8
+ "de": "erlaubt wieder `control.battery.chargeFromGridFunction` bei Verwendung der Emma",
9
+ "ru": "позволяет снова «control.battery.chargeFromGridFunction» при использовании Emma",
10
+ "pt": "permite novamente `control.battery.chargeFromGridFunction` ao usar a Emma",
11
+ "nl": "maakt het mogelijk opnieuw te controleren.battery.chargeFromGridFunction",
12
+ "fr": "permet de nouveau `control.battery.chargeFromGridFunction` lors de l'utilisation de l'Emma",
13
+ "it": "permette di nuovo `control.battery.chargeFromGridFunction` quando si utilizza Emma",
14
+ "es": "permite de nuevo 'control.battery.chargeDesdeGridFunction' al utilizar Emma",
15
+ "pl": "pozwala ponownie 'control.battery.chargeFromGridFunction' podczas korzystania z Emmy",
16
+ "uk": "дозволяє знову `control.battery.chargeЗ альбомуGridFunction` при використанні Емма",
17
+ "zh-cn": "允许在使用 Emma 时再次使用 \" control.battery. charge from GridFunction \" "
18
+ },
6
19
  "2.3.1": {
7
20
  "en": "fix: handle potential null values in set method of RegisterMap",
8
21
  "de": "fix: griff potenzielle Nullwerte in der eingestellten Methode des Registrierens Landkarte",
@@ -80,19 +93,6 @@
80
93
  "pl": "emma: ustala się czas systemowy [# 179] (https: / / github.com / bolliy / ioBroker.sun2000 / issues / 179)\ncontrol: add grid Power Scheduling Functional to inverter driver [# 176] (https: / / github.com / bolliy / ioBroker.sun2000 / issues / 176)",
81
94
  "uk": "emma: час системи визначається [#179](https://github.com/bolliy/ioBroker.sun2000/products/179)\ncontrol: add power scheduling features to inverter драйвер [#176](https://github.com/bolliy/ioBroker.sun2000/issues/176)",
82
95
  "zh-cn": "emma:系统时间正在确定 [# 179] (https://github.com/bolliy/ioBroker.sun2000/issues/179)\n控制:向反向驱动器添加电网电源调度功能[#176](https://github.com/bolliy/ioBroker.sun2000/issues/1976)"
83
- },
84
- "2.0.0": {
85
- "en": "add support for chargers via Emma and save the data in the charger path #171\nEstablish data consistency between meter.activePower and the power of the meter phases #174\nallows `control.battery.chargeFromGridFunction` when using the Emma\nbreaking change: \nthe value `sun2000.x.inverter.x.battery.runningStatus` is saved as a number. The translated value (such as STANDBY, RUNNING etc.) is stored in the path sun2000.x.inverter.x.battery.derived",
86
- "de": "unterstützung für Ladegeräte über Emma hinzufügen und die Daten im Ladepfad #171 speichern\nDatenkonsistenz zwischen meter.activePower und der Leistung der Zählerphasen #174 einstellen\nerlaubt `control.battery.chargeFromGridFunction` bei Verwendung der Emma\nänderung:\nder Wert `sun2000.x.inverter.x.battery.runningStatus` wird als Nummer gespeichert. Der übersetzte Wert (wie STANDBY, RUNNING etc.) wird im Pfad sun2000.x.inverter.x.battery.derived gespeichert",
87
- "ru": "добавьте поддержку зарядных устройств через Emma и сохраните данные в пути зарядного устройства #171\nУстановить согласованность данных между meter.activePower и мощностью фаз счетчика #174\nпозволяет «control.battery.chargeFromGridFunction» при использовании Emma\nпреодоление изменений:\nзначение 'sun2000.x.inverter.x.battery.runningStatus' сохраняется в виде числа. Переведенное значение (например, STANDBY, RUNNING и т.д.) сохраняется в пути sun2000.x.inverter.x.battery.derived",
88
- "pt": "adicionar suporte para carregadores via Emma e salvar os dados no caminho do carregador #171\nEstabelecer a consistência dos dados entre a potência do medidor e a potência das fases do medidor #174\npermite `control.battery.chargeFromGridFunction` ao usar a Emma\nalteração de quebra:\no valor `sun2000.x.inverter.x.battery.runningStatus` é salvo como um número. O valor traduzido (como STADBY, RUNNING etc.) é armazenado no caminho sun2000.x.inverter.x.battery.derived",
89
- "nl": "ondersteuning voor opladers toevoegen via Emma en de gegevens opslaan in het opladerpad #171\nVaststelling van gegevens consistentie tussen meter.activePower en het vermogen van de meter fasen #174\nstaat control.battery.chargeFromGridFunction\nbreek verandering:\nde waarde De vertaalde waarde (zoals STANDBY, RUNNING etc.) wordt opgeslagen in het pad sun2000.x.inverter.x.battery. afgeleide",
90
- "fr": "ajouter le support pour les chargeurs via Emma et enregistrer les données dans le chemin de chargeur #171\nÉtablir la cohérence des données entre le compteur.activePower et la puissance des phases du compteur #174\npermet `control.battery.chargeFromGridFunction` lors de l'utilisation de l'Emma\nrupture du changement:\nla valeur `sun2000.x.inverter.x.battery.runningStatus` est enregistrée en nombre. La valeur traduite (comme STANDBY, RUNNING, etc.) est stockée dans le chemin sun2000.x.inverter.x.battery.derived",
91
- "it": "aggiungere supporto per i caricatori tramite Emma e salvare i dati nel percorso del caricabatterie #171\nStabilire la consistenza dei dati tra metro.activePower e la potenza delle fasi metro #174\npermette `control.battery.chargeFromGridFunction` quando si utilizza Emma\ncambiamento di rottura:\nil valore `sun2000.x.inverter.x.battery.runningStatus` viene salvato come numero. Il valore tradotto (come STANDBY, RUNNING ecc.) è memorizzato nel percorso sun2000.x.inverter.x.battery.derived",
92
- "es": "añadir soporte para los cargadores a través de Emma y guardar los datos en la ruta del cargador #171\nEstablecer la coherencia de los datos entre el medidor.activePower y la potencia de las fases del medidor #174\npermite 'control.battery.chargeDesdeGridFunction' al usar Emma\ncambio de ruptura:\nel valor `sun2000.x.inverter.x.battery.runningStatus` se guarda como un número. El valor traducido (como STANDBY, RUNNING etc.) se almacena en el camino sun2000.x.inverter.x.battery.derived",
93
- "pl": "dodaj obsługę ładowarek przez Emmę i zapisz dane w ścieżce ładowarki # 171\nUstanowienie spójności danych między miernikiem. ActivePower i mocą faz miernika # 174\npozwala 'control.battery.chargeFromGridFunction' przy użyciu Emmy\nzmiana\nwartość 'sun2000.x.inverter.x.battery.runningStatus' jest zapisywana jako liczba. Wartość przetłumaczona (taka jak STANDBY, RUNNING itp.) jest przechowywana w ścieżce Sun2000.x.inverter.x.battery.deriver",
94
- "uk": "додати підтримку зарядних пристроїв через Емма і зберегти дані в шляху зарядного пристрою #171\nВстановити консистенцію даних між лічильником.activePower і потужністю метрових фаз #174\nдозволяє `control.battery.chargeЗ альбомуGridFunction` при використанні Емма\nзміна розриву:\nзначення `sun2000.x.inverter.x.battery.runningStatus` зберігається як номер. Перекладено значення (наприклад, STANDBY, RUNNING тощо) зберігається в шляху сонце2000.x.inverter.x.battery.derived",
95
- "zh-cn": "通过 Emma 添加对充电器的支持, 并保存充电器路径 # 171 中的数据\n在 meter.activePower和meter阶段的功率之间建立数据一致性 #174\n在使用 Emma 时允许“ control. battery. force from GridFunction ”\n断开更改 :\n将“sun2000.x.inverter.x.battery.running Status”作为数字保存。 翻译值( 如 STANDBY, RUNNING 等) 存储在路径 sun2000.x.inverter.x.battery. 衍生"
96
96
  }
97
97
  },
98
98
  "titleLang": {
@@ -55,8 +55,10 @@ class ServiceQueueMap {
55
55
  },
56
56
  {
57
57
  state: { id: 'battery.chargeFromGridFunction', name: 'Charge from grid', type: 'boolean', role: 'switch.enable', desc: 'reg: 47087, len: 1' },
58
- type: deviceType.battery,
59
- deactiveIfEmmaAvailable: true,
58
+ //type: deviceType.gridPowerControl,
59
+ //deactiveIfEmmaAvailable: true,
60
+ //It is currently unknown whether the ChargeFromGrid(AC) does not work when using the Emma.
61
+ type: deviceType.inverter, //
60
62
  fn: async event => {
61
63
  const ret = await this._writeRegisters(47087, event.value === true ? [1] : [0]);
62
64
  if (ret) {
@@ -570,7 +570,7 @@ class Emma extends DriverBase {
570
570
  this.log.debug('### PostHook for Emma - identify Subdevices charger');
571
571
  this.identifySubdevices('charger', this.modbusId)
572
572
  .then(ret => {
573
- this.log.debug(`### PostHook for Emma - ret: ${JSON.stringify(ret)}`);
573
+ this.log.debug(`### PostHook identification for Emmachargers - ret: ${JSON.stringify(ret)}`);
574
574
  for (const [i, charger] of ret.entries()) {
575
575
  const device = {
576
576
  index: i,
@@ -587,9 +587,9 @@ class Emma extends DriverBase {
587
587
  });
588
588
  this.identifySubdevices('sun2000', this.modbusId)
589
589
  .then(ret => {
590
- this.log.debug(`### PostHook for InverterSun2000 - ret: ${JSON.stringify(ret)}`);
591
- for (const [i, inverter] of ret.entries()) {
592
- this.log.info(`inverter ${i} sun2000 found - modbus id: ${inverter.slave_id}`);
590
+ this.log.debug(`### PostHook indentification for Inverter Sun2000 - ret: ${JSON.stringify(ret)}`);
591
+ for (const [, inverter] of ret.entries()) {
592
+ this.log.info(`${this._name} identify subdevice an inverter sun2000: OID=${inverter.obj_id}, modbus id: ${inverter.slave_id}`);
593
593
  }
594
594
  })
595
595
  .catch(err => {
@@ -153,11 +153,12 @@ class InverterSun2000 extends DriverBase {
153
153
  this.identifySubdevices('sun2000', this.modbusId)
154
154
  .then(ret => {
155
155
  this.log.debug(`### PostHook for InverterSun2000 - ret: ${JSON.stringify(ret)}`);
156
- for (const [i, charger] of ret.entries()) {
156
+ for (const [i, inverter] of ret.entries()) {
157
+ this.log.info(`${this._name} identifies an inverter sun2000: OID=${inverter.obj_id}, modbus id: ${inverter.slave_id}`);
157
158
  const device = {
158
159
  index: i,
159
160
  duration: 0,
160
- modbusId: charger.slave_id,
161
+ modbusId: inverter.slave_id,
161
162
  driverClass: driverClasses.emmaCharger,
162
163
  };
163
164
  this.adapter.devices.push(device);
package/lib/register.js CHANGED
@@ -80,7 +80,7 @@ class Registers {
80
80
  let usableSurplusPower = 0;
81
81
 
82
82
  if (this.adapter.control) {
83
- surplusPower += feedinPower;
83
+ surplusPower = feedinPower;
84
84
 
85
85
  const minSoc = this.adapter.control.get('usableSurplus.minSoc')?.value ?? 0;
86
86
  let bufferSoc = this.adapter.control.get('usableSurplus.bufferSoc')?.value ?? 0;
@@ -88,13 +88,21 @@ class Registers {
88
88
  const soc = this.stateCache.get('collected.SOC')?.value ?? 0;
89
89
  const allowNegativeValue = this.adapter.control.get('usableSurplus.allowNegativeValue')?.value ?? false;
90
90
  const hysterese = this.adapter.control.get('usableSurplus.bufferHysteresis')?.value ?? 0;
91
- // chargeDischarge
91
+ // discharge power is negative
92
92
  if (chargeDischarge < 0) {
93
93
  surplusPower += chargeDischarge;
94
94
  }
95
- if (soc >= minSoc) {
95
+
96
+ let threshold = hysterese / 2;
97
+ if (this.bufferOn) {
98
+ threshold = -threshold;
99
+ }
100
+
101
+ if (soc > minSoc) {
102
+ // charge power is positive
96
103
  if (chargeDischarge > 0) surplusPower += chargeDischarge;
97
- if (bufferSoc === 0 || soc < bufferSoc) {
104
+
105
+ if (bufferSoc === 0 || soc < bufferSoc + threshold) {
98
106
  surplusPower -= residualPower / 1000;
99
107
  }
100
108
  }
@@ -102,11 +110,6 @@ class Registers {
102
110
  usableSurplusPower = surplusPower;
103
111
 
104
112
  if (bufferSoc > 0) {
105
- let threshold = hysterese / 2;
106
-
107
- if (this.bufferOn) {
108
- threshold = -threshold;
109
- }
110
113
  if (soc > minSoc && soc >= bufferSoc + threshold) {
111
114
  this.bufferOn = true;
112
115
  const bufferPower = this.adapter.control.get('usableSurplus.bufferPower')?.value ?? 0;
@@ -165,7 +168,6 @@ class Registers {
165
168
  this.stateCache.set('collected.inputPower', inPower, { type: 'number', renew: true });
166
169
  this.stateCache.set('collected.inputPowerWithEfficiencyLoss', inPowerEff, { type: 'number' });
167
170
  this.stateCache.set('collected.activePower', actPower, { type: 'number', renew: true });
168
- //this.stateCache.set('collected.feed-inPower', feedinPower, { type: 'number' }); //positive -> power to grid
169
171
  this.stateCache.set('collected.houseConsumption', houseConsum, { type: 'number' });
170
172
  this.stateCache.set('collected.chargeDischargePower', chargeDischarge, { type: 'number' });
171
173
  this.stateCache.set('collected.usableSurplusPower', surplusArray[1], {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.sun2000",
3
- "version": "2.3.1",
3
+ "version": "2.3.2",
4
4
  "description": "sun2000",
5
5
  "author": {
6
6
  "name": "bolliy",