Completly ignore a disabled (polling + command) inverter.
This leads to higher update rates on still enabled inverters.
This commit is contained in:
parent
8023b6620a
commit
3a3adb4723
@ -50,66 +50,69 @@ void HoymilesClass::loop()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (iv != nullptr && iv->getRadio()->isInitialized() && iv->getRadio()->isQueueEmpty()) {
|
if (iv != nullptr && iv->getRadio()->isInitialized() && iv->getRadio()->isQueueEmpty()) {
|
||||||
_messageOutput->print("Fetch inverter: ");
|
|
||||||
_messageOutput->println(iv->serial(), HEX);
|
|
||||||
|
|
||||||
if (!iv->isReachable()) {
|
if (iv->getEnablePolling() || iv->getEnableCommands()) {
|
||||||
iv->sendChangeChannelRequest();
|
_messageOutput->print("Fetch inverter: ");
|
||||||
}
|
_messageOutput->println(iv->serial(), HEX);
|
||||||
|
|
||||||
iv->sendStatsRequest();
|
if (!iv->isReachable()) {
|
||||||
|
iv->sendChangeChannelRequest();
|
||||||
// Fetch event log
|
|
||||||
bool force = iv->EventLog()->getLastAlarmRequestSuccess() == CMD_NOK;
|
|
||||||
iv->sendAlarmLogRequest(force);
|
|
||||||
|
|
||||||
// Fetch limit
|
|
||||||
if (((millis() - iv->SystemConfigPara()->getLastUpdateRequest() > HOY_SYSTEM_CONFIG_PARA_POLL_INTERVAL)
|
|
||||||
&& (millis() - iv->SystemConfigPara()->getLastUpdateCommand() > HOY_SYSTEM_CONFIG_PARA_POLL_MIN_DURATION))) {
|
|
||||||
_messageOutput->println("Request SystemConfigPara");
|
|
||||||
iv->sendSystemConfigParaRequest();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set limit if required
|
|
||||||
if (iv->SystemConfigPara()->getLastLimitCommandSuccess() == CMD_NOK) {
|
|
||||||
_messageOutput->println("Resend ActivePowerControl");
|
|
||||||
iv->resendActivePowerControlRequest();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set power status if required
|
|
||||||
if (iv->PowerCommand()->getLastPowerCommandSuccess() == CMD_NOK) {
|
|
||||||
_messageOutput->println("Resend PowerCommand");
|
|
||||||
iv->resendPowerControlRequest();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fetch dev info (but first fetch stats)
|
|
||||||
if (iv->Statistics()->getLastUpdate() > 0) {
|
|
||||||
bool invalidDevInfo = !iv->DevInfo()->containsValidData()
|
|
||||||
&& iv->DevInfo()->getLastUpdateAll() > 0
|
|
||||||
&& iv->DevInfo()->getLastUpdateSimple() > 0;
|
|
||||||
|
|
||||||
if (invalidDevInfo) {
|
|
||||||
_messageOutput->println("DevInfo: No Valid Data");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((iv->DevInfo()->getLastUpdateAll() == 0)
|
iv->sendStatsRequest();
|
||||||
|| (iv->DevInfo()->getLastUpdateSimple() == 0)
|
|
||||||
|| invalidDevInfo) {
|
|
||||||
_messageOutput->println("Request device info");
|
|
||||||
iv->sendDevInfoRequest();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fetch grid profile
|
// Fetch event log
|
||||||
if (iv->Statistics()->getLastUpdate() > 0 && iv->GridProfile()->getLastUpdate() == 0) {
|
bool force = iv->EventLog()->getLastAlarmRequestSuccess() == CMD_NOK;
|
||||||
iv->sendGridOnProFileParaRequest();
|
iv->sendAlarmLogRequest(force);
|
||||||
|
|
||||||
|
// Fetch limit
|
||||||
|
if (((millis() - iv->SystemConfigPara()->getLastUpdateRequest() > HOY_SYSTEM_CONFIG_PARA_POLL_INTERVAL)
|
||||||
|
&& (millis() - iv->SystemConfigPara()->getLastUpdateCommand() > HOY_SYSTEM_CONFIG_PARA_POLL_MIN_DURATION))) {
|
||||||
|
_messageOutput->println("Request SystemConfigPara");
|
||||||
|
iv->sendSystemConfigParaRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set limit if required
|
||||||
|
if (iv->SystemConfigPara()->getLastLimitCommandSuccess() == CMD_NOK) {
|
||||||
|
_messageOutput->println("Resend ActivePowerControl");
|
||||||
|
iv->resendActivePowerControlRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set power status if required
|
||||||
|
if (iv->PowerCommand()->getLastPowerCommandSuccess() == CMD_NOK) {
|
||||||
|
_messageOutput->println("Resend PowerCommand");
|
||||||
|
iv->resendPowerControlRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fetch dev info (but first fetch stats)
|
||||||
|
if (iv->Statistics()->getLastUpdate() > 0) {
|
||||||
|
bool invalidDevInfo = !iv->DevInfo()->containsValidData()
|
||||||
|
&& iv->DevInfo()->getLastUpdateAll() > 0
|
||||||
|
&& iv->DevInfo()->getLastUpdateSimple() > 0;
|
||||||
|
|
||||||
|
if (invalidDevInfo) {
|
||||||
|
_messageOutput->println("DevInfo: No Valid Data");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((iv->DevInfo()->getLastUpdateAll() == 0)
|
||||||
|
|| (iv->DevInfo()->getLastUpdateSimple() == 0)
|
||||||
|
|| invalidDevInfo) {
|
||||||
|
_messageOutput->println("Request device info");
|
||||||
|
iv->sendDevInfoRequest();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fetch grid profile
|
||||||
|
if (iv->Statistics()->getLastUpdate() > 0 && iv->GridProfile()->getLastUpdate() == 0) {
|
||||||
|
iv->sendGridOnProFileParaRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
_lastPoll = millis();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (++inverterPos >= getNumInverters()) {
|
if (++inverterPos >= getNumInverters()) {
|
||||||
inverterPos = 0;
|
inverterPos = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
_lastPoll = millis();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Perform housekeeping of all inverters on day change
|
// Perform housekeeping of all inverters on day change
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user