diff --git a/src/defines.h b/src/defines.h index cdaea069..07161fe1 100644 --- a/src/defines.h +++ b/src/defines.h @@ -13,7 +13,7 @@ //------------------------------------- #define VERSION_MAJOR 0 #define VERSION_MINOR 8 -#define VERSION_PATCH 970004 +#define VERSION_PATCH 970005 //------------------------------------- typedef struct { diff --git a/src/hm/Communication.h b/src/hm/Communication.h index e6338d25..883f3fd9 100644 --- a/src/hm/Communication.h +++ b/src/hm/Communication.h @@ -490,12 +490,16 @@ class Communication : public CommQueue<> { case TurnOn: [[fallthrough]]; case TurnOff: //[[fallthrough]]; - (mCbPwrPowerAck)(q->iv); + if (NULL != mCbPwrPowerAck) { + (mCbPwrPowerAck)(q->iv); + } return true; break; case Restart: - (mCbPwrRebootAck)(q->iv); + if (NULL != mCbPwrRebootAck) { + (mCbPwrRebootAck)(q->iv); + } return true; break; @@ -519,7 +523,9 @@ class Communication : public CommQueue<> { DBGPRINT(F(" with PowerLimitControl ")); DBGPRINTLN(String(q->iv->powerLimit[1])); q->iv->actPowerLimit = 0xffff; // unknown, readback current value - (mCbPwrAck)(q->iv); + if (NULL != mCbPwrAck) { + (mCbPwrAck)(q->iv); + } return accepted; } @@ -606,12 +612,15 @@ class Communication : public CommQueue<> { for (uint8_t i = 0; i < rec->length; i++) { q->iv->addValue(i, mPayload.data(), rec); } -(mCbNewData)(q->iv); rec->mqttSentStatus = MqttSentStatus::NEW_DATA; q->iv->rssi = rssi; q->iv->doCalculations(); + if (NULL != mCbNewData) { + (mCbNewData)(q->iv); + } + if(AlarmData == q->cmd) { uint8_t i = 0; while(1) { diff --git a/src/plugins/zeroExport/zeroExport.h b/src/plugins/zeroExport/zeroExport.h index e07e187b..10995aa4 100644 --- a/src/plugins/zeroExport/zeroExport.h +++ b/src/plugins/zeroExport/zeroExport.h @@ -257,6 +257,10 @@ class ZeroExport { // return; // } + if (iv->actPowerLimit == 65535) { + return; + } + for (uint8_t group = 0; group < ZEROEXPORT_MAX_GROUPS; group++) { for (uint8_t inv = 0; inv < ZEROEXPORT_GROUP_MAX_INVERTERS; inv++) { if (iv->id == mCfg->groups[group].inverters[inv].id) { @@ -271,7 +275,7 @@ class ZeroExport { mLog["ivPm"] = iv->getMaxPower(); mLog["ivL"] = (uint16_t)(iv->getMaxPower() / 100 * iv->actPowerLimit); mLog["zeL"] = (uint16_t)mCfg->groups[group].inverters[inv].limit; - + mCfg->groups[group].inverters[inv].limit = (iv->getMaxPower() / 100 * iv->actPowerLimit); unsigned long eTsp = millis(); mLog["B"] = bTsp; mLog["E"] = eTsp; diff --git a/src/web/RestApi.h b/src/web/RestApi.h index 178ee79e..17552b9a 100644 --- a/src/web/RestApi.h +++ b/src/web/RestApi.h @@ -1157,6 +1157,9 @@ class RestApi { mConfig->plugin.zeroExport.groups[group].Ki = jsonIn[F("Ki")]; mConfig->plugin.zeroExport.groups[group].Kd = jsonIn[F("Kd")]; // Global + mConfig->plugin.zeroExport.groups[group].stateLast = zeroExportState::INIT; + mConfig->plugin.zeroExport.groups[group].state = zeroExportState::INIT; + mConfig->plugin.zeroExport.groups[group].stateNext = zeroExportState::INIT; mApp->saveSettings(false); // without reboot } #endif