Skip to content

Commit

Permalink
evse.cpp: fix limiting current when priority charging
Browse files Browse the repository at this point in the history
  • Loading branch information
dingo35 committed Aug 20, 2024
1 parent 29aaeb6 commit 18654be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion SmartEVSE-3/src/evse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,6 @@ void CalcBalancedCurrent(char mod) {

// ############### shortage of power #################

IsetBalanced = ActiveEVSE * MinCurrent * 10; // retain old software behaviour: set minimal "MinCurrent" charge per active EVSE
//so now we have a shortage of power
if (Mode == MODE_SOLAR) {
// ----------- Check to see if we have to continue charging on solar power alone ----------
Expand Down Expand Up @@ -1254,10 +1253,13 @@ void CalcBalancedCurrent(char mod) {
if (LimitedByMaxSumMains && MaxSumMainsTime) {
if (MaxSumMainsTimer == 0) // has expired, so set timer
MaxSumMainsTimer = MaxSumMainsTime * 60;
IsetBalanced = ActiveEVSE * MinCurrent * 10; // retain old software behaviour: set minimal "MinCurrent" charge per active EVSE
} else {
if (!(Mode == MODE_SOLAR && SolarStopTimer)) { // in that case the SolarStopTimer in Timer1s loop will take care of no power
NoCurrent++; // Flag NoCurrent left
_LOG_I("No Current!!\n");
} else {
IsetBalanced = ActiveEVSE * MinCurrent * 10; // retain old software behaviour: set minimal "MinCurrent" charge per active EVSE
}
}
} else { // we have enough current
Expand Down

0 comments on commit 18654be

Please sign in to comment.