diff --git a/src/CHANGES.md b/src/CHANGES.md index 95fcae66..e9563510 100644 --- a/src/CHANGES.md +++ b/src/CHANGES.md @@ -1,5 +1,10 @@ # Development Changes +## 0.8.29 - 2023-12-23 +* fix MqTT generic topic `comm_disabled` #1265 #1286 +* potential fix of #1285 (reset yield day) +* fix fraction of yield correction #1280 + ## 0.8.28 - 2023-12-23 * fix bug heuristic * add version information to clipboard once 'copy' was clicked diff --git a/src/app.cpp b/src/app.cpp index 5a183cf4..88065e20 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -305,7 +305,7 @@ void app::tickMidnight(void) { continue; // skip to next inverter // reset alarms - if(InverterStatus::OFF == iv->status) + if(InverterStatus::OFF == iv->getStatus()) iv->resetAlarms(); // clear max values diff --git a/src/defines.h b/src/defines.h index b7ab4e55..2b304f9f 100644 --- a/src/defines.h +++ b/src/defines.h @@ -13,7 +13,7 @@ //------------------------------------- #define VERSION_MAJOR 0 #define VERSION_MINOR 8 -#define VERSION_PATCH 28 +#define VERSION_PATCH 29 //------------------------------------- typedef struct { diff --git a/src/hm/hmInverter.h b/src/hm/hmInverter.h index 2ae60e10..776b9c6f 100644 --- a/src/hm/hmInverter.h +++ b/src/hm/hmInverter.h @@ -458,6 +458,11 @@ class Inverter { return producing; } + InverterStatus getStatus(){ + isProducing(); // recalculate status + return status; + } + uint16_t getFwVersion() { record_t<> *rec = getRecordStruct(InverterDevInform_All); return getChannelFieldValue(CH0, FLD_FW_VERSION, rec); diff --git a/src/publisher/pubMqtt.h b/src/publisher/pubMqtt.h index 92f5de2f..e062439c 100644 --- a/src/publisher/pubMqtt.h +++ b/src/publisher/pubMqtt.h @@ -153,6 +153,10 @@ class PubMqtt { publish(mSubTopic, ((iv->commEnabled) ? dict[STR_TRUE] : dict[STR_FALSE]), true); } + + snprintf(mSubTopic, 32 + MAX_NAME_LENGTH, "comm_disabled"); + publish(mSubTopic, (((*mUtcTimestamp > (sunset + offs)) || (*mUtcTimestamp < (sunrise - offs))) ? dict[STR_TRUE] : dict[STR_FALSE]), true); + return true; } @@ -483,22 +487,22 @@ class PubMqtt { continue; // skip to next inverter // inverter status - iv->isProducing(); // recalculate status - if (InverterStatus::OFF < iv->status) + InverterStatus status = iv->getStatus(); + if (InverterStatus::OFF < status) anyAvail = true; else // inverter is enabled but not available allAvail = false; - if(mLastIvState[id] != iv->status) { + if(mLastIvState[id] != status) { // if status changed from producing to not producing send last data immediately if (InverterStatus::WAS_PRODUCING == mLastIvState[id]) sendData(iv, RealTimeRunData_Debug); - mLastIvState[id] = iv->status; + mLastIvState[id] = status; changed = true; snprintf(mSubTopic, 32 + MAX_NAME_LENGTH, "%s/available", iv->config->name); - snprintf(mVal, 40, "%d", (uint8_t)iv->status); + snprintf(mVal, 40, "%d", (uint8_t)status); publish(mSubTopic, mVal, true); } } diff --git a/src/publisher/pubMqttIvData.h b/src/publisher/pubMqttIvData.h index 3600e22c..9a364ec9 100644 --- a/src/publisher/pubMqttIvData.h +++ b/src/publisher/pubMqttIvData.h @@ -146,7 +146,7 @@ class PubMqttIvData { // calculate total values for RealTimeRunData_Debug if (CH0 == rec->assign[mPos].ch) { - if(mIv->status > InverterStatus::STARTING) { + if(mIv->getStatus() > InverterStatus::STARTING) { if(mIv->config->add2Total) { mTotalFound = true; switch (rec->assign[mPos].fieldId) { diff --git a/src/web/RestApi.h b/src/web/RestApi.h index e98b00fe..990f3e92 100644 --- a/src/web/RestApi.h +++ b/src/web/RestApi.h @@ -421,7 +421,7 @@ class RestApi { obj[F("max_pwr")] = iv->getMaxPower(); obj[F("ts_last_success")] = rec->ts; obj[F("generation")] = iv->ivGen; - obj[F("status")] = (uint8_t)iv->status; + obj[F("status")] = (uint8_t)iv->getStatus(); obj[F("alarm_cnt")] = iv->alarmCnt; obj[F("rssi")] = iv->rssi; diff --git a/src/web/html/setup.html b/src/web/html/setup.html index a1e42a5c..8187fe3b 100644 --- a/src/web/html/setup.html +++ b/src/web/html/setup.html @@ -676,7 +676,7 @@ ml("td", {}, String(i+1)), ml("td", {}, ml("input", {name: "ch_p"+i, class: "text", type: "number", max: 999, value: obj.ch_max_pwr[i]}, null)), ml("td", {}, ml("input", {name: "ch_n"+i, class: "text", type: "text", maxlength: 15, value: (undefined === obj.ch_name[i]) ? "" : obj.ch_name[i]}, null)), - ml("td", {}, ml("input", {name: "yld_c"+i, class: "text", type: "number", max: 999999, value: obj.ch_yield_cor[i]}, null)) + ml("td", {}, ml("input", {name: "yld_c"+i, class: "text", type: "number", max: 999999, value: obj.ch_yield_cor[i], step: "0.001"}, null)) ])); }