Browse Source

0.8.29

* fix MqTT generic topic `comm_disabled` #1265 #1286
* potential fix of #1285 (reset yield day)
* fix fraction of yield correction #1280
pull/1274/head
lumapu 1 year ago
parent
commit
8b379f768e
  1. 5
      src/CHANGES.md
  2. 2
      src/app.cpp
  3. 2
      src/defines.h
  4. 5
      src/hm/hmInverter.h
  5. 14
      src/publisher/pubMqtt.h
  6. 2
      src/publisher/pubMqttIvData.h
  7. 2
      src/web/RestApi.h
  8. 2
      src/web/html/setup.html

5
src/CHANGES.md

@ -1,5 +1,10 @@
# Development Changes # 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 ## 0.8.28 - 2023-12-23
* fix bug heuristic * fix bug heuristic
* add version information to clipboard once 'copy' was clicked * add version information to clipboard once 'copy' was clicked

2
src/app.cpp

@ -305,7 +305,7 @@ void app::tickMidnight(void) {
continue; // skip to next inverter continue; // skip to next inverter
// reset alarms // reset alarms
if(InverterStatus::OFF == iv->status) if(InverterStatus::OFF == iv->getStatus())
iv->resetAlarms(); iv->resetAlarms();
// clear max values // clear max values

2
src/defines.h

@ -13,7 +13,7 @@
//------------------------------------- //-------------------------------------
#define VERSION_MAJOR 0 #define VERSION_MAJOR 0
#define VERSION_MINOR 8 #define VERSION_MINOR 8
#define VERSION_PATCH 28 #define VERSION_PATCH 29
//------------------------------------- //-------------------------------------
typedef struct { typedef struct {

5
src/hm/hmInverter.h

@ -458,6 +458,11 @@ class Inverter {
return producing; return producing;
} }
InverterStatus getStatus(){
isProducing(); // recalculate status
return status;
}
uint16_t getFwVersion() { uint16_t getFwVersion() {
record_t<> *rec = getRecordStruct(InverterDevInform_All); record_t<> *rec = getRecordStruct(InverterDevInform_All);
return getChannelFieldValue(CH0, FLD_FW_VERSION, rec); return getChannelFieldValue(CH0, FLD_FW_VERSION, rec);

14
src/publisher/pubMqtt.h

@ -153,6 +153,10 @@ class PubMqtt {
publish(mSubTopic, ((iv->commEnabled) ? dict[STR_TRUE] : dict[STR_FALSE]), true); 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; return true;
} }
@ -483,22 +487,22 @@ class PubMqtt {
continue; // skip to next inverter continue; // skip to next inverter
// inverter status // inverter status
iv->isProducing(); // recalculate status InverterStatus status = iv->getStatus();
if (InverterStatus::OFF < iv->status) if (InverterStatus::OFF < status)
anyAvail = true; anyAvail = true;
else // inverter is enabled but not available else // inverter is enabled but not available
allAvail = false; allAvail = false;
if(mLastIvState[id] != iv->status) { if(mLastIvState[id] != status) {
// if status changed from producing to not producing send last data immediately // if status changed from producing to not producing send last data immediately
if (InverterStatus::WAS_PRODUCING == mLastIvState[id]) if (InverterStatus::WAS_PRODUCING == mLastIvState[id])
sendData(iv, RealTimeRunData_Debug); sendData(iv, RealTimeRunData_Debug);
mLastIvState[id] = iv->status; mLastIvState[id] = status;
changed = true; changed = true;
snprintf(mSubTopic, 32 + MAX_NAME_LENGTH, "%s/available", iv->config->name); 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); publish(mSubTopic, mVal, true);
} }
} }

2
src/publisher/pubMqttIvData.h

@ -146,7 +146,7 @@ class PubMqttIvData {
// calculate total values for RealTimeRunData_Debug // calculate total values for RealTimeRunData_Debug
if (CH0 == rec->assign[mPos].ch) { if (CH0 == rec->assign[mPos].ch) {
if(mIv->status > InverterStatus::STARTING) { if(mIv->getStatus() > InverterStatus::STARTING) {
if(mIv->config->add2Total) { if(mIv->config->add2Total) {
mTotalFound = true; mTotalFound = true;
switch (rec->assign[mPos].fieldId) { switch (rec->assign[mPos].fieldId) {

2
src/web/RestApi.h

@ -421,7 +421,7 @@ class RestApi {
obj[F("max_pwr")] = iv->getMaxPower(); obj[F("max_pwr")] = iv->getMaxPower();
obj[F("ts_last_success")] = rec->ts; obj[F("ts_last_success")] = rec->ts;
obj[F("generation")] = iv->ivGen; 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("alarm_cnt")] = iv->alarmCnt;
obj[F("rssi")] = iv->rssi; obj[F("rssi")] = iv->rssi;

2
src/web/html/setup.html

@ -676,7 +676,7 @@
ml("td", {}, String(i+1)), 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_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: "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))
])); ]));
} }

Loading…
Cancel
Save