From 3b58522fd58df0ce14ba1ca615abd0ab18b758d2 Mon Sep 17 00:00:00 2001 From: lumapu Date: Thu, 29 Feb 2024 00:01:09 +0100 Subject: [PATCH] 0.8.88 * 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 --- src/CHANGES.md | 5 +++++ src/config/settings.h | 9 --------- src/defines.h | 2 +- src/hm/hmInverter.h | 4 ++-- src/hm/hmSystem.h | 8 ++++---- src/platformio.ini | 2 +- src/publisher/pubMqttIvData.h | 2 +- src/web/RestApi.h | 1 - src/web/html/setup.html | 9 +++------ src/web/lang.json | 5 ----- src/web/web.h | 1 - 11 files changed, 17 insertions(+), 31 deletions(-) diff --git a/src/CHANGES.md b/src/CHANGES.md index 4ca494f2..c5650f0d 100644 --- a/src/CHANGES.md +++ b/src/CHANGES.md @@ -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 diff --git a/src/config/settings.h b/src/config/settings.h index 18725b48..9c9b48c2 100644 --- a/src/config/settings.h +++ b/src/config/settings.h @@ -161,7 +161,6 @@ typedef struct { bool rstValsCommStop; bool rstMaxValsMidNight; bool startWithoutTime; - float yieldEffiency; bool readGrid; } cfgInst_t; @@ -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++) { @@ -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 { @@ -774,13 +771,7 @@ class settings { getVal(obj, F("rstComStop"), &mCfg.inst.rstValsCommStop); getVal(obj, F("strtWthtTime"), &mCfg.inst.startWithoutTime); getVal(obj, F("rstMaxMidNight"), &mCfg.inst.rstMaxValsMidNight); - getVal(obj, F("yldEff"), &mCfg.inst.yieldEffiency); getVal(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; diff --git a/src/defines.h b/src/defines.h index d3179469..8dcfe988 100644 --- a/src/defines.h +++ b/src/defines.h @@ -13,7 +13,7 @@ //------------------------------------- #define VERSION_MAJOR 0 #define VERSION_MINOR 8 -#define VERSION_PATCH 87 +#define VERSION_PATCH 88 //------------------------------------- typedef struct { diff --git a/src/hm/hmInverter.h b/src/hm/hmInverter.h index b7fb00a1..1890d142 100644 --- a/src/hm/hmInverter.h +++ b/src/hm/hmInverter.h @@ -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]; diff --git a/src/hm/hmSystem.h b/src/hm/hmSystem.h index 7e79f30a..e9b839be 100644 --- a/src/hm/hmSystem.h +++ b/src/hm/hmSystem.h @@ -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; @@ -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 @@ -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"); diff --git a/src/platformio.ini b/src/platformio.ini index f949aa37..7130bf4c 100644 --- a/src/platformio.ini +++ b/src/platformio.ini @@ -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 diff --git a/src/publisher/pubMqttIvData.h b/src/publisher/pubMqttIvData.h index c15c9799..ac8b3bf0 100644 --- a/src/publisher/pubMqttIvData.h +++ b/src/publisher/pubMqttIvData.h @@ -293,7 +293,7 @@ class PubMqttIvData { bool mRTRDataHasBeenSent = false; std::array mSubTopic; - std::array mVal; + std::array mVal; std::queue *mSendList = nullptr; }; diff --git a/src/web/RestApi.h b/src/web/RestApi.h index 622ea2d8..0120375a 100644 --- a/src/web/RestApi.h +++ b/src/web/RestApi.h @@ -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) { diff --git a/src/web/html/setup.html b/src/web/html/setup.html index 47d935b9..57dc6a8c 100644 --- a/src/web/html/setup.html +++ b/src/web/html/setup.html @@ -157,10 +157,6 @@
{#INV_READ_GRID_PROFILE}
-
-
{#INV_YIELD_EFF}
-
-
@@ -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]; @@ -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; diff --git a/src/web/lang.json b/src/web/lang.json index 7d9cdb43..eefd0516 100644 --- a/src/web/lang.json +++ b/src/web/lang.json @@ -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)", diff --git a/src/web/web.h b/src/web/web.h index 8495ba23..de4938f1 100644 --- a/src/web/web.h +++ b/src/web/web.h @@ -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