From 80edbec7693ece68c192cb97437dd7cafa9a884f Mon Sep 17 00:00:00 2001 From: Bernhard Kirchen Date: Sat, 9 Mar 2024 14:34:08 +0100 Subject: [PATCH] Feature: DPL: keep inverter running if solar powered avoid shutting down the inverter at all if the calculated power limit falls below the lower power limit or if the power meter value is outdated. do this only if the inverter is setup to be solar powered. --- src/PowerLimiter.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/PowerLimiter.cpp b/src/PowerLimiter.cpp index efc5c0e5d..e069e2e4e 100644 --- a/src/PowerLimiter.cpp +++ b/src/PowerLimiter.cpp @@ -92,7 +92,15 @@ bool PowerLimiterClass::shutdown(PowerLimiterClass::Status status) _shutdownPending = true; _oTargetPowerState = false; - _oTargetPowerLimitWatts = Configuration.get().PowerLimiter.LowerPowerLimit; + + auto const& config = Configuration.get(); + if ( (Status::PowerMeterTimeout == status || + Status::CalculatedLimitBelowMinLimit == status) + && config.PowerLimiter.IsInverterSolarPowered) { + _oTargetPowerState = true; + } + + _oTargetPowerLimitWatts = config.PowerLimiter.LowerPowerLimit; return updateInverter(); }