Skip to content

Commit

Permalink
Fix: solar: base maxTotalIncrease on currentLimit
Browse files Browse the repository at this point in the history
We used currentOutputAc before which could result in us thinking that we can go even higher even though the limit was already at the maximum.
  • Loading branch information
AndreasBoehm committed Feb 7, 2025
1 parent 3597684 commit 396cfa8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/PowerLimiterSolarInverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ uint16_t PowerLimiterSolarInverter::getMaxIncreaseWatts() const
return getConfiguredMaxPowerWatts();
}

// the maximum increase possible for this inverter
int16_t maxTotalIncrease = getConfiguredMaxPowerWatts() - getCurrentOutputAcWatts();
// we must not substract the current AC output here, but the current
// limit value, so we avoid trying to produce even more even if the
// inverter is already at the maximum limit value (the actual AC
// output may be less than the inverter's current power limit).
int16_t maxTotalIncrease = getConfiguredMaxPowerWatts() - getCurrentLimitWatts();

if (isSmartBufferPowered()) {
// smart buffer inverters can always increase the power to the configured max
Expand Down

0 comments on commit 396cfa8

Please sign in to comment.