Low target charge voltage a bit if Batrium sends TCL 0,0V

This commit is contained in:
Carsten Schmiemann 2023-06-12 00:46:03 +02:00
parent d8bb0fe8d1
commit f3a7259d22
1 changed files with 5 additions and 0 deletions

View File

@ -44,6 +44,7 @@ class DbusBatteryService:
self.cell_balanced = 0
self.ChargedEnergy = 0
self.DischargedEnergy = 0
self.maxChargeVoltage = 0
self._bat = BatriumBattery(connection=connection)
self.notifier = can.Notifier(self._bat._ci, [self._bat])
@ -237,6 +238,10 @@ class DbusBatteryService:
if self._bat.maxChargeVoltage != 0:
self._dbusservice['/Info/MaxChargeVoltage'] = self._bat.maxChargeVoltage
self.maxChargeVoltage = self._bat.maxChargeVoltage
# Workaround lower charge voltage a bit, because Batrium sends TCL 0V if charge is disabled
elif self.maxChargeVoltage != 0:
self._dbusservice['/Info/MaxChargeVoltage'] = self.maxChargeVoltage - 0.1
self._dbusservice['/System/NrOfModulesOnline'] = self._bat.numberOfModules
self._dbusservice['/System/NrOfBatteriesBalancing'] = self._bat.NumberInBypass