Skip to content

Commit

Permalink
Fix: R48xx: only interlock against battery-powered inverters
Browse files Browse the repository at this point in the history
  • Loading branch information
schlimmchen committed Feb 8, 2025
1 parent 6d2d85b commit 3bab4f3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion include/PowerLimiter.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ class PowerLimiterClass {
Mode getMode() const { return _mode; }
bool usesBatteryPoweredInverter();
bool usesSmartBufferPoweredInverter();
bool isGovernedInverterProducing();

// used to interlock Huawei R48xx grid charger against battery-powered inverters
bool isGovernedBatteryPoweredInverterProducing();

private:
void loop();
Expand Down
4 changes: 2 additions & 2 deletions src/PowerLimiter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -931,10 +931,10 @@ bool PowerLimiterClass::usesSmartBufferPoweredInverter()
return false;
}

bool PowerLimiterClass::isGovernedInverterProducing()
bool PowerLimiterClass::isGovernedBatteryPoweredInverterProducing()
{
for (auto const& upInv : _inverters) {
if (upInv->isProducing()) { return true; }
if (upInv->isBatteryPowered() && upInv->isProducing()) { return true; }
}
return false;
}
2 changes: 1 addition & 1 deletion src/gridcharger/huawei/Controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ void Controller::loop()
_autoPowerEnabledCounter = 10;
}

if (PowerLimiter.isGovernedInverterProducing()) {
if (PowerLimiter.isGovernedBatteryPoweredInverterProducing()) {
_setParameter(0.0, Setting::OnlineCurrent);
// Don't run auto mode for a second now. Otherwise we may send too much over the CAN bus
_autoModeBlockedTillMillis = millis() + 1000;
Expand Down

0 comments on commit 3bab4f3

Please sign in to comment.