Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions data/config/mosquitto/public/default-dynamic-security.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": []
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
14 changes: 4 additions & 10 deletions packages/control/bat_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"})
Expand Down Expand Up @@ -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 "
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions packages/control/bat_all_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions packages/helpermodules/setdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 2 additions & 9 deletions packages/helpermodules/update_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ class UpdateConfig:
DATASTORE_VERSION = 122

valid_topic = [
"^openWB/bat/config/bat_control_permitted$",
"^openWB/bat/config/bat_control_activated$",
Comment thread
benderl marked this conversation as resolved.
"^openWB/bat/config/power_limit_mode$",
"^openWB/bat/config/power_limit_condition$",
Expand Down Expand Up @@ -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"),
Expand Down Expand Up @@ -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 "
"<a href=\"/openWB/web/settings/#/GeneralChargeConfig\">rechtlichen Hinweise</a> "
"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:
Expand Down
Loading