wasilukm
2 weeks ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
23 additions and
1 deletions
-
src/publisher/pubMqttIvData.h
|
|
@ -171,8 +171,30 @@ class PubMqttIvData { |
|
|
mTotal[3] += mIv->getValue(mPos, rec); |
|
|
mTotal[3] += mIv->getValue(mPos, rec); |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
} else |
|
|
} else if (mIv->GeneralConfig->rstValsAtMidNight && rec->ts > 0) { |
|
|
|
|
|
// Inverter is OFF - use last stored YT/YD values for total calculation.
|
|
|
|
|
|
// It is safe to use them when values are reset at midnight.
|
|
|
|
|
|
// Timestap check is to avoid wrong totals after restart (lower than before restart).
|
|
|
|
|
|
// This helps in having correct total values during daytime even when some inverters are OFF
|
|
|
|
|
|
switch (rec->assign[mPos].fieldId) { |
|
|
|
|
|
case FLD_YT: |
|
|
|
|
|
DPRINT_IVID(DBG_DEBUG, mIv->id); |
|
|
|
|
|
DBGPRINT(F("Inverter is OFF - Using last YT: ")); |
|
|
|
|
|
DBGPRINTLN(String(mIv->getValue(mPos, rec))); |
|
|
|
|
|
mTotal[1] += mIv->getValue(mPos, rec); |
|
|
|
|
|
break; |
|
|
|
|
|
case FLD_YD: { |
|
|
|
|
|
DPRINT_IVID(DBG_DEBUG, mIv->id); |
|
|
|
|
|
DBGPRINT(F("Inverter is OFF - Using last YD: ")); |
|
|
|
|
|
DBGPRINTLN(String(mIv->getValue(mPos, rec))); |
|
|
|
|
|
mTotal[2] += mIv->getValue(mPos, rec); |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
mAllTotalFound = false; |
|
|
mAllTotalFound = false; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|