Browse Source

0.7.7

* attempt to fix MqTT `YieldDay` in `TotalValues` #927
* attempt to fix MqTT `YieldDay` and `YieldTotal` even if inverters are not completly available #929
* fix wrong message 'NRF not connected' if it is disabled #1007
pull/1027/head
lumapu 2 years ago
parent
commit
982c201d48
  1. 2
      src/CHANGES.md
  2. 22
      src/publisher/pubMqttIvData.h
  3. 4
      src/web/RestApi.h

2
src/CHANGES.md

@ -2,6 +2,8 @@
## 0.7.7 - 2023-07-03 ## 0.7.7 - 2023-07-03
* attempt to fix MqTT `YieldDay` in `TotalValues` #927 * attempt to fix MqTT `YieldDay` in `TotalValues` #927
* attempt to fix MqTT `YieldDay` and `YieldTotal` even if inverters are not completly available #929
* fix wrong message 'NRF not connected' if it is disabled #1007
## 0.7.6 - 2023-06-17 ## 0.7.6 - 2023-06-17
* fix display of hidden SSID checkbox * fix display of hidden SSID checkbox

22
src/publisher/pubMqttIvData.h

@ -71,8 +71,7 @@ class PubMqttIvData {
mCmd = mSendList->front().cmd; mCmd = mSendList->front().cmd;
mIvSend = mSendList->front().iv; mIvSend = mSendList->front().iv;
if((RealTimeRunData_Debug != mCmd) || !mRTRDataHasBeenSent) { if((RealTimeRunData_Debug != mCmd) || !mRTRDataHasBeenSent) { // send RealTimeRunData only once
mSendTotals = (RealTimeRunData_Debug == mCmd);
memset(mTotal, 0, sizeof(float) * 4); memset(mTotal, 0, sizeof(float) * 4);
mState = FIND_NXT_IV; mState = FIND_NXT_IV;
} else } else
@ -97,18 +96,10 @@ class PubMqttIvData {
mLastIvId++; mLastIvId++;
mPos = 0; mPos = 0;
if(found) { if(found)
mState = SEND_DATA; mState = SEND_DATA;
if(!mIv->isAvailable(*mUtcTimestamp)) else
mSendTotals = false; // avoid send total values on no availability, because the sum of values is not built
}
else if(mSendTotals)
mState = SEND_TOTALS; mState = SEND_TOTALS;
else {
mSendList->pop();
mZeroValues = false;
mState = START;
}
} }
void stateSend() { void stateSend() {
@ -138,7 +129,8 @@ class PubMqttIvData {
if (CH0 == rec->assign[mPos].ch) { if (CH0 == rec->assign[mPos].ch) {
switch (rec->assign[mPos].fieldId) { switch (rec->assign[mPos].fieldId) {
case FLD_PAC: case FLD_PAC:
mTotal[0] += mIv->getValue(mPos, rec); if(mIv->isProducing(*mUtcTimestamp))
mTotal[0] += mIv->getValue(mPos, rec);
break; break;
case FLD_YT: case FLD_YT:
mTotal[1] += mIv->getValue(mPos, rec); mTotal[1] += mIv->getValue(mPos, rec);
@ -147,7 +139,8 @@ class PubMqttIvData {
mTotal[2] += mIv->getValue(mPos, rec); mTotal[2] += mIv->getValue(mPos, rec);
break; break;
case FLD_PDC: case FLD_PDC:
mTotal[3] += mIv->getValue(mPos, rec); if(mIv->isProducing(*mUtcTimestamp))
mTotal[3] += mIv->getValue(mPos, rec);
break; break;
} }
} }
@ -208,7 +201,6 @@ class PubMqttIvData {
uint8_t mCmd; uint8_t mCmd;
uint8_t mLastIvId; uint8_t mLastIvId;
bool mSendTotals;
float mTotal[4]; float mTotal[4];
Inverter<> *mIv, *mIvSend; Inverter<> *mIv, *mIvSend;

4
src/web/RestApi.h

@ -469,9 +469,9 @@ class RestApi {
} }
JsonArray warn = obj.createNestedArray(F("warnings")); JsonArray warn = obj.createNestedArray(F("warnings"));
if(!mRadio->isChipConnected()) if(!mRadio->isChipConnected() && mConfig->nrf.enabled)
warn.add(F("your NRF24 module can't be reached, check the wiring, pinout and enable")); warn.add(F("your NRF24 module can't be reached, check the wiring, pinout and enable"));
else if(!mRadio->isPVariant()) else if(!mRadio->isPVariant() && mConfig->nrf.enabled)
warn.add(F("your NRF24 module isn't a plus version(+), maybe incompatible")); warn.add(F("your NRF24 module isn't a plus version(+), maybe incompatible"));
if(!mApp->getSettingsValid()) if(!mApp->getSettingsValid())
warn.add(F("your settings are invalid")); warn.add(F("your settings are invalid"));

Loading…
Cancel
Save