diff --git a/src/app.cpp b/src/app.cpp index e81bc7e5..b7ce04ae 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -595,7 +595,11 @@ void app::updateLed(void) { //----------------------------------------------------------------------------- #if defined(ESP32) void app::zeroexport() { - if (!mConfig->plugin.zexport.enabled) return; // check if plugin is enabled && indicate to send new value + if (!mConfig->plugin.zexport.enabled || + !mSys.getInverterByPos(mConfig->plugin.zexport.Iv)->isProducing()) { // check if plugin is enabled && indicate to send new value + mConfig->plugin.zexport.lastTime = millis(); // set last timestamp + return; + } if (millis() - mConfig->plugin.zexport.lastTime > mConfig->plugin.zexport.count_avg * 1000UL) { @@ -613,6 +617,11 @@ void app::zeroexport() { if(mConfig->plugin.zexport.max_power <= nValue) nValue = mConfig->plugin.zexport.max_power; + if(iv->actPowerLimit == nValue) { + mConfig->plugin.zexport.lastTime = millis(); // set last timestamp + return; // if PowerLimit same as befor, then skip + } + object["val"] = nValue; object["id"] = mConfig->plugin.zexport.Iv; object["path"] = "ctrl"; diff --git a/src/plugins/zeroExport/zeroExport.h b/src/plugins/zeroExport/zeroExport.h index 4974b5ba..f6a0f5bf 100644 --- a/src/plugins/zeroExport/zeroExport.h +++ b/src/plugins/zeroExport/zeroExport.h @@ -82,7 +82,7 @@ class ZeroExport { responseBody = responseBody.substring(index); // cut it and store it in value index = responseBody.indexOf(","); // find the first seperation - Bingo!? - mCfg->total_power = responseBody.substring(0, index - 1).toDouble(); + mCfg->total_power = responseBody.substring(responseBody.indexOf(":"), index).toDouble(); } else if(json.containsKey(F("emeters"))) { mCfg->total_power = (double)json[F("total_power")]; } else {