From fd51a2c2c3c4f641ac21285a93ac70c1077d8995 Mon Sep 17 00:00:00 2001 From: LKuemmel Date: Fri, 6 Dec 2024 08:23:49 +0100 Subject: [PATCH 1/2] draft --- packages/control/ev.py | 49 +------ packages/helpermodules/setdata.py | 10 -- .../source/src/views/ChargePointsView.vue | 122 ------------------ .../chargePointList/CPConfigInstant.vue | 57 +------- .../cpConfig/CPConfigInstant.vue | 58 +-------- .../web_themes/standard_legacy/web/index.html | 92 ------------- 6 files changed, 7 insertions(+), 381 deletions(-) diff --git a/packages/control/ev.py b/packages/control/ev.py index ada4191105..41e27509df 100644 --- a/packages/control/ev.py +++ b/packages/control/ev.py @@ -17,7 +17,7 @@ from control.chargepoint.control_parameter import ControlParameter from control.limiting_value import LimitingValue from dataclass_utils.factories import empty_dict_factory, empty_list_factory -from helpermodules.abstract_plans import Limit, limit_factory, ScheduledChargingPlan, TimeChargingPlan +from helpermodules.abstract_plans import ScheduledChargingPlan, TimeChargingPlan from helpermodules import timecheck from helpermodules.constants import NO_ERROR from modules.common.abstract_vehicle import VehicleUpdateData @@ -73,7 +73,6 @@ class TimeCharging: class InstantCharging: current: int = 10 dc_current: float = 145 - limit: Limit = field(default_factory=limit_factory) @dataclass @@ -115,22 +114,11 @@ def chargemode_factory() -> Chargemode: return Chargemode() -@dataclass -class Et: - active: bool = False - max_price: float = 0.0002 - - -def et_factory() -> Et: - return Et() - - @dataclass class ChargeTemplateData: name: str = "Lade-Profil" prio: bool = False load_default: bool = False - et: Et = field(default_factory=et_factory) time_charging: TimeCharging = field(default_factory=time_charging_factory) chargemode: Chargemode = field(default_factory=chargemode_factory) @@ -342,10 +330,7 @@ def get_required_current(self, if control_parameter.imported_instant_charging is None: control_parameter.imported_instant_charging = imported used_amount = imported - control_parameter.imported_instant_charging - required_current, submode, message = self.charge_template.instant_charging( - self.data.get.soc, - used_amount, - charging_type) + required_current, submode, message = self.charge_template.instant_charging(charging_type) elif self.charge_template.data.chargemode.selected == "pv_charging": required_current, submode, message = self.charge_template.pv_charging( self.data.get.soc, control_parameter.min_current, charging_type) @@ -603,7 +588,6 @@ class ChargeTemplate: "topic": ""}) BUFFER = -1200 # nach mehr als 20 Min Überschreitung wird der Termin als verpasst angesehen - CHARGING_PRICE_EXCEEDED = "Keine Ladung, da der aktuelle Strompreis über dem maximalen Strompreis liegt." TIME_CHARGING_NO_PLAN_CONFIGURED = "Keine Ladung, da keine Zeitfenster für Zeitladen konfiguriert sind." TIME_CHARGING_NO_PLAN_ACTIVE = "Keine Ladung, da kein Zeitfenster für Zeitladen aktiv ist." @@ -622,9 +606,6 @@ def time_charging(self, plan = timecheck.check_plans_timeframe(self.data.time_charging.plans) if plan is not None: current = plan.current if charging_type == ChargingType.AC.value else plan.dc_current - if self.data.et.active and data.data.optional_data.et_provider_available(): - if not data.data.optional_data.et_price_lower_than_limit(self.data.et.max_price): - return 0, "stop", self.CHARGING_PRICE_EXCEEDED, plan.name if plan.limit.selected == "none": # kein Limit konfiguriert, mit konfigurierter Stromstärke laden return current, "time_charging", message, plan.name elif plan.limit.selected == "soc": # SoC Limit konfiguriert @@ -652,12 +633,7 @@ def time_charging(self, log.exception("Fehler im ev-Modul "+str(self.ct_num)) return 0, "stop", "Keine Ladung, da da ein interner Fehler aufgetreten ist: "+traceback.format_exc(), None - INSTANT_CHARGING_SOC_REACHED = "Kein Sofortladen, da der Soc bereits erreicht wurde." - INSTANT_CHARGING_AMOUNT_REACHED = "Kein Sofortladen, da die Energiemenge bereits geladen wurde." - def instant_charging(self, - soc: Optional[float], - imported_instant_charging: float, charging_type: str) -> Tuple[int, str, Optional[str]]: """ prüft, ob die Lademengenbegrenzung erreicht wurde und setzt entsprechend den Ladestrom. """ @@ -668,26 +644,7 @@ def instant_charging(self, current = instant_charging.current else: current = instant_charging.dc_current - if self.data.et.active and data.data.optional_data.et_provider_available(): - if not data.data.optional_data.et_price_lower_than_limit(self.data.et.max_price): - return 0, "stop", self.CHARGING_PRICE_EXCEEDED - if instant_charging.limit.selected == "none": - return current, "instant_charging", message - elif instant_charging.limit.selected == "soc": - if soc: - if soc < instant_charging.limit.soc: - return current, "instant_charging", message - else: - return 0, "stop", self.INSTANT_CHARGING_SOC_REACHED - else: - return current, "instant_charging", message - elif instant_charging.limit.selected == "amount": - if imported_instant_charging < self.data.chargemode.instant_charging.limit.amount: - return current, "instant_charging", message - else: - return 0, "stop", self.INSTANT_CHARGING_AMOUNT_REACHED - else: - raise TypeError(f'{instant_charging.limit.selected} unbekanntes Sofortladen-Limit.') + return current, "instant_charging", message except Exception: log.exception("Fehler im ev-Modul "+str(self.ct_num)) return 0, "stop", "Keine Ladung, da da ein interner Fehler aufgetreten ist: "+traceback.format_exc() diff --git a/packages/helpermodules/setdata.py b/packages/helpermodules/setdata.py index 8dc6292998..479d2a333d 100644 --- a/packages/helpermodules/setdata.py +++ b/packages/helpermodules/setdata.py @@ -456,12 +456,6 @@ def _subprocess_vehicle_chargemode_topic(self, msg: mqtt.MQTTMessage): self._validate_value(msg, int, [(6, 32)], pub_json=True) elif "/chargemode/instant_charging/dc_current" in msg.topic: self._validate_value(msg, float, [(4, 300)], pub_json=True) - elif "/chargemode/instant_charging/limit/selected" in msg.topic: - self._validate_value(msg, str, pub_json=True) - elif "/chargemode/instant_charging/limit/soc" in msg.topic: - self._validate_value(msg, int, [(0, 100)], pub_json=True) - elif "/chargemode/instant_charging/limit/amount" in msg.topic: - self._validate_value(msg, int, [(1000, float("inf"))], pub_json=True) elif "/chargemode/pv_charging/feed_in_limit" in msg.topic: self._validate_value(msg, bool, pub_json=True) elif "/chargemode/pv_charging/min_current" in msg.topic: @@ -483,10 +477,6 @@ def _subprocess_vehicle_chargemode_topic(self, msg: mqtt.MQTTMessage): self._validate_value(msg, "json") elif "/chargemode/scheduled_charging" in msg.topic: self._validate_value(msg, "json", pub_json=True) - elif "/et/active" in msg.topic: - self._validate_value(msg, bool, pub_json=True) - elif "/et/max_price" in msg.topic: - self._validate_value(msg, float, pub_json=True) elif "/time_charging/active" in msg.topic: self._validate_value(msg, bool, pub_json=True) elif "/time_charging/plans/" in msg.topic and "/active" in msg.topic: diff --git a/packages/modules/display_themes/cards/source/src/views/ChargePointsView.vue b/packages/modules/display_themes/cards/source/src/views/ChargePointsView.vue index 39ad8a22ef..4a813a005b 100644 --- a/packages/modules/display_themes/cards/source/src/views/ChargePointsView.vue +++ b/packages/modules/display_themes/cards/source/src/views/ChargePointsView.vue @@ -507,128 +507,6 @@ export default { " /> - - Begrenzung - - - Keine - - - EV-SoC - - - Energie - - - - - Max. SoC - - - - Max. Energie - - diff --git a/packages/modules/display_themes/colors/source/src/components/chargePointList/CPConfigInstant.vue b/packages/modules/display_themes/colors/source/src/components/chargePointList/CPConfigInstant.vue index a1b6c5c0a5..a772f10e1c 100755 --- a/packages/modules/display_themes/colors/source/src/components/chargePointList/CPConfigInstant.vue +++ b/packages/modules/display_themes/colors/source/src/components/chargePointList/CPConfigInstant.vue @@ -11,47 +11,6 @@ unit="A" /> -
- - - - - - - - - - - - - @@ -61,7 +20,6 @@ import { computed } from 'vue' import { chargePoints } from './model' import ConfigItem from '../shared/ConfigItem.vue' import RangeInput from '@/components/shared/RangeInput.vue' -import RadioInput from '@/components/shared/RadioInput.vue' const props = defineProps<{ chargepointId: number @@ -71,19 +29,8 @@ const cp = computed(() => { return chargePoints[props.chargepointId] }) -const instantChargeLimitModes = [ - { name: 'keine', id: 'none' }, - { name: 'EV-SoC', id: 'soc' }, - { name: 'Energiemenge', id: 'amount' }, -] -const energyLimit = computed({ - get() { - return cp.value.instantMaxEnergy / 1000 - }, - set(limit: number) { - cp.value.instantMaxEnergy = limit * 1000 - }, -}) + + // methods diff --git a/packages/modules/web_themes/colors/source/src/components/chargePointList/cpConfig/CPConfigInstant.vue b/packages/modules/web_themes/colors/source/src/components/chargePointList/cpConfig/CPConfigInstant.vue index f210a901a2..3b7d8ee41b 100755 --- a/packages/modules/web_themes/colors/source/src/components/chargePointList/cpConfig/CPConfigInstant.vue +++ b/packages/modules/web_themes/colors/source/src/components/chargePointList/cpConfig/CPConfigInstant.vue @@ -13,74 +13,20 @@ unit="A" /> -
- - - - - - - - - - - - - diff --git a/packages/modules/web_themes/standard_legacy/web/index.html b/packages/modules/web_themes/standard_legacy/web/index.html index 0275ec3df7..9e9ece1455 100644 --- a/packages/modules/web_themes/standard_legacy/web/index.html +++ b/packages/modules/web_themes/standard_legacy/web/index.html @@ -526,39 +526,6 @@ data-style="w-100"> -
-
-
-
-
- - Strompreisbasiert Laden -
-
-
-
- -
-
- -
-
-
-
-
-
-
@@ -661,65 +628,6 @@

Einstellungen für "Sofortladen"

-
-
- -
-
- - - -
-
-
-
-
- SoC-Limit für das Fahrzeug -
-
-
-
- -
- -
-
-
-
-
- Energie-Limit -
-
-
-
- -
- -
-
-
-

Einstellungen für "PV"

From 277f9986ef816f53a7bda52e180aa58ed820ecad Mon Sep 17 00:00:00 2001 From: LKuemmel Date: Fri, 6 Dec 2024 09:29:36 +0100 Subject: [PATCH 2/2] update config --- packages/helpermodules/update_config.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/helpermodules/update_config.py b/packages/helpermodules/update_config.py index 7e2b99b84d..6cf388bbba 100644 --- a/packages/helpermodules/update_config.py +++ b/packages/helpermodules/update_config.py @@ -49,7 +49,7 @@ class UpdateConfig: - DATASTORE_VERSION = 65 + DATASTORE_VERSION = 66 valid_topic = [ "^openWB/bat/config/configured$", "^openWB/bat/config/power_limit_mode$", @@ -1839,3 +1839,16 @@ def upgrade_datastore_64(self) -> None: 'https://wb-solution.de/shop/', MessageType.INFO) self.__update_topic("openWB/system/datastore_version", 65) + + def upgrade_datastore_65(self) -> None: + def upgrade(topic: str, payload) -> Optional[dict]: + if re.search("openWB/vehicle/template/charge_template/[0-9]+", topic) is not None: + index = get_index(topic) + payload = decode_payload(payload) + if "et" in payload: + payload.pop("et") + if "limit" in payload["chargemode"]["instant_charging"]: + payload.pop("limit") + return {f"openWB/vehicle/template/charge_template/{index}": payload} + self._loop_all_received_topics(upgrade) + self.__update_topic("openWB/system/datastore_version", 66)