Skip to content

Commit

Permalink
fix calculation for dynamic §34 EnWG
Browse files Browse the repository at this point in the history
  • Loading branch information
Sneak-L8 committed Oct 28, 2024
1 parent ecd7e87 commit 0cd096c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1249,10 +1249,9 @@ function getTotalPowerAvailable() {
* @returns the total current available in mA
*/
function getMaxCurrentEnWG() {
// TODO hier Code einfügen
if (isEnWGDefined() && isEnWGActive()) {
if (adapter.config.dynamicEnWG == true) {
const allowedPower = 3 * voltage * maxCurrentEnWG;
const allowedPower = 3 * voltage * maxCurrentEnWG / 1000;
return getAmperage(allowedPower + getSurplusWithoutWallbox(), get1p3pPhases());
} else {
return maxCurrentEnWG;
Expand Down Expand Up @@ -1702,6 +1701,7 @@ function checkWallboxPower() {
if (maxCurrentEnWG >= 0) {
if (maxCurrentEnWG < tempMax) {
tempMax = maxCurrentEnWG;
adapter.log.debug('Limit current to ' + maxCurrentEnWG + ' mA due to §34 EnWG');
}
}

Expand Down

0 comments on commit 0cd096c

Please sign in to comment.