SoC based threshold detection fix (#320)

This commit is contained in:
MalteSchm 2023-07-24 13:03:12 +02:00 committed by GitHub
parent 8b01fa07cc
commit 18c464e524
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -587,9 +587,8 @@ bool PowerLimiterClass::isStartThresholdReached(std::shared_ptr<InverterAbstract
// Check if the Battery interface is enabled and the SOC start threshold is reached
if (config.Battery_Enabled
&& config.PowerLimiter_BatterySocStartThreshold > 0.0
&& (millis() - Battery.stateOfChargeLastUpdate) < 60000
&& Battery.stateOfCharge >= config.PowerLimiter_BatterySocStartThreshold) {
return true;
&& (millis() - Battery.stateOfChargeLastUpdate) < 60000) {
return Battery.stateOfCharge >= config.PowerLimiter_BatterySocStartThreshold;
}
// Otherwise we use the voltage threshold
@ -608,9 +607,8 @@ bool PowerLimiterClass::isStopThresholdReached(std::shared_ptr<InverterAbstract>
// Check if the Battery interface is enabled and the SOC stop threshold is reached
if (config.Battery_Enabled
&& config.PowerLimiter_BatterySocStopThreshold > 0.0
&& (millis() - Battery.stateOfChargeLastUpdate) < 60000
&& Battery.stateOfCharge <= config.PowerLimiter_BatterySocStopThreshold) {
return true;
&& (millis() - Battery.stateOfChargeLastUpdate) < 60000) {
return Battery.stateOfCharge <= config.PowerLimiter_BatterySocStopThreshold;
}
// Otherwise we use the voltage threshold
@ -674,9 +672,8 @@ bool PowerLimiterClass::useFullSolarPassthrough(std::shared_ptr<InverterAbstract
// Check if the Battery interface is enabled and the SOC stop threshold is reached
if (config.Battery_Enabled
&& config.PowerLimiter_FullSolarPassThroughSoc > 0.0
&& (millis() - Battery.stateOfChargeLastUpdate) < 60000
&& Battery.stateOfCharge >= config.PowerLimiter_FullSolarPassThroughSoc) {
return true;
&& (millis() - Battery.stateOfChargeLastUpdate) < 60000) {
return Battery.stateOfCharge >= config.PowerLimiter_FullSolarPassThroughSoc;
}
// Otherwise we use the voltage threshold