From 96ef182d38cb0259ae1b325e1e9b0a38503fef65 Mon Sep 17 00:00:00 2001 From: Thomas Basler Date: Sat, 25 Jun 2022 11:13:25 +0200 Subject: [PATCH] Fixed issue with irradiation calculation getChannelMaxPower is zero based while the first string is 1 based on getChannelFieldData --- lib/Hoymiles/src/inverters/InverterAbstract.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Hoymiles/src/inverters/InverterAbstract.cpp b/lib/Hoymiles/src/inverters/InverterAbstract.cpp index 98cf6fa..bb4fb10 100644 --- a/lib/Hoymiles/src/inverters/InverterAbstract.cpp +++ b/lib/Hoymiles/src/inverters/InverterAbstract.cpp @@ -264,8 +264,8 @@ static float calcEffiencyCh0(InverterAbstract* iv, uint8_t arg0) static float calcIrradiation(InverterAbstract* iv, uint8_t arg0) { if (NULL != iv) { - if (iv->getChannelMaxPower(arg0) > 0) - return iv->getChannelFieldValue(arg0, FLD_PDC) / iv->getChannelMaxPower(arg0) * 100.0f; + if (iv->getChannelMaxPower(arg0 - 1) > 0) + return iv->getChannelFieldValue(arg0, FLD_PDC) / iv->getChannelMaxPower(arg0 - 1) * 100.0f; } return 0.0; } \ No newline at end of file