Browse Source

0.8.118

* possible fix reset max values #1609
* slightly improved WiFi reconnect
pull/1626/head
lumapu 9 months ago
parent
commit
d43ebc6c5a
  1. 4
      src/CHANGES.md
  2. 22
      src/app.cpp
  3. 16
      src/config/settings.h
  4. 2
      src/defines.h
  5. 12
      src/hm/hmInverter.h
  6. 2
      src/web/html/setup.html
  7. 6
      src/web/lang.json

4
src/CHANGES.md

@ -1,5 +1,9 @@
# Development Changes # Development Changes
## 0.8.118 - 2024-05-10
* possible fix reset max values #1609
* slightly improved WiFi reconnect
## 0.8.117 - 2024-05-09 ## 0.8.117 - 2024-05-09
* fix reboot issue #1607 #1606 * fix reboot issue #1607 #1606
* fix max temperature tooltip if only one inverter is configured #1605 * fix max temperature tooltip if only one inverter is configured #1605

22
src/app.cpp

@ -353,20 +353,9 @@ void app::tickMidnight(void) {
// reset alarms // reset alarms
if(InverterStatus::OFF == iv->getStatus()) if(InverterStatus::OFF == iv->getStatus())
iv->resetAlarms(); iv->resetAlarms();
// clear max values
if(mConfig->inst.rstMaxValsMidNight) {
record_t<> *rec = iv->getRecordStruct(RealTimeRunData_Debug);
for(uint8_t i = 0; i <= iv->channels; i++) {
uint8_t pos = iv->getPosByChFld(i, FLD_MP, rec);
iv->setValue(pos, rec, 0.0f);
}
if(InverterStatus::OFF == iv->getStatus())
iv->resetAlarms(true);
}
} }
if (mConfig->inst.rstYieldMidNight) { if (mConfig->inst.rstValsAtMidNight) {
zeroIvValues(!CHECK_AVAIL, !SKIP_YIELD_DAY); zeroIvValues(!CHECK_AVAIL, !SKIP_YIELD_DAY);
#if defined(ENABLE_MQTT) #if defined(ENABLE_MQTT)
@ -470,12 +459,15 @@ void app:: zeroIvValues(bool checkAvail, bool skipYieldDay) {
pos = iv->getPosByChFld(ch, fld, rec); pos = iv->getPosByChFld(ch, fld, rec);
iv->setValue(pos, rec, 0.0f); iv->setValue(pos, rec, 0.0f);
} }
// zero max power // zero max power and max temperature
if(!skipYieldDay) { if(mConfig->inst.rstIncludeMaxVals) {
pos = iv->getPosByChFld(ch, FLD_MP, rec); pos = iv->getPosByChFld(ch, FLD_MP, rec);
iv->setValue(pos, rec, 0.0f); iv->setValue(pos, rec, 0.0f);
} pos = iv->getPosByChFld(ch, FLD_MT, rec);
iv->setValue(pos, rec, 0.0f);
iv->resetAlarms(true); iv->resetAlarms(true);
} else
iv->resetAlarms();
iv->doCalculations(); iv->doCalculations();
} }
} }

16
src/config/settings.h

@ -185,11 +185,11 @@ typedef struct {
cfgIv_t iv[MAX_NUM_INVERTERS]; cfgIv_t iv[MAX_NUM_INVERTERS];
uint16_t sendInterval; uint16_t sendInterval;
bool rstYieldMidNight; bool rstValsAtMidNight;
bool rstValsNotAvail; bool rstValsNotAvail;
bool rstValsCommStop; bool rstValsCommStop;
bool rstValsCommStart; bool rstValsCommStart;
bool rstMaxValsMidNight; bool rstIncludeMaxVals;
bool startWithoutTime; bool startWithoutTime;
bool readGrid; bool readGrid;
} cfgInst_t; } cfgInst_t;
@ -488,12 +488,12 @@ class settings {
mCfg.mqtt.enableRetain = true; mCfg.mqtt.enableRetain = true;
mCfg.inst.sendInterval = SEND_INTERVAL; mCfg.inst.sendInterval = SEND_INTERVAL;
mCfg.inst.rstYieldMidNight = false; mCfg.inst.rstValsAtMidNight = false;
mCfg.inst.rstValsNotAvail = false; mCfg.inst.rstValsNotAvail = false;
mCfg.inst.rstValsCommStop = false; mCfg.inst.rstValsCommStop = false;
mCfg.inst.rstValsCommStart = false; mCfg.inst.rstValsCommStart = false;
mCfg.inst.startWithoutTime = false; mCfg.inst.startWithoutTime = false;
mCfg.inst.rstMaxValsMidNight = false; mCfg.inst.rstIncludeMaxVals = false;
mCfg.inst.readGrid = true; mCfg.inst.readGrid = true;
for(uint8_t i = 0; i < MAX_NUM_INVERTERS; i++) { for(uint8_t i = 0; i < MAX_NUM_INVERTERS; i++) {
@ -821,23 +821,23 @@ class settings {
if(set) { if(set) {
obj[F("intvl")] = mCfg.inst.sendInterval; obj[F("intvl")] = mCfg.inst.sendInterval;
// obj[F("en")] = (bool)mCfg.inst.enabled; // obj[F("en")] = (bool)mCfg.inst.enabled;
obj[F("rstMidNight")] = (bool)mCfg.inst.rstYieldMidNight; obj[F("rstMidNight")] = (bool)mCfg.inst.rstValsAtMidNight;
obj[F("rstNotAvail")] = (bool)mCfg.inst.rstValsNotAvail; obj[F("rstNotAvail")] = (bool)mCfg.inst.rstValsNotAvail;
obj[F("rstComStop")] = (bool)mCfg.inst.rstValsCommStop; obj[F("rstComStop")] = (bool)mCfg.inst.rstValsCommStop;
obj[F("rstComStart")] = (bool)mCfg.inst.rstValsCommStart; obj[F("rstComStart")] = (bool)mCfg.inst.rstValsCommStart;
obj[F("strtWthtTime")] = (bool)mCfg.inst.startWithoutTime; obj[F("strtWthtTime")] = (bool)mCfg.inst.startWithoutTime;
obj[F("rstMaxMidNight")] = (bool)mCfg.inst.rstMaxValsMidNight; obj[F("rstMaxMidNight")] = (bool)mCfg.inst.rstIncludeMaxVals;
obj[F("rdGrid")] = (bool)mCfg.inst.readGrid; obj[F("rdGrid")] = (bool)mCfg.inst.readGrid;
} }
else { else {
getVal<uint16_t>(obj, F("intvl"), &mCfg.inst.sendInterval); getVal<uint16_t>(obj, F("intvl"), &mCfg.inst.sendInterval);
// getVal<bool>(obj, F("en"), &mCfg.inst.enabled); // getVal<bool>(obj, F("en"), &mCfg.inst.enabled);
getVal<bool>(obj, F("rstMidNight"), &mCfg.inst.rstYieldMidNight); getVal<bool>(obj, F("rstMidNight"), &mCfg.inst.rstValsAtMidNight);
getVal<bool>(obj, F("rstNotAvail"), &mCfg.inst.rstValsNotAvail); getVal<bool>(obj, F("rstNotAvail"), &mCfg.inst.rstValsNotAvail);
getVal<bool>(obj, F("rstComStop"), &mCfg.inst.rstValsCommStop); getVal<bool>(obj, F("rstComStop"), &mCfg.inst.rstValsCommStop);
getVal<bool>(obj, F("rstComStart"), &mCfg.inst.rstValsCommStart); getVal<bool>(obj, F("rstComStart"), &mCfg.inst.rstValsCommStart);
getVal<bool>(obj, F("strtWthtTime"), &mCfg.inst.startWithoutTime); getVal<bool>(obj, F("strtWthtTime"), &mCfg.inst.startWithoutTime);
getVal<bool>(obj, F("rstMaxMidNight"), &mCfg.inst.rstMaxValsMidNight); getVal<bool>(obj, F("rstMaxMidNight"), &mCfg.inst.rstIncludeMaxVals);
getVal<bool>(obj, F("rdGrid"), &mCfg.inst.readGrid); getVal<bool>(obj, F("rdGrid"), &mCfg.inst.readGrid);
} }

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 117 #define VERSION_PATCH 118
//------------------------------------- //-------------------------------------
typedef struct { typedef struct {
uint8_t ch; uint8_t ch;

12
src/hm/hmInverter.h

@ -239,15 +239,15 @@ class Inverter {
uint8_t getPosByChFld(uint8_t channel, uint8_t fieldId, record_t<> *rec) { uint8_t getPosByChFld(uint8_t channel, uint8_t fieldId, record_t<> *rec) {
DPRINTLN(DBG_VERBOSE, F("hmInverter.h:getPosByChFld")); DPRINTLN(DBG_VERBOSE, F("hmInverter.h:getPosByChFld"));
if(NULL != rec) { if(nullptr == rec)
return 0xff;
uint8_t pos = 0; uint8_t pos = 0;
for(; pos < rec->length; pos++) { for(; pos < rec->length; pos++) {
if((rec->assign[pos].ch == channel) && (rec->assign[pos].fieldId == fieldId)) if((rec->assign[pos].ch == channel) && (rec->assign[pos].fieldId == fieldId))
break; break;
} }
return (pos >= rec->length) ? 0xff : pos; return (pos >= rec->length) ? 0xff : pos;
} else
return 0xff;
} }
byteAssign_t *getByteAssign(uint8_t pos, record_t<> *rec) { byteAssign_t *getByteAssign(uint8_t pos, record_t<> *rec) {
@ -363,7 +363,7 @@ class Inverter {
bool setValue(uint8_t pos, record_t<> *rec, REC_TYP val) { bool setValue(uint8_t pos, record_t<> *rec, REC_TYP val) {
DPRINTLN(DBG_VERBOSE, F("hmInverter.h:setValue")); DPRINTLN(DBG_VERBOSE, F("hmInverter.h:setValue"));
if(NULL == rec) if(nullptr == rec)
return false; return false;
if(pos > rec->length) if(pos > rec->length)
return false; return false;
@ -585,7 +585,7 @@ class Inverter {
} }
} }
void resetAlarms(bool clear = false) { void resetAlarms(bool clearTs = false) {
lastAlarm.fill({0, 0, 0}); lastAlarm.fill({0, 0, 0});
mAlarmNxtWrPos = 0; mAlarmNxtWrPos = 0;
alarmCnt = 0; alarmCnt = 0;
@ -594,7 +594,7 @@ class Inverter {
memset(mOffYD, 0, sizeof(float) * 6); memset(mOffYD, 0, sizeof(float) * 6);
memset(mLastYD, 0, sizeof(float) * 6); memset(mLastYD, 0, sizeof(float) * 6);
if(clear) { if(clearTs) {
tsMaxAcPower = *Timestamp; tsMaxAcPower = *Timestamp;
tsMaxTemperature = *Timestamp; tsMaxTemperature = *Timestamp;
} }

2
src/web/html/setup.html

@ -142,7 +142,7 @@
<div class="col-4"><input type="checkbox" name="invRstNotAvail"/></div> <div class="col-4"><input type="checkbox" name="invRstNotAvail"/></div>
</div> </div>
<div class="row mb-3"> <div class="row mb-3">
<div class="col-8">{#INV_RESET_MAX_MIDNIGHT}</div> <div class="col-8">{#INV_RESET_MAX_VALUES}</div>
<div class="col-4"><input type="checkbox" name="invRstMaxMid"/></div> <div class="col-4"><input type="checkbox" name="invRstMaxMid"/></div>
</div> </div>
<div class="row mb-3"> <div class="row mb-3">

6
src/web/lang.json

@ -339,9 +339,9 @@
"de": "Werte zur&uuml;cksetzen, sobald der Wechselrichter nicht erreichbar ist" "de": "Werte zur&uuml;cksetzen, sobald der Wechselrichter nicht erreichbar ist"
}, },
{ {
"token": "INV_RESET_MAX_MIDNIGHT", "token": "INV_RESET_MAX_VALUES",
"en": "Reset 'max' values at midnight", "en": "Inlude reset 'max' values",
"de": "Maximalwerte mitternachts zur&uuml;cksetzen" "de": "Maximalwerte auch zur&uuml;cksetzen"
}, },
{ {
"token": "INV_START_WITHOUT_TIME", "token": "INV_START_WITHOUT_TIME",

Loading…
Cancel
Save