diff --git a/data/config/mosquitto/public/default-dynamic-security.json b/data/config/mosquitto/public/default-dynamic-security.json index a5e68fde77..bd34bbbcd3 100644 --- a/data/config/mosquitto/public/default-dynamic-security.json +++ b/data/config/mosquitto/public/default-dynamic-security.json @@ -70,7 +70,7 @@ "anonymousGroup": "anonymous", "roles": [ { - "rolename": "openwb-version:3", + "rolename": "openwb-version:4", "textname": "openWB Versionsnummer", "textdescription": "Diese Rolle ist ein Platzhalter für die openWB Versionsnummer und wird automatisch aktualisiert. Sie hat keine direkten Berechtigungen.", "acls": [] @@ -1164,12 +1164,6 @@ "priority": 0, "allow": true }, - { - "acltype": "publishClientSend", - "topic": "openWB/set/bat/config/bat_control_permitted", - "priority": 0, - "allow": true - }, { "acltype": "publishClientSend", "topic": "openWB/set/bat/config/charge_limit", @@ -1296,12 +1290,6 @@ "priority": 0, "allow": true }, - { - "acltype": "publishClientReceive", - "topic": "openWB/bat/config/bat_control_permitted", - "priority": 0, - "allow": true - }, { "acltype": "publishClientReceive", "topic": "openWB/bat/config/charge_limit", diff --git a/packages/control/bat_all.py b/packages/control/bat_all.py index 4cc61cf35d..520f01a2b5 100644 --- a/packages/control/bat_all.py +++ b/packages/control/bat_all.py @@ -74,7 +74,6 @@ class CurrentState(Enum): @dataclass class Config: configured: bool = field(default=False, metadata={"topic": "config/configured"}) - bat_control_permitted: bool = field(default=False, metadata={"topic": "config/bat_control_permitted"}) bat_control_activated: bool = field(default=False, metadata={"topic": "config/bat_control_activated"}) power_limit_mode: str = field(default=BatPowerLimitMode.MODE_NO_DISCHARGE.value, metadata={"topic": "config/power_limit_mode"}) @@ -277,7 +276,7 @@ def _set_bat_power_active_control(self, power): f"SoC. Eigenregelung des Speichers (ID: {bat_component.component_config.id})")) else: # unterhalb des minimal SoC greift die Eigenregelung - # das verhindert Tiefenentladung + # das verhindert Tiefentladung if bat_component_data.get.soc <= self.data.config.bat_control_min_soc: power_limit = None bat_component_data.get.state_str = ("Keine Steuerung - dieser Speicher " @@ -540,18 +539,14 @@ def get_charge_mode_scheduled(self): return BatChargeMode.BAT_SELF_REGULATION def get_power_limit(self): - # Falls kein steuerbarer Speicher installiert ist, der Disclaimer nicht akzeptiert wurde - # oder die aktive Speichersteuerung deaktiviert wurde + # Falls kein steuerbarer Speicher installiert oder die aktive Speichersteuerung deaktiviert ist if (self.data.get.power_limit_controllable is False or - self.data.config.bat_control_permitted is False or self.data.config.bat_control_activated is False): charge_mode = BatChargeMode.BAT_SELF_REGULATION if self.data.get.power_limit_controllable is False: log.debug("Speicher-Leistung nicht begrenzen, da keine regelbaren Speicher vorhanden sind.") - elif self.data.config.bat_control_permitted is False: - log.debug("Speicher-Leistung nicht begrenzen, da der aktiven Speichersteuerung nicht zugestimmt wurde.") elif self.data.config.bat_control_activated is False: - log.debug("Speicher-Leistung nicht begrenzen, da aktive Speichersteuerung deaktiviert wurde.") + log.debug("Speicher-Leistung nicht begrenzen, da aktive Speichersteuerung deaktiviert ist.") else: charge_mode = BatChargeMode.BAT_SELF_REGULATION if self.data.config.power_limit_condition == BatPowerLimitCondition.MANUAL.value: @@ -593,8 +588,7 @@ def get_power_limit(self): self.data.set.power_limit = None log.debug("Speicher-Leistung nicht begrenzen") - if ((self.data.config.bat_control_permitted is False or - self.data.config.bat_control_activated is False) + if (self.data.config.bat_control_activated is False and self.data.set.current_state == CurrentState.STARTUP.value): self.data.set.set_limit = False elif (self.data.set.current_state == CurrentState.IDLE.value and diff --git a/packages/control/bat_all_test.py b/packages/control/bat_all_test.py index ee9cf5fe4e..c89f631f43 100644 --- a/packages/control/bat_all_test.py +++ b/packages/control/bat_all_test.py @@ -192,7 +192,6 @@ class BatControlParams: bat_power: float = -10 bat_soc: float = 50.0 evu_power: float = 200 - bat_control_permitted: bool = True bat_control_activated: bool = True max_charge_power: float = 5000 max_discharge_power: float = -5000 @@ -207,8 +206,6 @@ class BatControlParams: cases = [ BatControlParams("Speicher nicht regelbar", None, power_limit_controllable=False, power_limit_mode=BatPowerLimitMode.MODE_NO_DISCHARGE.value), - BatControlParams("Disclaimer nicht akzeptiert", None, bat_control_permitted=False, - power_limit_mode=BatPowerLimitMode.MODE_NO_DISCHARGE.value), BatControlParams("Speichersteuerung deaktiviert", None, bat_control_activated=False, power_limit_mode=BatPowerLimitMode.MODE_NO_DISCHARGE.value), # Manuelle Steuerung @@ -248,7 +245,6 @@ class BatControlParams: @pytest.mark.parametrize("params", cases, ids=[c.name for c in cases]) def test_active_bat_control(params: BatControlParams, data_, monkeypatch): b_all = BatAll() - b_all.data.config.bat_control_permitted = params.bat_control_permitted b_all.data.config.bat_control_activated = params.bat_control_activated b_all.data.config.power_limit_mode = params.power_limit_mode b_all.data.config.power_limit_condition = params.power_limit_condition @@ -329,7 +325,6 @@ def test_active_bat_control(params: BatControlParams, data_, monkeypatch): def test_control_price_limit(params: BatControlParams, data_, monkeypatch): monkeypatch.setattr(data.data.optional_data, "ep_get_current_price", Mock(return_value=0.2)) b_all = BatAll() - b_all.data.config.bat_control_permitted = params.bat_control_permitted b_all.data.config.bat_control_activated = params.bat_control_activated b_all.data.config.power_limit_mode = params.power_limit_mode b_all.data.config.power_limit_condition = params.power_limit_condition diff --git a/packages/helpermodules/setdata.py b/packages/helpermodules/setdata.py index e3de04db83..ef86533b3b 100644 --- a/packages/helpermodules/setdata.py +++ b/packages/helpermodules/setdata.py @@ -668,8 +668,7 @@ def process_bat_topic(self, msg: mqtt.MQTTMessage): enthält Topic und Payload """ try: - if ("openWB/set/bat/config/bat_control_permitted" in msg.topic or - "openWB/set/bat/config/bat_control_activated" in msg.topic or + if ("openWB/set/bat/config/bat_control_activated" in msg.topic or "openWB/set/bat/config/price_limit_activated" in msg.topic or "openWB/set/bat/config/price_charge_activated" in msg.topic or "openWB/set/bat/config/configured" in msg.topic or diff --git a/packages/helpermodules/update_config.py b/packages/helpermodules/update_config.py index c5a6c1bbaa..2286ba95a8 100644 --- a/packages/helpermodules/update_config.py +++ b/packages/helpermodules/update_config.py @@ -60,7 +60,6 @@ class UpdateConfig: DATASTORE_VERSION = 122 valid_topic = [ - "^openWB/bat/config/bat_control_permitted$", "^openWB/bat/config/bat_control_activated$", "^openWB/bat/config/power_limit_mode$", "^openWB/bat/config/power_limit_condition$", @@ -551,7 +550,6 @@ class UpdateConfig: "^openWB/system/version$", ] default_topic = ( - ("openWB/bat/config/bat_control_permitted", False), ("openWB/bat/config/bat_control_activated", False), ("openWB/bat/config/power_limit_mode", "mode_no_discharge"), ("openWB/bat/config/power_limit_condition", "vehicle_charging"), @@ -2428,13 +2426,8 @@ def upgrade(topic: str, payload) -> None: def upgrade_datastore_86(self) -> None: if "openWB/bat/get/power_limit_controllable" not in self.all_received_topics: self.__update_topic("openWB/bat/get/power_limit_controllable", False) - if "openWB/bat/config/bat_control_permitted" not in self.all_received_topics.keys(): - self.__update_topic("openWB/bat/config/bat_control_permitted", False) - if decode_payload(self.all_received_topics["openWB/bat/get/power_limit_controllable"]) is True: - pub_system_message({}, "Bitte akzeptiere zunächst die " - "rechtlichen Hinweise " - "für die Speichersteuerung. Die Speichersteuerung war bisher bereits verfügbar, ist" - " jedoch bis zum Akzeptieren standardmäßig deaktiviert.", MessageType.WARNING) + # 2026-05-06: Topic "openWB/bat/config/bat_control_permitted" wurde später entfernt + # und wird daher nicht mehr in upgrade_datastore_86 hinzugefügt self._append_datastore_version(86) def upgrade_datastore_87(self) -> None: