Browse Source

0.7.16

* next attempt to fix yield day for multiple inverters #1016
* fix export settings date #1040
* fix time on WebUI (timezone was not observed) #913 #1016
pull/1048/head
lumapu 2 years ago
parent
commit
ffe7d47b31
  1. 5
      src/CHANGES.md
  2. 2
      src/defines.h
  3. 2
      src/hm/hmInverter.h
  4. 17
      src/publisher/pubMqttIvData.h
  5. 2
      src/web/RestApi.h
  6. 4
      src/web/html/api.js
  7. 10
      src/web/html/index.html
  8. 2
      src/web/html/visualization.html

5
src/CHANGES.md

@ -1,5 +1,10 @@
# Development Changes # Development Changes
## 0.7.16 - 2023-07-24
* next attempt to fix yield day for multiple inverters #1016
* fix export settings date #1040
* fix time on WebUI (timezone was not observed) #913 #1016
## 0.7.15 - 2023-07-23 ## 0.7.15 - 2023-07-23
* add NTP sync interval #1019 * add NTP sync interval #1019
* adjusted range of contrast / luminance setting #1041 * adjusted range of contrast / luminance setting #1041

2
src/defines.h

@ -13,7 +13,7 @@
//------------------------------------- //-------------------------------------
#define VERSION_MAJOR 0 #define VERSION_MAJOR 0
#define VERSION_MINOR 7 #define VERSION_MINOR 7
#define VERSION_PATCH 15 #define VERSION_PATCH 16
//------------------------------------- //-------------------------------------
typedef struct { typedef struct {

2
src/hm/hmInverter.h

@ -401,7 +401,7 @@ class Inverter {
avail = true; avail = true;
if(avail) { if(avail) {
if(InverterStatus::OFF == status) if(status < InverterStatus::PRODUCING)
status = InverterStatus::STARTING; status = InverterStatus::STARTING;
else else
status = InverterStatus::WAS_ON; status = InverterStatus::WAS_ON;

17
src/publisher/pubMqttIvData.h

@ -68,6 +68,7 @@ class PubMqttIvData {
void stateStart() { void stateStart() {
mLastIvId = 0; mLastIvId = 0;
mTotalFound = false; mTotalFound = false;
mAllTotalFound = true;
if(!mSendList->empty()) { if(!mSendList->empty()) {
mCmd = mSendList->front().cmd; mCmd = mSendList->front().cmd;
mIvSend = mSendList->front().iv; mIvSend = mSendList->front().iv;
@ -150,7 +151,8 @@ class PubMqttIvData {
mTotal[3] += mIv->getValue(mPos, rec); mTotal[3] += mIv->getValue(mPos, rec);
break; break;
} }
} } else
mAllTotalFound = false;
} }
} else } else
mIvLastRTRpub[mIv->id] = lastTs; mIvLastRTRpub[mIv->id] = lastTs;
@ -169,6 +171,7 @@ class PubMqttIvData {
void stateSendTotals() { void stateSendTotals() {
uint8_t fieldId; uint8_t fieldId;
mRTRDataHasBeenSent = true;
if(mPos < 4) { if(mPos < 4) {
bool retained = true; bool retained = true;
switch (mPos) { switch (mPos) {
@ -178,9 +181,17 @@ class PubMqttIvData {
retained = false; retained = false;
break; break;
case 1: case 1:
if(!mAllTotalFound) {
mPos++
return;
}
fieldId = FLD_YT; fieldId = FLD_YT;
break; break;
case 2: case 2:
if(!mAllTotalFound) {
mPos++
return;
}
fieldId = FLD_YD; fieldId = FLD_YD;
break; break;
case 3: case 3:
@ -197,8 +208,6 @@ class PubMqttIvData {
mZeroValues = false; mZeroValues = false;
mState = START; mState = START;
} }
mRTRDataHasBeenSent = true;
} }
HMSYSTEM *mSys; HMSYSTEM *mSys;
@ -209,7 +218,7 @@ class PubMqttIvData {
uint8_t mCmd; uint8_t mCmd;
uint8_t mLastIvId; uint8_t mLastIvId;
bool mSendTotals, mTotalFound; bool mSendTotals, mTotalFound, mAllTotalFound;
float mTotal[4]; float mTotal[4];
Inverter<> *mIv, *mIvSend; Inverter<> *mIv, *mIvSend;

2
src/web/RestApi.h

@ -184,7 +184,7 @@ class RestApi {
response = request->beginResponse(200, F("application/json; charset=utf-8"), tmp); response = request->beginResponse(200, F("application/json; charset=utf-8"), tmp);
} }
String filename = ah::getDateTimeStrFile(mApp->getTimezoneOffset()); String filename = ah::getDateTimeStrFile(gTimezone.toLocal(mApp->getTimestamp()));
filename += "_v" + String(mApp->getVersion()); filename += "_v" + String(mApp->getVersion());
response->addHeader("Content-Type", "application/octet-stream"); response->addHeader("Content-Type", "application/octet-stream");

4
src/web/html/api.js

@ -119,6 +119,10 @@ function parseRssi(obj) {
document.getElementById("wifiicon").replaceChildren(svg(icon, 32, 32, "wifi", obj["wifi_rssi"])); document.getElementById("wifiicon").replaceChildren(svg(icon, 32, 32, "wifi", obj["wifi_rssi"]));
} }
function toIsoDateStr(d) {
return new Date(d.getTime() + (d.getTimezoneOffset() * -60000)).toISOString().substring(0, 19).replace('T', ', ');
}
function setHide(id, hide) { function setHide(id, hide) {
var elm = document.getElementById(id); var elm = document.getElementById(id);
if(hide) { if(hide) {

10
src/web/html/index.html

@ -62,10 +62,6 @@
getAjax("/api/setup", apiCb, "POST", JSON.stringify(obj)); getAjax("/api/setup", apiCb, "POST", JSON.stringify(obj));
} }
function ts2Span(ts) {
return span(new Date(ts * 1000).toLocaleString('de-DE'));
}
function parseGeneric(obj) { function parseGeneric(obj) {
if(exeOnce) if(exeOnce)
parseESP(obj); parseESP(obj);
@ -92,7 +88,7 @@
if(obj["ts_now"] < 1680000000) if(obj["ts_now"] < 1680000000)
setTime(); setTime();
else else
dSpan.innerHTML = date.toISOString().substring(0, 19).replace('T', ', '); dSpan.innerHTML = toIsoDateStr(date);
} }
else { else {
dSpan.innerHTML = ""; dSpan.innerHTML = "";
@ -157,7 +153,7 @@
if(false == i["is_avail"]) { if(false == i["is_avail"]) {
if(i["ts_last_success"] > 0) { if(i["ts_last_success"] > 0) {
var date = new Date(i["ts_last_success"] * 1000); var date = new Date(i["ts_last_success"] * 1000);
p.append(span("-> last successful transmission: " + date.toISOString().substring(0, 19).replace('T', ', ')), br()); p.append(span("-> last successful transmission: " + toIsoDateStr(date)), br());
} }
} }
} }
@ -190,7 +186,7 @@
function tick() { function tick() {
if(0 != ts) if(0 != ts)
document.getElementById("date").innerHTML = (new Date((++ts) * 1000)).toISOString().substring(0, 19).replace('T', ', '); document.getElementById("date").innerHTML = toIsoDateStr((new Date((++ts) * 1000)));
if(++tickCnt >= 10) { if(++tickCnt >= 10) {
tickCnt = 0; tickCnt = 0;
getAjax('/api/index', parse); getAjax('/api/index', parse);

2
src/web/html/visualization.html

@ -158,7 +158,7 @@
var ageInfo = "Last received data requested at: "; var ageInfo = "Last received data requested at: ";
if(ts > 0) { if(ts > 0) {
var date = new Date(ts * 1000); var date = new Date(ts * 1000);
ageInfo += date.toISOString().substring(0, 19).replace('T', ', '); ageInfo += toIsoDateStr(date);
} }
else else
ageInfo += "nothing received"; ageInfo += "nothing received";

Loading…
Cancel
Save