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 #58

Merged
merged 7 commits into from
Mar 11, 2024
Merged

Dev #58

Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ browse in the [wiki](https://github.com/bolliy/ioBroker.sun2000/wiki)
Placeholder for the next version (at the beginning of the line):
### **WORK IN PROGRESS**
-->
### **WORK IN PROGRESS**
* Config page restructured
* Read only the required string data
* fix interval medium

### 0.5.0 (2024-03-07)
* Integration of [Huawei SmartLogger](https://support.huawei.com/enterprise/de/doc/EDOC1100130069/d8a00460)
* some meter states the unit was changed (for example sun2000.0.meter.activePowerL1) (#56)
Expand Down
9 changes: 5 additions & 4 deletions admin/i18n/de/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@
"delay after modbus connected": "Verzögerung nach der Modbus-Verbindung",
"automatic adjustment of the modbus settings": "automatische Anpassung der Modbus-Einstellungen",
"ms.aktive": "Modbus-Proxy aktiv",
"Modbus-proxy via TCP for read-only is active": "Modbus-Proxy über TCP (nur lesend) ist aktiv",
"Modbus-proxy via TCP for read-only is active": "Modbus-Proxy über TCP zum Nur-Lesen ist aktiv",
"ms.address": "Modbus-Proxy-IP-Adresse",
"If want to listen only at localhost use 127.0.0.1": "Wenn Sie nur auf localhost hören möchten, verwenden Sie 127.0.0.1",
"If want to listen only at localhost use 127.0.0.1": "Wenn Sie nur auf localhost zuhören möchten, verwenden Sie 127.0.0.1",
"ms.port": "Modbus-Proxy-TCP-Port",
"The Modbus-proxy TCP port": "Der Modbus-Proxy-TCP-Port",
"The SDongle modbus ID": "Die SDongle-Modbus-ID – normalerweise 100",
"ms.log": "Erweiterte Protokollierung",
"Advanced logging": "Erweiterte Protokollierung von Modbus-Transaktionen",
"sl.aktive": "SmartLogger aktiv",
"SmartLogger active": "SmartLogger aktiv",
"sl.meterId": "Modbus-ID des Zählers",
"The Meter modbus ID": "Die Modbus-ID des Smart Power Sensors"
"sl.meterId": "Modbus-ID des SmartLogger-Messgeräts",
"The Meter modbus ID": "Die Modbus-ID des Messgeräts",
"sd.active": "SDongle aktiv"
}
3 changes: 2 additions & 1 deletion admin/i18n/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@
"sl.aktive" : "SmartLogger active",
"SmartLogger active" : "SmartLogger active",
"sl.meterId" : "SmartLogger meter modbus ID",
"The Meter modbus ID" : "The Meter modbus ID"
"The Meter modbus ID" : "The Meter modbus ID",
"sd.active" : "SDongle active"
}
3 changes: 2 additions & 1 deletion admin/i18n/es/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@
"sl.aktive": "SmartLogger activo",
"SmartLogger active": "SmartLogger activo",
"sl.meterId": "ID modbus del medidor SmartLogger",
"The Meter modbus ID": "El ID modbus del medidor"
"The Meter modbus ID": "El ID modbus del medidor",
"sd.active": "SDongle activo"
}
3 changes: 2 additions & 1 deletion admin/i18n/fr/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@
"sl.aktive": "SmartLogger actif",
"SmartLogger active": "SmartLogger actif",
"sl.meterId": "ID Modbus du compteur SmartLogger",
"The Meter modbus ID": "L'ID Modbus du compteur"
"The Meter modbus ID": "L'ID Modbus du compteur",
"sd.active": "SDongle actif"
}
3 changes: 2 additions & 1 deletion admin/i18n/it/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@
"sl.aktive": "SmartLogger attivo",
"SmartLogger active": "SmartLogger attivo",
"sl.meterId": "ID modbus del contatore SmartLogger",
"The Meter modbus ID": "L'ID del modbus del contatore"
"The Meter modbus ID": "L'ID del modbus del contatore",
"sd.active": "SDongle attivo"
}
3 changes: 2 additions & 1 deletion admin/i18n/nl/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@
"sl.aktive": "SmartLogger actief",
"SmartLogger active": "SmartLogger actief",
"sl.meterId": "Modbus-ID van SmartLogger-meter",
"The Meter modbus ID": "De Modbus-ID van de meter"
"The Meter modbus ID": "De Modbus-ID van de meter",
"sd.active": "SDongle actief"
}
3 changes: 2 additions & 1 deletion admin/i18n/pl/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@
"sl.aktive": "SmartLogger aktywny",
"SmartLogger active": "SmartLogger aktywny",
"sl.meterId": "Identyfikator Modbus miernika SmartLogger",
"The Meter modbus ID": "Identyfikator Modbus miernika"
"The Meter modbus ID": "Identyfikator Modbus miernika",
"sd.active": "SDongle aktywny"
}
3 changes: 2 additions & 1 deletion admin/i18n/pt/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@
"sl.aktive": "SmartLogger ativo",
"SmartLogger active": "SmartLogger ativo",
"sl.meterId": "ID modbus do medidor SmartLogger",
"The Meter modbus ID": "O ID do modbus do medidor"
"The Meter modbus ID": "O ID do modbus do medidor",
"sd.active": "SD Dongle ativo"
}
3 changes: 2 additions & 1 deletion admin/i18n/ru/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@
"sl.aktive": "SmartLogger активен",
"SmartLogger active": "SmartLogger активен",
"sl.meterId": "Идентификатор Modbus счетчика SmartLogger",
"The Meter modbus ID": "Идентификатор Modbus измерителя"
"The Meter modbus ID": "Идентификатор Modbus измерителя",
"sd.active": "SD-ключ активен"
}
3 changes: 2 additions & 1 deletion admin/i18n/uk/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@
"sl.aktive": "SmartLogger активний",
"SmartLogger active": "SmartLogger активний",
"sl.meterId": "ID лічильника Modbus SmartLogger",
"The Meter modbus ID": "ID лічильника modbus"
"The Meter modbus ID": "ID лічильника modbus",
"sd.active": "SDongle активний"
}
3 changes: 2 additions & 1 deletion admin/i18n/zh-cn/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@
"sl.aktive": "SmartLogger 激活",
"SmartLogger active": "SmartLogger 激活",
"sl.meterId": "SmartLogger电表modbus ID",
"The Meter modbus ID": "仪表 modbus ID"
"The Meter modbus ID": "仪表 modbus ID",
"sd.active": "SD加密狗激活"
}
95 changes: 74 additions & 21 deletions admin/jsonConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
"address": {
"type": "text",
"label": "address",
"newLine": true,
"tooltip": "The device ip address",
"sm": 12,
"md": 8,
"lg": 2
"lg": 2,
"newLine": true
},
"port": {
"type": "number",
Expand All @@ -35,7 +35,7 @@
"label": "Modbus inverter IDs",
"sm": 12,
"md": 8,
"lg": 3,
"lg": 2,
"default": "1",
"newLine": true,
"tooltip": "The modbus inverter IDs, separated with character ,"
Expand All @@ -49,25 +49,29 @@
"newLine": true,
"tooltip": "Update interval to update the values from the inverters"
},
"mainHdr2": {
"mainHdr3": {
"newLine": true,
"type": "header",
"text": "SmartLogger Settings",
"text": "SDongle Settings",
"size": 2
},
"sl_active": {
"chipsTxt": {
"type": "staticText",
"text": "Provides the collected data from the SDongle",
"newLine": true
},
"sd_active": {
"type": "checkbox",
"label": "sl.aktive",
"label": "sd.active",
"newLine": true,
"tooltip": "SmartLogger active"
"tooltip": "SDongle active"
},
"sl_meterId": {
"sDongleId": {
"type": "text",
"label": "sl.meterId",
"label": "SDongleA modbus ID",
"lg": 2,
"newLine": true,
"tooltip": "The Meter modbus ID"
}
"newLine": true
}
}
},
"tab2": {
Expand Down Expand Up @@ -113,6 +117,37 @@
}
},
"tab3": {
"type": "panel",
"label": "Smart Logger",
"items": {
"mainHdr3": {
"newLine": true,
"type": "header",
"text": "SmartLogger Settings",
"size": 2
},
"chipsTxt": {
"type": "staticText",
"text": "The SmartLogger monitors and manages PV systems and energy storage systems. It converges all ports, converts protocols, collects and stores data, and centrally monitors and maintains the devices in the systems.",
"newLine": true
},
"sl_active": {
"type": "checkbox",
"label": "sl.aktive",
"newLine": true,
"tooltip": "SmartLogger active"
},
"sl_meterId": {
"type": "text",
"label": "sl.meterId",
"lg": 2,
"newLine": true,
"tooltip": "The Meter modbus ID"
}

}
},
"tab4": {
"type": "panel",
"label": "Modbus-proxy",
"items": {
Expand Down Expand Up @@ -152,20 +187,38 @@
"newLine": true,
"tooltip" : "The Modbus-proxy TCP port"
},
"sDongleId": {
"type": "text",
"label": "SDongleA modbus ID",
"lg": 2,
"newLine": true,
"tooltip": "The SDongle modbus ID"
},
"ms_log": {
"type": "checkbox",
"label": "ms.log",
"newLine": true,
"tooltip": "Advanced logging"
}
}
}
},
"tab5": {
"type": "panel",
"label": "help",
"items": {
"Hdr1": {
"newLine": true,
"type": "header",
"text": "How do I get help?",
"size": 2
},
"chipsTxt": {
"type": "staticText",
"text": "Do you need help? There are multiple ways of getting support. ",
"newLine": true
},
"staticLink1": {
"type": "staticLink",
"text": "Available help options",
"href": "https://github.com/bolliy/ioBroker.sun2000/wiki/Hilfe-(support)",
"icon": "info",
"button": true,
"newLine": true
}
}
}
}
}
13 changes: 5 additions & 8 deletions docs/calculation.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,15 @@ The following variables are used or can be calculated yourself:
- `Discharge capacity daily`: sun2000.0.inverter.0.battery.currentDayDischargeCapacity
- `Discharge capacity total`: sun2000.0.inverter.0.battery.totalDischarge
- `SOC`: sun2000.0.collected.SOC
- `Daily Solar yield`: sun2000.0.collected.dailySolarYield
- [`Daily Solar yield`](https://github.com/bolliy/ioBroker.sun2000/wiki/Energieertrag-%28Yield-today%29/#dailysolaryield): sun2000.0.collected.dailySolarYield
- `Grid total, positive active Energy`: sun2000.0.meter.positiveActiveEnergy
- `Grid total, reverse active Energy`: sun2000.0.meter.reverseActiveEnergy
- `Grid active power`: sun2000.0.meter.activePower
- `active power`: sun2000.0.collected.activePower
- `Energy yield Accumulated`: sun2000.0.collected.accumulatedEnergyYield
- `Energy yield Daily`: sun2000.0.collected.dailyEnergyYield
- `Daily input yield`: sun2000.0.collected.dailyInputYield
- `CommsumptionSum`: sun2000.0.collected.consumptionSum
- `Self-consumption %`: (sun2000.0.collected.accumulatedEnergyYield+sun2000.0.collected.totalCharge-sun2000.0.inverter.0.battery.totalDischarge- sun2000.0.meter.positiveActiveEnergy) / (sun2000.0.collected.accumulatedEnergyYield + sun2000.0.collected.totalCharge - sun2000.0.inverter.0.battery.totalDischarge)
- [`Energy yield Daily`](https://github.com/bolliy/ioBroker.sun2000/wiki/Energieertrag-(Yield-today)): sun2000.0.collected.dailyEnergyYield
- [`Daily input yield`](https://github.com/bolliy/ioBroker.sun2000/wiki/Energieertrag-%28Yield-today%29/#dailyinputyield): sun2000.0.collected.dailyInputYield
- [`CommsumptionSum`](https://github.com/bolliy/ioBroker.sun2000/wiki/Hausverbrauch-(consumption)): sun2000.0.collected.consumptionSum
- [`Self-consumption %`](https://github.com/bolliy/ioBroker.sun2000/wiki/Eigenverbrauch-(self%E2%80%90consumption)): (sun2000.0.collected.accumulatedEnergyYield+sun2000.0.collected.totalCharge-sun2000.0.inverter.0.battery.totalDischarge- sun2000.0.meter.positiveActiveEnergy) / (sun2000.0.collected.accumulatedEnergyYield + sun2000.0.collected.totalCharge - sun2000.0.inverter.0.battery.totalDischarge)
- `Self-Sufficiency %`: (sun2000.0.collected.consumptionSum - sun2000.0.meter.reverseActiveEnergy) / sun2000.0.collected.consumptionSum




3 changes: 2 additions & 1 deletion io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@
"port": 502,
"modbusIds": "1",
"updateInterval": 20,
"sd_active": false,
"sDongleId": "100",
"timeout": 10000,
"delay": 0,
"connectDelay": 5000,
Expand All @@ -184,7 +186,6 @@
"ms_address": "0.0.0.0",
"ms_port": 502,
"ms_log": false,
"sDongleId": "100",
"sl_active": false,
"sl_meterId": 11
},
Expand Down
2 changes: 1 addition & 1 deletion lib/drivers/driver_base.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class DriverBase {
if (!reg.refresh) continue;
//v0.4.0
let interval = this.adapter.settings.lowInterval;
if ( refreshRate === dataRefreshRate.medium) interval = this.adapter.settings.mediumInterval;
if ( reg.refresh === dataRefreshRate.medium) interval = this.adapter.settings.mediumInterval;
if ((start - lastread) < interval) {
this.adapter.log.debug('Last read reg for '+(start - lastread)+' ms - '+reg?.info);
continue;
Expand Down
4 changes: 2 additions & 2 deletions lib/drivers/driver_inverter.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,10 @@ class InverterSun2000 extends DriverBase{
reg.states.push(stateCu);
reg.states.push(statePo);
}
reg.length = noPVString * 2;
}
stringFieldsTemplate.generated = noPVString;
//this.adapter.log.debug(JSON.stringify(reg));

}
},
//After 32000 read
Expand Down Expand Up @@ -627,7 +627,7 @@ class InverterSun2000 extends DriverBase{
fn : (path) => {
const disCharge = this.stateCache.get(path+'battery.currentDayDischargeCapacity')?.value;
const charge = this.stateCache.get(path+'battery.currentDayChargeCapacity')?.value;
let inputYield = this.stateCache.get(path+'dailyEnergyYield')?.value + (charge - disCharge)*0.97;
let inputYield = this.stateCache.get(path+'dailyEnergyYield')?.value *0.97 + charge - disCharge;

if (inputYield < 0 || isNaN(inputYield)) inputYield = 0;
this.stateCache.set(path+'derived.dailyInputYield', inputYield, {type: 'number'});
Expand Down
Loading
Loading