Skip to content

Commit 90eb25f

Browse files
authored
Fix: Huawei PSU: enforce BatterySoC Limit < 100 in UI (#992)
1 parent 27f264e commit 90eb25f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Huawei_can.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,10 @@ void HuaweiCanClass::loop()
389389
MessageOutput.printf("[HuaweiCanClass::loop] newPowerLimit: %f, output_power: %f \r\n", newPowerLimit, _rp.output_power);
390390
}
391391

392+
// Check whether the battery SoC limit setting is enabled
392393
if (config.Battery.Enabled && config.Huawei.Auto_Power_BatterySoC_Limits_Enabled) {
393394
uint8_t _batterySoC = Battery.getStats()->getSoC();
395+
// Sets power limit to 0 if the BMS reported SoC reaches or exceeds the user configured value
394396
if (_batterySoC >= config.Huawei.Auto_Power_Stop_BatterySoC_Threshold) {
395397
newPowerLimit = 0;
396398
if (verboseLogging) {
@@ -427,7 +429,7 @@ void HuaweiCanClass::loop()
427429
float calculatedCurrent = efficiency * (newPowerLimit / _rp.output_voltage);
428430

429431
// Limit output current to value requested by BMS
430-
float permissableCurrent = stats->getChargeCurrentLimitation() - (stats->getChargeCurrent() - _rp.output_current); // BMS current limit - current from other sources
432+
float permissableCurrent = stats->getChargeCurrentLimitation() - (stats->getChargeCurrent() - _rp.output_current); // BMS current limit - current from other sources, e.g. Victron MPPT charger
431433
float outputCurrent = std::min(calculatedCurrent, permissableCurrent);
432434
outputCurrent= outputCurrent > 0 ? outputCurrent : 0;
433435

webapp/src/views/AcChargerAdminView.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
<div class="input-group">
113113
<input type="number" class="form-control" id="stopBatterySoCThreshold"
114114
placeholder="95" v-model="acChargerConfigList.stop_batterysoc_threshold"
115-
aria-describedby="stopBatterySoCThresholdDescription" min="2" max="100" required/>
115+
aria-describedby="stopBatterySoCThresholdDescription" min="2" max="99" required/>
116116
<span class="input-group-text" id="stopBatterySoCThresholdDescription">%</span>
117117
</div>
118118
</div>

0 commit comments

Comments
 (0)