Skip to content

Commit

Permalink
0.8.85 - 2024-02-22
Browse files Browse the repository at this point in the history
* possible fix of MqTT fix "total values are sent to often" #1421
* fix translation #1442
* availability check only related to live data #1035 #1437
  • Loading branch information
lumapu committed Feb 22, 2024
1 parent f500999 commit b6afec1
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 16 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.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
* fix homeassistant autodiscovery #1432
* merge PR: more gracefull handling of complete retransmits #1433
Expand Down
3 changes: 1 addition & 2 deletions src/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ void app:: zeroIvValues(bool checkAvail, bool skipYieldDay) {
continue;
}

changed = true;
record_t<> *rec = iv->getRecordStruct(RealTimeRunData_Debug);
for(uint8_t ch = 0; ch <= iv->channels; ch++) {
uint8_t pos = 0;
Expand All @@ -494,10 +495,8 @@ void app:: zeroIvValues(bool checkAvail, bool skipYieldDay) {
iv->setValue(pos, rec, 0.0f);
}
iv->resetAlarms();

iv->doCalculations();
}
changed = true;
}

if(changed)
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 84
#define VERSION_PATCH 85

//-------------------------------------
typedef struct {
Expand Down
12 changes: 3 additions & 9 deletions src/hm/hmInverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -407,23 +407,17 @@ class Inverter {
bool isAvailable() {
bool avail = false;

if((recordMeas.ts == 0) && (recordInfo.ts == 0) && (recordConfig.ts == 0) && (recordAlarm.ts == 0))
if(recordMeas.ts == 0)
return false;

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)
if(((*timestamp) - recordMeas.ts) < INVERTER_INACT_THRES_SEC)
avail = true;

if(avail) {
if(status < InverterStatus::PRODUCING)
status = InverterStatus::STARTING;
} else {
if((*timestamp - recordMeas.ts) > INVERTER_OFF_THRES_SEC) {
if(((*timestamp) - recordMeas.ts) > INVERTER_OFF_THRES_SEC) {
if(status != InverterStatus::OFF) {
status = InverterStatus::OFF;
actPowerLimit = 0xffff; // power limit will be read once inverter becomes available
Expand Down
7 changes: 5 additions & 2 deletions src/publisher/pubMqttIvData.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class PubMqttIvData {
mTotalFound = false;
mSendTotalYd = true;
mAllTotalFound = true;
mAtLeastOneWasntSent = false;
if(!mSendList->empty()) {
mCmd = mSendList->front().cmd;
mIvSend = mSendList->front().iv;
Expand Down Expand Up @@ -122,7 +123,7 @@ class PubMqttIvData {

mIv->isProducing(); // recalculate status
mState = SEND_DATA;
} else if(mSendTotals && mTotalFound) {
} else if(mSendTotals && mTotalFound && mAtLeastOneWasntSent) {
if(mYldTotalStore > mTotal[2])
mSendTotalYd = false; // don't send yield total if last value was greater
else
Expand Down Expand Up @@ -177,6 +178,7 @@ class PubMqttIvData {
}

if (MqttSentStatus::LAST_SUCCESS_SENT == rec->mqttSentStatus) {
mAtLeastOneWasntSent = true;
if(InverterDevInform_All == mCmd) {
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}",
Expand Down Expand Up @@ -282,7 +284,8 @@ class PubMqttIvData {

uint8_t mCmd = 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;

Inverter<> *mIv = nullptr, *mIvSend = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion src/web/html/serial.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
var hrs = parseInt(up / 3600) % 24;
var min = parseInt(up / 60) % 60;
var sec = up % 60;
document.getElementById("uptime").innerHTML = days + " Days, "
document.getElementById("uptime").innerHTML = days + " {#DAYS}, "
+ ("0"+hrs).substr(-2) + ":"
+ ("0"+min).substr(-2) + ":"
+ ("0"+sec).substr(-2);
Expand Down
8 changes: 7 additions & 1 deletion src/web/lang.json
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,12 @@
"en": "uptime",
"de": "Laufzeit"
}
,
{
"token": "DAYS",
"en": "days",
"de": "Tage"
}
]
},
{
Expand Down Expand Up @@ -986,7 +992,7 @@
{
"token": "NIGHT_TIME",
"en": "Night time, inverter polling disabled",
"de": "Wechselrichterabfrage deaktivert (Nacht)"
"de": "Wechselrichterabfrage deaktiviert (Nacht)"
},
{
"token": "PAUSED_AT",
Expand Down

0 comments on commit b6afec1

Please sign in to comment.