From a0e32bb06c84a3c7264c360366dfec21edf67b5b Mon Sep 17 00:00:00 2001 From: lumapu Date: Thu, 21 Mar 2024 23:09:19 +0100 Subject: [PATCH 1/3] 0.8.96 * fix precision of power limit in `/live` #1517 * fix translation of `Werte ausgeben` in `settings` #1507 * add grid profile #1518 --- src/CHANGES.md | 5 ++ src/defines.h | 2 +- src/web/html/grid_info.json | 102 ++++++++++++++++++++++++++++++++ src/web/html/visualization.html | 2 +- src/web/lang.json | 2 +- 5 files changed, 110 insertions(+), 3 deletions(-) diff --git a/src/CHANGES.md b/src/CHANGES.md index 99cf8ac8..1b1bccab 100644 --- a/src/CHANGES.md +++ b/src/CHANGES.md @@ -1,5 +1,10 @@ # Development Changes +## 0.8.96 - 2024-03-21 +* fix precision of power limit in `/live` #1517 +* fix translation of `Werte ausgeben` in `settings` #1507 +* add grid profile #1518 + ## 0.8.95 - 2024-03-17 * fix NTP issues #1440 #1497 #1499 diff --git a/src/defines.h b/src/defines.h index 752b3437..9078730f 100644 --- a/src/defines.h +++ b/src/defines.h @@ -13,7 +13,7 @@ //------------------------------------- #define VERSION_MAJOR 0 #define VERSION_MINOR 8 -#define VERSION_PATCH 95 +#define VERSION_PATCH 96 //------------------------------------- typedef struct { diff --git a/src/web/html/grid_info.json b/src/web/html/grid_info.json index bff1ae80..efb5651d 100644 --- a/src/web/html/grid_info.json +++ b/src/web/html/grid_info.json @@ -10,6 +10,7 @@ {"0x0908": "France_VFR2014"}, {"0x0a00": "DE NF_EN_50549-1:2019"}, {"0x0c00": "AT_TOR_Erzeuger_default"}, + {"0x0c04": "AT_TOR_Erzeuger_default"}, {"0x0d00": "FR_VFR2019"}, {"0x0d04": "NF_EN_50549-1:2019"}, {"0x1000": "ES_RD1699"}, @@ -252,6 +253,78 @@ } ] }, + { + "0x000b": [ + { + "name": "Nominal Voltage", + "div": 10, + "def": 230, + "unit": "V" + }, + { + "name": "Low Voltage 1", + "div": 10, + "min": 170, + "max": 184, + "def": 184, + "unit": "V" + }, + { + "name": "LV1 Maximum Trip Time", + "div": 10, + "def": 1.5, + "unit": "s" + }, + { + "name": "High Voltage 1", + "div": 10, + "min": 253, + "max": 270, + "def": 255.3, + "unit": "V" + }, + { + "name": "HV1 Maximum Trip Time", + "div": 10, + "def": 0.1, + "unit": "s" + }, + { + "name": "Low Voltage 2", + "div": 10, + "def": 57.5, + "unit": "V" + }, + { + "name": "LV2 Maximum Trip Time", + "div": 100, + "def": 0.5, + "unit": "s" + }, + { + "name": "High Voltage 2", + "div": 10, + "min": 264.5, + "max": 275, + "def": 264.5, + "unit": "V" + }, + { + "name": "HV2 Maximum Trip Time", + "div": 100, + "def": 0.08, + "unit": "s" + }, + { + "name": "10mins Average High Voltage", + "div": 10, + "min": 245, + "max": 255.3, + "def": 255.3, + "unit": "V" + } + ] + }, { "0x000c": [ { @@ -805,6 +878,35 @@ } ] }, + { + "0x6004": [ + { + "name": "VW Function Activated", + "div": 1, + "min": 0, + "max": 1, + "def": 1 + }, + { + "name": "Start of Voltage Watt Droop", + "div": 10, + "def": 253, + "unit": "V" + }, + { + "name": "End of Voltage Watt Droop", + "div": 10, + "def": 257.6, + "unit": "V" + }, + { + "name": "VW Droop Slope", + "div": 100, + "def": 21.74, + "unit": "Pn%/V" + } + ] + }, { "0x7000": [ { diff --git a/src/web/html/visualization.html b/src/web/html/visualization.html index aec6b0d8..cfc84e72 100644 --- a/src/web/html/visualization.html +++ b/src/web/html/visualization.html @@ -116,7 +116,7 @@ if(65535 != obj.power_limit_read) { pwrLimit = obj.power_limit_read + " %"; if(0 != obj.max_pwr) - pwrLimit += ", " + (obj.max_pwr * obj.power_limit_read / 100) + " W"; + pwrLimit += ", " + (obj.max_pwr * obj.power_limit_read / 100).toFixed(1) + " W"; } var maxAcPwr = toIsoDateStr(new Date(obj.ts_max_ac_pwr * 1000)); diff --git a/src/web/lang.json b/src/web/lang.json index f1723688..beab0e12 100644 --- a/src/web/lang.json +++ b/src/web/lang.json @@ -186,7 +186,7 @@ { "token": "LOG_PRINT_INVERTER_DATA", "en": "print inverter data", - "de": "Livedaten ausgeben" + "de": "Inverterwerte ausgeben" }, { "token": "LOG_SERIAL_DEBUG", From 99cfdb5324e961bddec4d8a7dee44fb17ae160a4 Mon Sep 17 00:00:00 2001 From: lumapu Date: Fri, 22 Mar 2024 22:38:08 +0100 Subject: [PATCH 2/3] 0.8.97 * add support for newest generation of inverters with A-F in their serial number --- src/web/RestApi.h | 2 +- src/web/html/setup.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/web/RestApi.h b/src/web/RestApi.h index 399ea91f..6a528a8c 100644 --- a/src/web/RestApi.h +++ b/src/web/RestApi.h @@ -332,7 +332,7 @@ class RestApi { if(-1 != i) { i+=5; String sn = tmp.substring(i, tmp.indexOf("\"", i)-1); - tmp.replace(sn, String(atoll(sn.c_str()), HEX)); + tmp.replace(sn, String(sn) + ",\"note\":\"" + String(atoll(sn.c_str()), HEX) + "\""); } } response = request->beginResponse(200, F("application/json; charset=utf-8"), tmp); diff --git a/src/web/html/setup.html b/src/web/html/setup.html index b6b8929e..ed6c4410 100644 --- a/src/web/html/setup.html +++ b/src/web/html/setup.html @@ -783,7 +783,7 @@ cbEn.checked = (obj.enabled); cbDisNightCom.checked = (obj.disnightcom); - var ser = ml("input", {name: "ser", class: "text", type: "number", max: 138999999999, value: obj.serial}, null); + var ser = ml("input", {name: "ser", class: "text", type: "text", pattern: "[0-9a-fA-F]{12}", value: obj.serial}, null); var html = ml("div", {}, [ tabs(["{#TAB_GENERAL}", "{#TAB_INPUTS}", "{#TAB_RADIO}", "{#TAB_ADVANCED}"]), ml("div", {id: "div{#TAB_GENERAL}", class: "tab-content"}, [ From 9971ed7f8aa5d497ba9ccf119f38456be8598b67 Mon Sep 17 00:00:00 2001 From: lumapu Date: Fri, 22 Mar 2024 22:40:35 +0100 Subject: [PATCH 3/3] 0.8.97 * add support for newest generation of inverters with A-F in their serial number * fix NTP and sunrise / sunset * set default coordinates to the mid of Germany #1516 --- src/CHANGES.md | 5 +++++ src/app.cpp | 11 +++++++---- src/config/settings.h | 4 ++-- src/defines.h | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/CHANGES.md b/src/CHANGES.md index 1b1bccab..af1ecd86 100644 --- a/src/CHANGES.md +++ b/src/CHANGES.md @@ -1,5 +1,10 @@ # Development Changes +## 0.8.97 - 2024-03-22 +* add support for newest generation of inverters with A-F in their serial number +* fix NTP and sunrise / sunset +* set default coordinates to the mid of Germany #1516 + ## 0.8.96 - 2024-03-21 * fix precision of power limit in `/live` #1517 * fix translation of `Werte ausgeben` in `settings` #1507 diff --git a/src/app.cpp b/src/app.cpp index 37b0a37a..119894f1 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -204,8 +204,13 @@ void app::regularTickers(void) { #endif /*ENABLE_SIMULATOR*/ } +//----------------------------------------------------------------------------- void app::onNtpUpdate(bool gotTime) { mNtpReceived = true; + if ((0 == mSunrise) && (0.0 != mConfig->sun.lat) && (0.0 != mConfig->sun.lon)) { + mCalculatedTimezoneOffset = (int8_t)((mConfig->sun.lon >= 0 ? mConfig->sun.lon + 7.5 : mConfig->sun.lon - 7.5) / 15) * 3600; + tickCalcSunrise(); + } } //----------------------------------------------------------------------------- @@ -236,10 +241,8 @@ void app::updateNtp(void) { } } - if ((0 == mSunrise) && (0.0 != mConfig->sun.lat) && (0.0 != mConfig->sun.lon)) { - mCalculatedTimezoneOffset = (int8_t)((mConfig->sun.lon >= 0 ? mConfig->sun.lon + 7.5 : mConfig->sun.lon - 7.5) / 15) * 3600; - tickCalcSunrise(); - } + if(mNtpReceived) + onNtpUpdate(true); mMqttReconnect = false; } diff --git a/src/config/settings.h b/src/config/settings.h index fe0053a9..e115160b 100644 --- a/src/config/settings.h +++ b/src/config/settings.h @@ -427,8 +427,8 @@ class settings { mCfg.ntp.port = DEF_NTP_PORT; mCfg.ntp.interval = 720; - mCfg.sun.lat = 0.0; - mCfg.sun.lon = 0.0; + mCfg.sun.lat = 51.1; // mid of Germany + mCfg.sun.lon = 10.5; // mid of Germany mCfg.sun.offsetSecMorning = 0; mCfg.sun.offsetSecEvening = 0; diff --git a/src/defines.h b/src/defines.h index 9078730f..16a1adf9 100644 --- a/src/defines.h +++ b/src/defines.h @@ -13,7 +13,7 @@ //------------------------------------- #define VERSION_MAJOR 0 #define VERSION_MINOR 8 -#define VERSION_PATCH 96 +#define VERSION_PATCH 97 //------------------------------------- typedef struct {