Skip to content

Commit

Permalink
0.8.88
Browse files Browse the repository at this point in the history
* fix MqTT statistic data overflow #1458
* add HMS-400-1T support (serial number 1125...) #1460
* removed `yield efficiency` because the inverter already calculates correct #1243
  • Loading branch information
lumapu committed Feb 28, 2024
1 parent 4f71ac0 commit 3b58522
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 31 deletions.
5 changes: 5 additions & 0 deletions src/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Development Changes

## 0.8.88 - 2024-02-28
* fix MqTT statistic data overflow #1458
* add HMS-400-1T support (serial number 1125...) #1460
* removed `yield efficiency` because the inverter already calculates correct #1243

## 0.8.87 - 2024-02-25
* fix translations #1455 #1442

Expand Down
9 changes: 0 additions & 9 deletions src/config/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ typedef struct {
bool rstValsCommStop;
bool rstMaxValsMidNight;
bool startWithoutTime;
float yieldEffiency;
bool readGrid;
} cfgInst_t;

Expand Down Expand Up @@ -452,7 +451,6 @@ class settings {
mCfg.inst.rstValsCommStop = false;
mCfg.inst.startWithoutTime = false;
mCfg.inst.rstMaxValsMidNight = false;
mCfg.inst.yieldEffiency = 1.0f;
mCfg.inst.readGrid = true;

for(uint8_t i = 0; i < MAX_NUM_INVERTERS; i++) {
Expand Down Expand Up @@ -763,7 +761,6 @@ class settings {
obj[F("rstComStop")] = (bool)mCfg.inst.rstValsCommStop;
obj[F("strtWthtTime")] = (bool)mCfg.inst.startWithoutTime;
obj[F("rstMaxMidNight")] = (bool)mCfg.inst.rstMaxValsMidNight;
obj[F("yldEff")] = mCfg.inst.yieldEffiency;
obj[F("rdGrid")] = (bool)mCfg.inst.readGrid;
}
else {
Expand All @@ -774,13 +771,7 @@ class settings {
getVal<bool>(obj, F("rstComStop"), &mCfg.inst.rstValsCommStop);
getVal<bool>(obj, F("strtWthtTime"), &mCfg.inst.startWithoutTime);
getVal<bool>(obj, F("rstMaxMidNight"), &mCfg.inst.rstMaxValsMidNight);
getVal<float>(obj, F("yldEff"), &mCfg.inst.yieldEffiency);
getVal<bool>(obj, F("rdGrid"), &mCfg.inst.readGrid);

if(mCfg.inst.yieldEffiency < 0.5)
mCfg.inst.yieldEffiency = 1.0f;
else if(mCfg.inst.yieldEffiency > 1.0f)
mCfg.inst.yieldEffiency = 1.0f;
}

JsonArray ivArr;
Expand Down
2 changes: 1 addition & 1 deletion src/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//-------------------------------------
#define VERSION_MAJOR 0
#define VERSION_MINOR 8
#define VERSION_PATCH 87
#define VERSION_PATCH 88

//-------------------------------------
typedef struct {
Expand Down
4 changes: 2 additions & 2 deletions src/hm/hmInverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,9 @@ class Inverter {
// temperature, Qvar, and power factor are a signed values
rec->record[pos] = ((REC_TYP)((int16_t)val)) / (REC_TYP)(div);
} else if (FLD_YT == rec->assign[pos].fieldId) {
rec->record[pos] = ((REC_TYP)(val) / (REC_TYP)(div) * generalConfig->yieldEffiency) + ((REC_TYP)config->yieldCor[rec->assign[pos].ch-1]);
rec->record[pos] = ((REC_TYP)(val) / (REC_TYP)(div)) + ((REC_TYP)config->yieldCor[rec->assign[pos].ch-1]);
} else if (FLD_YD == rec->assign[pos].fieldId) {
float actYD = (REC_TYP)(val) / (REC_TYP)(div) * generalConfig->yieldEffiency;
float actYD = (REC_TYP)(val) / (REC_TYP)(div);
uint8_t idx = rec->assign[pos].ch - 1;
if (mLastYD[idx] > actYD)
mOffYD[idx] += mLastYD[idx];
Expand Down
8 changes: 4 additions & 4 deletions src/hm/hmSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class HmSystem {
if((iv->config->serial.b[5] == 0x11) || (iv->config->serial.b[5] == 0x10)) {
switch(iv->config->serial.b[4]) {
case 0x24: // HMS-500
case 0x25: // HMS-400
case 0x22:
case 0x21: iv->type = INV_TYPE_1CH;
break;
Expand All @@ -51,15 +52,14 @@ class HmSystem {
}

if(iv->config->serial.b[5] == 0x11) {
if((iv->config->serial.b[4] & 0x0f) == 0x04) {
if(((iv->config->serial.b[4] & 0x0f) == 0x04) || ((iv->config->serial.b[4] & 0x0f) == 0x05)) {
iv->ivGen = IV_HMS;
iv->ivRadioType = INV_RADIO_TYPE_CMT;
} else {
iv->ivGen = IV_HM;
iv->ivRadioType = INV_RADIO_TYPE_NRF;
}
}
else if((iv->config->serial.b[4] & 0x03) == 0x02) { // MI 3rd Gen -> same as HM
} else if((iv->config->serial.b[4] & 0x03) == 0x02) { // MI 3rd Gen -> same as HM
iv->ivGen = IV_HM;
iv->ivRadioType = INV_RADIO_TYPE_NRF;
} else { // MI 2nd Gen
Expand All @@ -82,7 +82,7 @@ class HmSystem {

DPRINT(DBG_INFO, "added inverter ");
if(iv->config->serial.b[5] == 0x11) {
if((iv->config->serial.b[4] & 0x0f) == 0x04)
if(((iv->config->serial.b[4] & 0x0f) == 0x04) || ((iv->config->serial.b[4] & 0x0f) == 0x05))
DBGPRINT("HMS");
else
DBGPRINT("HM");
Expand Down
2 changes: 1 addition & 1 deletion src/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ build_flags = ${env.build_flags}
-DDEF_LED1=17
-DLED_ACTIVE_HIGH
-DARDUINO_USB_MODE=1
#-DARDUINO_USB_CDC_ON_BOOT=1
-DARDUINO_USB_CDC_ON_BOOT=1
monitor_filters =
esp32_exception_decoder, colorize

Expand Down
2 changes: 1 addition & 1 deletion src/publisher/pubMqttIvData.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ class PubMqttIvData {
bool mRTRDataHasBeenSent = false;

std::array<char, (32 + MAX_NAME_LENGTH + 1)> mSubTopic;
std::array<char, 140> mVal;
std::array<char, 160> mVal;

std::queue<sendListCmdIv> *mSendList = nullptr;
};
Expand Down
1 change: 0 additions & 1 deletion src/web/RestApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,6 @@ class RestApi {
obj[F("strtWthtTm")] = (bool)mConfig->inst.startWithoutTime;
obj[F("rdGrid")] = (bool)mConfig->inst.readGrid;
obj[F("rstMaxMid")] = (bool)mConfig->inst.rstMaxValsMidNight;
obj[F("yldEff")] = mConfig->inst.yieldEffiency;
}

void getInverter(JsonObject obj, uint8_t id) {
Expand Down
9 changes: 3 additions & 6 deletions src/web/html/setup.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,6 @@
<div class="col-8">{#INV_READ_GRID_PROFILE}</div>
<div class="col-4"><input type="checkbox" name="rdGrid"/></div>
</div>
<div class="row mb-3">
<div class="col-8">{#INV_YIELD_EFF}</div>
<div class="col-4"><input type="number" name="yldEff" step="any"/></div>
</div>
</fieldset>
</div>

Expand Down Expand Up @@ -605,7 +601,7 @@
}

function ivGlob(obj) {
for(var i of [["invInterval", "interval"], ["yldEff", "yldEff"]])
for(var i of [["invInterval", "interval"]])
document.getElementsByName(i[0])[0].value = obj[i[1]];
for(var i of ["Mid", "ComStop", "NotAvail", "MaxMid"])
document.getElementsByName("invRst"+i)[0].checked = obj["rst" + i];
Expand Down Expand Up @@ -786,7 +782,8 @@
case 0x1000: nrf = true; break;
case 0x1100:
switch(sn & 0x000f) {
case 0x0004: nrf = false; break;
case 0x0004:
case 0x0005: nrf = false; break;
default: nrf = true; break;
}
break;
Expand Down
5 changes: 0 additions & 5 deletions src/web/lang.json
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,6 @@
"en": "Read Grid Profile",
"de": "Grid-Profil auslesen"
},
{
"token": "INV_YIELD_EFF",
"en": "Yield Efficiency (default 1.0)",
"de": "Ertragseffizienz (Standard 1.0)"
},
{
"token": "NTP_INTERVAL",
"en": "NTP Interval (in minutes, min. 5 minutes)",
Expand Down
1 change: 0 additions & 1 deletion src/web/web.h
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,6 @@ class Web {
mConfig->inst.startWithoutTime = (request->arg("strtWthtTm") == "on");
mConfig->inst.readGrid = (request->arg("rdGrid") == "on");
mConfig->inst.rstMaxValsMidNight = (request->arg("invRstMaxMid") == "on");
mConfig->inst.yieldEffiency = (request->arg("yldEff")).toFloat();


// pinout
Expand Down

0 comments on commit 3b58522

Please sign in to comment.