Fix: Huawei PSU: enforce BatterySoC Limit < 100 in UI (#992)

This commit is contained in:
eu-gh 2024-05-30 21:31:46 +02:00 committed by GitHub
parent 27f264e99b
commit 90eb25f503
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -389,8 +389,10 @@ void HuaweiCanClass::loop()
MessageOutput.printf("[HuaweiCanClass::loop] newPowerLimit: %f, output_power: %f \r\n", newPowerLimit, _rp.output_power);
}
// Check whether the battery SoC limit setting is enabled
if (config.Battery.Enabled && config.Huawei.Auto_Power_BatterySoC_Limits_Enabled) {
uint8_t _batterySoC = Battery.getStats()->getSoC();
// Sets power limit to 0 if the BMS reported SoC reaches or exceeds the user configured value
if (_batterySoC >= config.Huawei.Auto_Power_Stop_BatterySoC_Threshold) {
newPowerLimit = 0;
if (verboseLogging) {
@ -427,7 +429,7 @@ void HuaweiCanClass::loop()
float calculatedCurrent = efficiency * (newPowerLimit / _rp.output_voltage);
// Limit output current to value requested by BMS
float permissableCurrent = stats->getChargeCurrentLimitation() - (stats->getChargeCurrent() - _rp.output_current); // BMS current limit - current from other sources
float permissableCurrent = stats->getChargeCurrentLimitation() - (stats->getChargeCurrent() - _rp.output_current); // BMS current limit - current from other sources, e.g. Victron MPPT charger
float outputCurrent = std::min(calculatedCurrent, permissableCurrent);
outputCurrent= outputCurrent > 0 ? outputCurrent : 0;

View File

@ -112,7 +112,7 @@
<div class="input-group">
<input type="number" class="form-control" id="stopBatterySoCThreshold"
placeholder="95" v-model="acChargerConfigList.stop_batterysoc_threshold"
aria-describedby="stopBatterySoCThresholdDescription" min="2" max="100" required/>
aria-describedby="stopBatterySoCThresholdDescription" min="2" max="99" required/>
<span class="input-group-text" id="stopBatterySoCThresholdDescription">%</span>
</div>
</div>