From b0795a21310ec04a05b96736b5e9c11e698c77ee Mon Sep 17 00:00:00 2001 From: Bernhard Kirchen Date: Thu, 7 Mar 2024 21:15:43 +0100 Subject: [PATCH] DPL limit scaling: only for supported models --- src/PowerLimiter.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/PowerLimiter.cpp b/src/PowerLimiter.cpp index 32fa9762d..ec3542ad7 100644 --- a/src/PowerLimiter.cpp +++ b/src/PowerLimiter.cpp @@ -12,6 +12,7 @@ #include "Huawei_can.h" #include #include "MessageOutput.h" +#include "inverters/HMS_4CH.h" #include #include #include @@ -634,6 +635,14 @@ static int32_t scalePowerLimit(std::shared_ptr inverter, int32 std::list dcChnls = inverter->Statistics()->getChannelsByType(TYPE_DC); size_t dcTotalChnls = dcChnls.size(); + // according to the upstream projects README (table with supported devs), + // every 2 channel inverter has 2 MPPTs. then there are the HM*S* 4 channel + // models which have 4 MPPTs. all others have a different number of MPPTs + // than inputs. those are not supported by the current scaling mechanism. + bool supported = dcTotalChnls == 2; + supported |= dcTotalChnls == 4 && HMS_4CH::isValidSerial(inverter->serial()); + if (!supported) { return newLimit; } + // test for a reasonable power limit that allows us to assume that an input // channel with little energy is actually not producing, rather than // producing very little due to the very low limit.