Skip to content

Commit

Permalink
fix hard coded channel settings
Browse files Browse the repository at this point in the history
  • Loading branch information
helgeerbe committed Feb 24, 2023
1 parent 10f9074 commit cd7ece7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/PowerLimiter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void PowerLimiterClass::loop()
}

if (inverter->isProducing()) {
float acPower = inverter->Statistics()->getChannelFieldValue(TYPE_AC, CH0, FLD_PAC); // TODO(helgeerbe) check settings
float acPower = inverter->Statistics()->getChannelFieldValue(TYPE_AC, (ChannelNum_t) config.PowerLimiter_InverterChannelId, FLD_PAC);
float correctedDcVoltage = dcVoltage + (acPower * config.PowerLimiter_VoltageLoadCorrectionFactor);

if ((_consumeSolarPowerOnly && isStartThresholdReached(inverter))
Expand Down Expand Up @@ -215,8 +215,8 @@ float PowerLimiterClass::getLoadCorrectedVoltage(std::shared_ptr<InverterAbstrac
{
CONFIG_T& config = Configuration.get();

float acPower = inverter->Statistics()->getChannelFieldValue(TYPE_AC, CH0, FLD_PAC); // TODO(helgeerbe) check settings
float dcVoltage = inverter->Statistics()->getChannelFieldValue(TYPE_DC, CH0, FLD_UDC); // TODO(helgeerbe) check settings
float acPower = inverter->Statistics()->getChannelFieldValue(TYPE_AC, (ChannelNum_t) config.PowerLimiter_InverterChannelId, FLD_PAC);
float dcVoltage = inverter->Statistics()->getChannelFieldValue(TYPE_DC, (ChannelNum_t) config.PowerLimiter_InverterChannelId, FLD_UDC);

if (dcVoltage <= 0.0) {
return 0.0;
Expand Down

0 comments on commit cd7ece7

Please sign in to comment.