From 1c4722e09b0067429829b855d78509e4847eebe3 Mon Sep 17 00:00:00 2001 From: geronet1 Date: Fri, 7 Jun 2024 08:21:19 +0200 Subject: [PATCH 1/3] active_PowerLimit json fix --- src/publisher/pubMqttIvData.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/publisher/pubMqttIvData.h b/src/publisher/pubMqttIvData.h index 3f12afc6..7965cde6 100644 --- a/src/publisher/pubMqttIvData.h +++ b/src/publisher/pubMqttIvData.h @@ -197,13 +197,20 @@ class PubMqttIvData { if (!mCfg->json) { snprintf(mSubTopic.data(), mSubTopic.size(), "%s/ch%d/%s", mIv->config->name, rec->assign[mPos].ch, fields[rec->assign[mPos].fieldId]); snprintf(mVal.data(), mVal.size(), "%g", ah::round3(mIv->getValue(mPos, rec))); + } else { + if (FLD_ACT_ACTIVE_PWR_LIMIT == rec->assign[mPos].fieldId) { + uint8_t qos = (FLD_ACT_ACTIVE_PWR_LIMIT == rec->assign[mPos].fieldId) ? QOS_2 : QOS_0; + snprintf(mSubTopic.data(), mSubTopic.size(), "%s/%s", mIv->config->name, fields[rec->assign[mPos].fieldId]); + snprintf(mVal.data(), mVal.size(), "%g", ah::round3(mIv->getValue(mPos, rec))); + mPublish(mSubTopic.data(), mVal.data(), retained, qos); + } } } - if ((InverterDevInform_All == mCmd) || (InverterDevInform_Simple == mCmd) || !mCfg->json) { + if ((InverterDevInform_All == mCmd) || (InverterDevInform_Simple == mCmd) || !mCfg->json) + { uint8_t qos = (FLD_ACT_ACTIVE_PWR_LIMIT == rec->assign[mPos].fieldId) ? QOS_2 : QOS_0; - if((FLD_EVT != rec->assign[mPos].fieldId) - && (FLD_LAST_ALARM_CODE != rec->assign[mPos].fieldId)) + if((FLD_EVT != rec->assign[mPos].fieldId) && (FLD_LAST_ALARM_CODE != rec->assign[mPos].fieldId)) mPublish(mSubTopic.data(), mVal.data(), retained, qos); } } From 1f9096130563d232f6dd990851131f2fa96edec3 Mon Sep 17 00:00:00 2001 From: geronet1 Date: Sat, 8 Jun 2024 23:35:52 +0200 Subject: [PATCH 2/3] wifi bugfix with config_override --- src/config/config.h | 5 ++--- src/config/config_override_example.h | 3 --- src/network/AhoyWifiEsp32.h | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/config/config.h b/src/config/config.h index 49705eb6..7a3dbb64 100644 --- a/src/config/config.h +++ b/src/config/config.h @@ -16,9 +16,8 @@ //------------------------------------- // Fallback WiFi Info -#define FB_WIFI_SSID "YOUR_WIFI_SSID" -#define FB_WIFI_PWD "YOUR_WIFI_PWD" - +#define FB_WIFI_SSID "" +#define FB_WIFI_PWD "" // Access Point Info // In case there is no WiFi Network or Ahoy can not connect to it, it will act as an Access Point diff --git a/src/config/config_override_example.h b/src/config/config_override_example.h index 44623c1f..a84c1e8a 100644 --- a/src/config/config_override_example.h +++ b/src/config/config_override_example.h @@ -6,9 +6,6 @@ #ifndef __CONFIG_OVERRIDE_H__ #define __CONFIG_OVERRIDE_H__ -// override fallback WiFi info -#define FB_WIFI_OVERRIDDEN - // each override must be preceded with an #undef statement #undef FB_WIFI_SSID #define FB_WIFI_SSID "MY_SSID" diff --git a/src/network/AhoyWifiEsp32.h b/src/network/AhoyWifiEsp32.h index 89c9bbb4..b718043a 100644 --- a/src/network/AhoyWifiEsp32.h +++ b/src/network/AhoyWifiEsp32.h @@ -17,7 +17,7 @@ class AhoyWifi : public AhoyNetwork { void begin() override { mAp.enable(); - if(String(FB_WIFI_SSID) == mConfig->sys.stationSsid) + if(strlen(mConfig->sys.stationSsid) == 0) return; // no station wifi defined WiFi.disconnect(); // clean up From 13c009608be52c114d4adf6c8ef297013e725312 Mon Sep 17 00:00:00 2001 From: geronet1 Date: Sun, 9 Jun 2024 08:12:56 +0200 Subject: [PATCH 3/3] mobile display view without line break --- src/web/html/index.html | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/web/html/index.html b/src/web/html/index.html index 442160d4..ee78ac8e 100644 --- a/src/web/html/index.html +++ b/src/web/html/index.html @@ -116,6 +116,8 @@

{#SUPPORT}:

var p = div(["none"]); var total = 0; var count = 0; + var mobile = window.screen.width < 470; + for(var i of obj) { var icon = iconSuccess; var cl = "icon-success"; @@ -131,7 +133,8 @@

{#SUPPORT}:

} else if(0 == i["ts_last_success"]) { avail = "{#AVAIL_NO_DATA}"; } else { - avail = "{#AVAIL} "; + if (!mobile) + avail = "{#AVAIL} "; if(false == i["is_producing"]) avail += "{#NOT_PRODUCING}"; else { @@ -142,11 +145,16 @@

{#SUPPORT}:

} } + var text; + if (mobile) + text = "#"; + else + text = "{#INVERTER} #"; p.append( - svg(icon, 30, 30, "icon " + cl), - span("{#INVERTER} #" + i["id"] + ": " + i["name"] + " {#IS} " + avail), - br() - ); + svg(icon, 30, 30, "icon " + cl), + span(text + i["id"] + ": " + i["name"] + " {#IS} " + avail), + br() + ); if(false == i["is_avail"]) { if(i["ts_last_success"] > 0) {