Skip to content
Merged
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
4 changes: 2 additions & 2 deletions packages/control/bat_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def _limit_bat_power_discharge(self, required_power):

def _set_bat_power_active_control(self, power):
controllable_bat_components = get_controllable_bat_components()
# maximal mögliche Lade- und Entaldeleistung des Systems unter Einbeziehung
# maximal mögliche Lade- und Entladeleistung des Systems unter Einbeziehung
# der erlaubten Lade-/ Entladeleistung und SoC der regelbaren Speicher ermitteln
max_charge_power_total = 0
bat_ready_to_charge = 0
Expand All @@ -233,7 +233,7 @@ def _set_bat_power_active_control(self, power):
# Leistung an einzelne Speicher übergeben
for bat_component in controllable_bat_components:
bat_component_data = data.data.bat_data[f"bat{bat_component.component_config.id}"].data
# Falls keine leistung übergeben wird greift die Eigenregelung der Speicher
# Falls keine Leistung übergeben wird greift die Eigenregelung der Speicher
if power is None:
power_limit = None
bat_component_data.get.state_str = "Keine Steuerung"
Expand Down
2 changes: 1 addition & 1 deletion packages/helpermodules/setdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ def process_bat_topic(self, msg: mqtt.MQTTMessage):
try:
if ("openWB/set/bat/config/bat_control_permitted" in msg.topic or
"openWB/set/bat/config/bat_control_activated" in msg.topic or
"openWB/set/bat/config/price_limit_actived" 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
"openWB/set/bat/get/power_limit_controllable" in msg.topic or
Expand Down
19 changes: 15 additions & 4 deletions packages/helpermodules/update_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

class UpdateConfig:

DATASTORE_VERSION = 108
DATASTORE_VERSION = 109

valid_topic = [
"^openWB/bat/config/bat_control_permitted$",
Expand Down Expand Up @@ -533,9 +533,6 @@ class UpdateConfig:
("openWB/bat/config/price_limit$", 0.3),
("openWB/bat/config/price_charge_activated", False),
("openWB/bat/config/charge_limit$", 0.3),
("openWB/bat/[0-9]+/get/max_charge_power", 0),
("openWB/bat/[0-9]+/get/max_discharge_power", 0),
# ("openWB/bat/[0-9]+/get/state_str", "Eigenregelung"),
("openWB/bat/config/configured", False),
("openWB/bat/get/fault_state", 0),
("openWB/bat/get/fault_str", NO_ERROR),
Expand Down Expand Up @@ -2735,3 +2732,17 @@ def upgrade(topic: str, payload) -> None:
return {topic: log_data}
self._loop_all_received_topics(upgrade)
self._append_datastore_version(108)

def upgrade_datastore_109(self) -> None:
def upgrade(topic: str, payload) -> None:
if re.search("openWB/bat/[0-9]+/get/power", topic) is not None:
index = get_index(topic)
# add new topics for battery control:
# openWB/bat/[0-9]+/get/max_charge_power => 0
# openWB/bat/[0-9]+/get/max_discharge_power => 0
if f"openWB/bat/{index}/get/max_charge_power" not in self.all_received_topics:
self.__update_topic(f"openWB/bat/{index}/get/max_charge_power", 0)
if f"openWB/bat/{index}/get/max_discharge_power" not in self.all_received_topics:
self.__update_topic(f"openWB/bat/{index}/get/max_discharge_power", 0)
self._loop_all_received_topics(upgrade)
self._append_datastore_version(109)