Fix: Reset Yield day correction in combination with Zero Yield Day on Midnight lead to wrong values.

This commit is contained in:
Thomas Basler 2023-12-19 10:46:54 +01:00
parent 677d822a3e
commit e9b113486b

View File

@ -133,10 +133,12 @@ void HoymilesClass::loop()
if (currentWeekDay != lastWeekDay) { if (currentWeekDay != lastWeekDay) {
for (auto& inv : _inverters) { 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()) { if (inv->getZeroYieldDayOnMidnight()) {
inv->Statistics()->zeroDailyData(); inv->Statistics()->zeroDailyData();
} }
inv->Statistics()->resetYieldDayCorrection();
} }
lastWeekDay = currentWeekDay; lastWeekDay = currentWeekDay;