diff --git a/custom_components/zendure_ha/manager.py b/custom_components/zendure_ha/manager.py index deb7495d..a64db68f 100644 --- a/custom_components/zendure_ha/manager.py +++ b/custom_components/zendure_ha/manager.py @@ -101,6 +101,7 @@ async def loadDevices(self) -> None: self.manualpower = ZendureRestoreNumber(self, "manual_power", None, None, "W", "power", 12000, -12000, NumberMode.BOX, True) self.availableKwh = ZendureSensor(self, "available_kwh", None, "kWh", "energy", None, 1) self.power = ZendureSensor(self, "power", None, "W", "power", "measurement", 0) + self.max_battery_output_power = ZendureSensor(self, "max_battery_output_power", None, "W", "power", "measurement", 0) # load devices for dev in data["deviceList"]: @@ -234,6 +235,8 @@ async def updateFuseGroup(_entity: ZendureRestoreSelect, _value: Any) -> None: for d in fg.devices: d.fuseGrp = fg self.fuseGroups.append(fg) + + self.max_battery_output_power.update_value(sum(min(sum(d.discharge_limit for d in fg.devices if d.kWh > 0), fg.maxpower) for fg in self.fuseGroups)) async def update_operation(self, entity: ZendureSelect, _operation: Any) -> None: operation = ManagerMode(entity.value) @@ -440,6 +443,7 @@ async def powerChanged(self, p1: int, isFast: bool, time: datetime) -> None: # Update the power entities self.power.update_value(power) self.availableKwh.update_value(availableKwh) + self.max_battery_output_power.update_value(sum(min(sum(d.discharge_limit for d in fg.devices if d.kWh > 0), fg.maxpower) for fg in self.fuseGroups)) if self.discharge_bypass > setpoint: setpoint -= self.discharge_bypass diff --git a/custom_components/zendure_ha/translations/de.json b/custom_components/zendure_ha/translations/de.json index b49fbd5d..0db4fd63 100644 --- a/custom_components/zendure_ha/translations/de.json +++ b/custom_components/zendure_ha/translations/de.json @@ -239,6 +239,9 @@ "power": { "name": "Leistung" }, + "max_battery_output_power": { + "name": "Maximale Batterieausgangsleistung" + }, "pass": { "name": "Bypass", "state": { diff --git a/custom_components/zendure_ha/translations/en.json b/custom_components/zendure_ha/translations/en.json index 51ce8353..84444fda 100644 --- a/custom_components/zendure_ha/translations/en.json +++ b/custom_components/zendure_ha/translations/en.json @@ -242,6 +242,9 @@ "power": { "name": "Power" }, + "max_battery_output_power": { + "name": "Maximum Battery Output Power" + }, "pass": { "name": "Bypass", "state": { diff --git a/custom_components/zendure_ha/translations/fr.json b/custom_components/zendure_ha/translations/fr.json index ac5e13e9..56bf517d 100644 --- a/custom_components/zendure_ha/translations/fr.json +++ b/custom_components/zendure_ha/translations/fr.json @@ -235,6 +235,9 @@ "power": { "name": "Puissance" }, + "max_battery_output_power": { + "name": "Puissance maximale cumulée des batteries" + }, "pass": { "name": "Dérivation ( bypass )", "state": { diff --git a/custom_components/zendure_ha/translations/nl.json b/custom_components/zendure_ha/translations/nl.json index 361a7a78..32d6d32a 100644 --- a/custom_components/zendure_ha/translations/nl.json +++ b/custom_components/zendure_ha/translations/nl.json @@ -227,6 +227,9 @@ "pack_input_power": { "name": "Batterij Ontladen" }, + "max_battery_output_power": { + "name": "Maximum Batterij Uitgangsvermogen" + }, "output_pack_power": { "name": "Batterij Laden" },