|
|
@ -171,10 +171,32 @@ 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; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (MqttSentStatus::LAST_SUCCESS_SENT == rec->mqttSentStatus) { |
|
|
if (MqttSentStatus::LAST_SUCCESS_SENT == rec->mqttSentStatus) { |
|
|
mAtLeastOneWasntSent = true; |
|
|
mAtLeastOneWasntSent = true; |
|
|
|