resolving merge conflict
adding missing statement from merge fixing a bug introduced in merge
This commit is contained in:
parent
fc5089e70b
commit
9efe076cc2
@ -174,8 +174,10 @@ int32_t PowerLimiterClass::calcPowerLimit(std::shared_ptr<InverterAbstract> inve
|
|||||||
int32_t newPowerLimit = round(PowerMeter.getPowerTotal());
|
int32_t newPowerLimit = round(PowerMeter.getPowerTotal());
|
||||||
|
|
||||||
// Safety check, return on too old power meter values
|
// Safety check, return on too old power meter values
|
||||||
if ((millis() - PowerMeter.getLastPowerMeterUpdate()) > (30 * 1000)) {
|
if (millis() - PowerMeter.getLastPowerMeterUpdate() > (30 * 1000)
|
||||||
// If the power meter values are older than 30 seconds,
|
&& (millis() - inverter->Statistics()->getLastUpdate()) > (config.Dtu_PollInterval * 3 * 1000)) {
|
||||||
|
// If the power meter values are older than 30 seconds,
|
||||||
|
// and the Inverter Stats are older then 3x the poll interval
|
||||||
// set the limit to config.PowerLimiter_LowerPowerLimit for safety reasons.
|
// set the limit to config.PowerLimiter_LowerPowerLimit for safety reasons.
|
||||||
MessageOutput.println("[PowerLimiterClass::loop] Power Meter values too old. Using lower limit");
|
MessageOutput.println("[PowerLimiterClass::loop] Power Meter values too old. Using lower limit");
|
||||||
return config.PowerLimiter_LowerPowerLimit;
|
return config.PowerLimiter_LowerPowerLimit;
|
||||||
@ -193,8 +195,9 @@ int32_t PowerLimiterClass::calcPowerLimit(std::shared_ptr<InverterAbstract> inve
|
|||||||
// If the inverter the behind the power meter (part of measurement),
|
// If the inverter the behind the power meter (part of measurement),
|
||||||
// the produced power of this inverter has also to be taken into account.
|
// the produced power of this inverter has also to be taken into account.
|
||||||
// We don't use FLD_PAC from the statistics, because that
|
// We don't use FLD_PAC from the statistics, because that
|
||||||
// data might be too old and unrelieable.
|
// data might be too old and unreliable.
|
||||||
newPowerLimit += _lastRequestedPowerLimit;
|
float acPower = inverter->Statistics()->getChannelFieldValue(TYPE_AC, (ChannelNum_t) config.PowerLimiter_InverterChannelId, FLD_PAC);
|
||||||
|
newPowerLimit += static_cast<int>(acPower);
|
||||||
}
|
}
|
||||||
|
|
||||||
float efficency = inverter->Statistics()->getChannelFieldValue(TYPE_AC, (ChannelNum_t) config.PowerLimiter_InverterChannelId, FLD_EFF);
|
float efficency = inverter->Statistics()->getChannelFieldValue(TYPE_AC, (ChannelNum_t) config.PowerLimiter_InverterChannelId, FLD_EFF);
|
||||||
@ -217,7 +220,7 @@ int32_t PowerLimiterClass::calcPowerLimit(std::shared_ptr<InverterAbstract> inve
|
|||||||
|
|
||||||
int32_t upperPowerLimit = config.PowerLimiter_UpperPowerLimit;
|
int32_t upperPowerLimit = config.PowerLimiter_UpperPowerLimit;
|
||||||
if (consumeSolarPowerOnly && (upperPowerLimit > adjustedVictronChargePower)) {
|
if (consumeSolarPowerOnly && (upperPowerLimit > adjustedVictronChargePower)) {
|
||||||
// Battery voltage too low, use Victron solar power (corrected by efficency factor) only
|
// Battery voltage too low, use Victron solar power (corrected by efficiency factor) only
|
||||||
upperPowerLimit = adjustedVictronChargePower;
|
upperPowerLimit = adjustedVictronChargePower;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user