make calcPowerLimit respect DTU poll interval
This commit is contained in:
parent
f84bdf7287
commit
734d34b7a8
@ -175,8 +175,9 @@ int32_t PowerLimiterClass::calcPowerLimit(std::shared_ptr<InverterAbstract> inve
|
||||
|
||||
// Safety check, return on too old power meter values
|
||||
if (millis() - PowerMeter.getLastPowerMeterUpdate() < (30 * 1000)
|
||||
&& millis() - inverter->Statistics()->getLastUpdate() < (15 * 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.
|
||||
MessageOutput.println("[PowerLimiterClass::loop] Power Meter values too old. Using lower limit");
|
||||
return config.PowerLimiter_LowerPowerLimit;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user