diff --git a/src/CHANGES.md b/src/CHANGES.md index 98e1437c..003c8cef 100644 --- a/src/CHANGES.md +++ b/src/CHANGES.md @@ -1,5 +1,10 @@ # Development Changes +## 0.8.85 - 2024-02-22 +* possible fix of MqTT fix "total values are sent to often" #1421 +* fix translation #1442 +* availability check only related to live data #1035 #1437 + ## 0.8.84 - 2024-02-19 * fix homeassistant autodiscovery #1432 * merge PR: more gracefull handling of complete retransmits #1433 diff --git a/src/app.cpp b/src/app.cpp index 0bead49e..f53af865 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -472,6 +472,7 @@ void app:: zeroIvValues(bool checkAvail, bool skipYieldDay) { continue; } + changed = true; record_t<> *rec = iv->getRecordStruct(RealTimeRunData_Debug); for(uint8_t ch = 0; ch <= iv->channels; ch++) { uint8_t pos = 0; @@ -494,10 +495,8 @@ void app:: zeroIvValues(bool checkAvail, bool skipYieldDay) { iv->setValue(pos, rec, 0.0f); } iv->resetAlarms(); - iv->doCalculations(); } - changed = true; } if(changed) diff --git a/src/defines.h b/src/defines.h index edcde7a0..fc4988e6 100644 --- a/src/defines.h +++ b/src/defines.h @@ -13,7 +13,7 @@ //------------------------------------- #define VERSION_MAJOR 0 #define VERSION_MINOR 8 -#define VERSION_PATCH 84 +#define VERSION_PATCH 85 //------------------------------------- typedef struct { diff --git a/src/hm/hmInverter.h b/src/hm/hmInverter.h index 50b4267c..b7fb00a1 100644 --- a/src/hm/hmInverter.h +++ b/src/hm/hmInverter.h @@ -407,23 +407,17 @@ class Inverter { bool isAvailable() { bool avail = false; - if((recordMeas.ts == 0) && (recordInfo.ts == 0) && (recordConfig.ts == 0) && (recordAlarm.ts == 0)) + if(recordMeas.ts == 0) return false; - if((*timestamp - recordMeas.ts) < INVERTER_INACT_THRES_SEC) - avail = true; - if((*timestamp - recordInfo.ts) < INVERTER_INACT_THRES_SEC) - avail = true; - if((*timestamp - recordConfig.ts) < INVERTER_INACT_THRES_SEC) - avail = true; - if((*timestamp - recordAlarm.ts) < INVERTER_INACT_THRES_SEC) + if(((*timestamp) - recordMeas.ts) < INVERTER_INACT_THRES_SEC) avail = true; if(avail) { if(status < InverterStatus::PRODUCING) status = InverterStatus::STARTING; } else { - if((*timestamp - recordMeas.ts) > INVERTER_OFF_THRES_SEC) { + if(((*timestamp) - recordMeas.ts) > INVERTER_OFF_THRES_SEC) { if(status != InverterStatus::OFF) { status = InverterStatus::OFF; actPowerLimit = 0xffff; // power limit will be read once inverter becomes available diff --git a/src/publisher/pubMqttIvData.h b/src/publisher/pubMqttIvData.h index c3ae3814..c15c9799 100644 --- a/src/publisher/pubMqttIvData.h +++ b/src/publisher/pubMqttIvData.h @@ -75,6 +75,7 @@ class PubMqttIvData { mTotalFound = false; mSendTotalYd = true; mAllTotalFound = true; + mAtLeastOneWasntSent = false; if(!mSendList->empty()) { mCmd = mSendList->front().cmd; mIvSend = mSendList->front().iv; @@ -122,7 +123,7 @@ class PubMqttIvData { mIv->isProducing(); // recalculate status mState = SEND_DATA; - } else if(mSendTotals && mTotalFound) { + } else if(mSendTotals && mTotalFound && mAtLeastOneWasntSent) { if(mYldTotalStore > mTotal[2]) mSendTotalYd = false; // don't send yield total if last value was greater else @@ -177,6 +178,7 @@ class PubMqttIvData { } if (MqttSentStatus::LAST_SUCCESS_SENT == rec->mqttSentStatus) { + mAtLeastOneWasntSent = true; if(InverterDevInform_All == mCmd) { snprintf(mSubTopic.data(), mSubTopic.size(), "%s/firmware", mIv->config->name); snprintf(mVal.data(), mVal.size(), "{\"version\":%d,\"build_year\":\"%d\",\"build_month_day\":%d,\"build_hour_min\":%d,\"bootloader\":%d}", @@ -282,7 +284,8 @@ class PubMqttIvData { uint8_t mCmd = 0; uint8_t mLastIvId = 0; - bool mSendTotals = false, mTotalFound = false, mAllTotalFound = false, mSendTotalYd = false; + bool mSendTotals = false, mTotalFound = false, mAllTotalFound = false; + bool mSendTotalYd = false, mAtLeastOneWasntSent = false; float mTotal[5], mYldTotalStore = 0; Inverter<> *mIv = nullptr, *mIvSend = nullptr; diff --git a/src/web/html/serial.html b/src/web/html/serial.html index 83e614c8..ff63772c 100644 --- a/src/web/html/serial.html +++ b/src/web/html/serial.html @@ -35,7 +35,7 @@ var hrs = parseInt(up / 3600) % 24; var min = parseInt(up / 60) % 60; var sec = up % 60; - document.getElementById("uptime").innerHTML = days + " Days, " + document.getElementById("uptime").innerHTML = days + " {#DAYS}, " + ("0"+hrs).substr(-2) + ":" + ("0"+min).substr(-2) + ":" + ("0"+sec).substr(-2); diff --git a/src/web/lang.json b/src/web/lang.json index 066370c5..727eadcd 100644 --- a/src/web/lang.json +++ b/src/web/lang.json @@ -898,6 +898,12 @@ "en": "uptime", "de": "Laufzeit" } +, + { + "token": "DAYS", + "en": "days", + "de": "Tage" + } ] }, { @@ -986,7 +992,7 @@ { "token": "NIGHT_TIME", "en": "Night time, inverter polling disabled", - "de": "Wechselrichterabfrage deaktivert (Nacht)" + "de": "Wechselrichterabfrage deaktiviert (Nacht)" }, { "token": "PAUSED_AT",