Browse Source

Merge branch 'development03' into zero-export

pull/1475/head
lumapu 11 months ago
parent
commit
60dd9cfc47
  1. 5
      src/CHANGES.md
  2. 3
      src/app.cpp
  3. 2
      src/defines.h
  4. 12
      src/hm/hmInverter.h
  5. 7
      src/publisher/pubMqttIvData.h
  6. 2
      src/web/html/serial.html
  7. 8
      src/web/lang.json

5
src/CHANGES.md

@ -1,5 +1,10 @@
# Development Changes # Development Changes
## 0.8.85 - 2024-02-22
* possible fix of MqTT fix "total values are sent to often" #1421
* fix translation #1442
* availability check only related to live data #1035 #1437
## 0.8.84 - 2024-02-19 ## 0.8.84 - 2024-02-19
* fix homeassistant autodiscovery #1432 * fix homeassistant autodiscovery #1432
* merge PR: more gracefull handling of complete retransmits #1433 * merge PR: more gracefull handling of complete retransmits #1433

3
src/app.cpp

@ -488,6 +488,7 @@ void app:: zeroIvValues(bool checkAvail, bool skipYieldDay) {
continue; continue;
} }
changed = true;
record_t<> *rec = iv->getRecordStruct(RealTimeRunData_Debug); record_t<> *rec = iv->getRecordStruct(RealTimeRunData_Debug);
for(uint8_t ch = 0; ch <= iv->channels; ch++) { for(uint8_t ch = 0; ch <= iv->channels; ch++) {
uint8_t pos = 0; uint8_t pos = 0;
@ -510,10 +511,8 @@ void app:: zeroIvValues(bool checkAvail, bool skipYieldDay) {
iv->setValue(pos, rec, 0.0f); iv->setValue(pos, rec, 0.0f);
} }
iv->resetAlarms(); iv->resetAlarms();
iv->doCalculations(); iv->doCalculations();
} }
changed = true;
} }
if(changed) if(changed)

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 84 #define VERSION_PATCH 85
//------------------------------------- //-------------------------------------
typedef struct { typedef struct {

12
src/hm/hmInverter.h

@ -407,23 +407,17 @@ class Inverter {
bool isAvailable() { bool isAvailable() {
bool avail = false; bool avail = false;
if((recordMeas.ts == 0) && (recordInfo.ts == 0) && (recordConfig.ts == 0) && (recordAlarm.ts == 0)) if(recordMeas.ts == 0)
return false; return false;
if((*timestamp - recordMeas.ts) < INVERTER_INACT_THRES_SEC) if(((*timestamp) - recordMeas.ts) < INVERTER_INACT_THRES_SEC)
avail = true;
if((*timestamp - recordInfo.ts) < INVERTER_INACT_THRES_SEC)
avail = true;
if((*timestamp - recordConfig.ts) < INVERTER_INACT_THRES_SEC)
avail = true;
if((*timestamp - recordAlarm.ts) < INVERTER_INACT_THRES_SEC)
avail = true; avail = true;
if(avail) { if(avail) {
if(status < InverterStatus::PRODUCING) if(status < InverterStatus::PRODUCING)
status = InverterStatus::STARTING; status = InverterStatus::STARTING;
} else { } else {
if((*timestamp - recordMeas.ts) > INVERTER_OFF_THRES_SEC) { if(((*timestamp) - recordMeas.ts) > INVERTER_OFF_THRES_SEC) {
if(status != InverterStatus::OFF) { if(status != InverterStatus::OFF) {
status = InverterStatus::OFF; status = InverterStatus::OFF;
actPowerLimit = 0xffff; // power limit will be read once inverter becomes available actPowerLimit = 0xffff; // power limit will be read once inverter becomes available

7
src/publisher/pubMqttIvData.h

@ -75,6 +75,7 @@ class PubMqttIvData {
mTotalFound = false; mTotalFound = false;
mSendTotalYd = true; mSendTotalYd = true;
mAllTotalFound = true; mAllTotalFound = true;
mAtLeastOneWasntSent = false;
if(!mSendList->empty()) { if(!mSendList->empty()) {
mCmd = mSendList->front().cmd; mCmd = mSendList->front().cmd;
mIvSend = mSendList->front().iv; mIvSend = mSendList->front().iv;
@ -122,7 +123,7 @@ class PubMqttIvData {
mIv->isProducing(); // recalculate status mIv->isProducing(); // recalculate status
mState = SEND_DATA; mState = SEND_DATA;
} else if(mSendTotals && mTotalFound) { } else if(mSendTotals && mTotalFound && mAtLeastOneWasntSent) {
if(mYldTotalStore > mTotal[2]) if(mYldTotalStore > mTotal[2])
mSendTotalYd = false; // don't send yield total if last value was greater mSendTotalYd = false; // don't send yield total if last value was greater
else else
@ -177,6 +178,7 @@ class PubMqttIvData {
} }
if (MqttSentStatus::LAST_SUCCESS_SENT == rec->mqttSentStatus) { if (MqttSentStatus::LAST_SUCCESS_SENT == rec->mqttSentStatus) {
mAtLeastOneWasntSent = true;
if(InverterDevInform_All == mCmd) { if(InverterDevInform_All == mCmd) {
snprintf(mSubTopic.data(), mSubTopic.size(), "%s/firmware", mIv->config->name); snprintf(mSubTopic.data(), mSubTopic.size(), "%s/firmware", mIv->config->name);
snprintf(mVal.data(), mVal.size(), "{\"version\":%d,\"build_year\":\"%d\",\"build_month_day\":%d,\"build_hour_min\":%d,\"bootloader\":%d}", snprintf(mVal.data(), mVal.size(), "{\"version\":%d,\"build_year\":\"%d\",\"build_month_day\":%d,\"build_hour_min\":%d,\"bootloader\":%d}",
@ -282,7 +284,8 @@ class PubMqttIvData {
uint8_t mCmd = 0; uint8_t mCmd = 0;
uint8_t mLastIvId = 0; uint8_t mLastIvId = 0;
bool mSendTotals = false, mTotalFound = false, mAllTotalFound = false, mSendTotalYd = false; bool mSendTotals = false, mTotalFound = false, mAllTotalFound = false;
bool mSendTotalYd = false, mAtLeastOneWasntSent = false;
float mTotal[5], mYldTotalStore = 0; float mTotal[5], mYldTotalStore = 0;
Inverter<> *mIv = nullptr, *mIvSend = nullptr; Inverter<> *mIv = nullptr, *mIvSend = nullptr;

2
src/web/html/serial.html

@ -35,7 +35,7 @@
var hrs = parseInt(up / 3600) % 24; var hrs = parseInt(up / 3600) % 24;
var min = parseInt(up / 60) % 60; var min = parseInt(up / 60) % 60;
var sec = up % 60; var sec = up % 60;
document.getElementById("uptime").innerHTML = days + " Days, " document.getElementById("uptime").innerHTML = days + " {#DAYS}, "
+ ("0"+hrs).substr(-2) + ":" + ("0"+hrs).substr(-2) + ":"
+ ("0"+min).substr(-2) + ":" + ("0"+min).substr(-2) + ":"
+ ("0"+sec).substr(-2); + ("0"+sec).substr(-2);

8
src/web/lang.json

@ -898,6 +898,12 @@
"en": "uptime", "en": "uptime",
"de": "Laufzeit" "de": "Laufzeit"
} }
,
{
"token": "DAYS",
"en": "days",
"de": "Tage"
}
] ]
}, },
{ {
@ -986,7 +992,7 @@
{ {
"token": "NIGHT_TIME", "token": "NIGHT_TIME",
"en": "Night time, inverter polling disabled", "en": "Night time, inverter polling disabled",
"de": "Wechselrichterabfrage deaktivert (Nacht)" "de": "Wechselrichterabfrage deaktiviert (Nacht)"
}, },
{ {
"token": "PAUSED_AT", "token": "PAUSED_AT",

Loading…
Cancel
Save