From e9b113486b8401cdb5bc6339ae3ef1ccee58b191 Mon Sep 17 00:00:00 2001 From: Thomas Basler Date: Tue, 19 Dec 2023 10:46:54 +0100 Subject: [PATCH] Fix: Reset Yield day correction in combination with Zero Yield Day on Midnight lead to wrong values. --- lib/Hoymiles/src/Hoymiles.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Hoymiles/src/Hoymiles.cpp b/lib/Hoymiles/src/Hoymiles.cpp index 4cd3ef0..e7b3d26 100644 --- a/lib/Hoymiles/src/Hoymiles.cpp +++ b/lib/Hoymiles/src/Hoymiles.cpp @@ -133,10 +133,12 @@ void HoymilesClass::loop() if (currentWeekDay != lastWeekDay) { for (auto& inv : _inverters) { + // Have to reset the offets first, otherwise it will + // Substract the offset from zero which leads to a high value + inv->Statistics()->resetYieldDayCorrection(); if (inv->getZeroYieldDayOnMidnight()) { inv->Statistics()->zeroDailyData(); } - inv->Statistics()->resetYieldDayCorrection(); } lastWeekDay = currentWeekDay;