From 13bbb350602b46666f436057d349f72889529531 Mon Sep 17 00:00:00 2001 From: Lutz Bender Date: Mon, 16 Jun 2025 13:08:08 +0200 Subject: [PATCH 01/25] cards display: switch to integrated plans --- .../cards/source/src/stores/mqtt.js | 20 ++++-- .../source/src/views/ChargePointsView.vue | 63 ++++++++++++------- 2 files changed, 55 insertions(+), 28 deletions(-) diff --git a/packages/modules/display_themes/cards/source/src/stores/mqtt.js b/packages/modules/display_themes/cards/source/src/stores/mqtt.js index 562b023f6a..f53d0eb91f 100644 --- a/packages/modules/display_themes/cards/source/src/stores/mqtt.js +++ b/packages/modules/display_themes/cards/source/src/stores/mqtt.js @@ -835,16 +835,24 @@ export const useMqttStore = defineStore("mqtt", { }, getChargePointConnectedVehicleScheduledChargingPlans(state) { return (chargePointId) => { - return state.getWildcardTopics( - `openWB/chargepoint/${chargePointId}/set/charge_template/chargemode/scheduled_charging/plans/+`, - ); + if (state.getChargePointConnectedVehicleChargeTemplate(chargePointId)) { + return state.getChargePointConnectedVehicleChargeTemplate( + chargePointId, + ).chargemode.scheduled_charging.plans; + } + return {}; }; }, getChargePointConnectedVehicleTimeChargingPlans(state) { return (chargePointId) => { - return state.getWildcardTopics( - `openWB/chargepoint/${chargePointId}/set/charge_template/time_charging/plans/+`, - ); + if ( + state.getChargePointConnectedVehicleChargeTemplate(chargePointId) + ) { + return state.getChargePointConnectedVehicleChargeTemplate( + chargePointId, + ).time_charging.plans; + } + return {}; }; }, 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 ebbe1c61b4..e3f878e0fd 100644 --- a/packages/modules/display_themes/cards/source/src/views/ChargePointsView.vue +++ b/packages/modules/display_themes/cards/source/src/views/ChargePointsView.vue @@ -338,23 +338,34 @@ export default { } }, setChargePointConnectedVehicleScheduledChargingPlanActive( - plan_key, + id, + plan_id, active, ) { - const plan = this.mqttStore.updateState( - `${plan_key}`, + console.log(`setChargePointConnectedVehicleScheduledChargingPlanActive: ${id} ${plan_id} - ${active}`); + const templateTopic = `openWB/chargepoint/${id}/set/charge_template`; + const template = this.mqttStore.updateState( + templateTopic, active, - "active", + `chargemode.scheduled_charging.plans.${plan_id}.active`, + ); + this.$root.sendTopicToBroker( + templateTopic, + template, ); - this.$root.sendTopicToBroker(`${plan_key}`, plan); }, - setChargePointConnectedVehicleTimeChargingPlanActive(plan_key, active) { - const plan = this.mqttStore.updateState( - `${plan_key}`, + setChargePointConnectedVehicleTimeChargingPlanActive(id, plan_id, active) { + console.log(`setChargePointConnectedVehicleTimeChargingPlanActive: ${id} ${plan_id} - ${active}`); + const templateTopic = `openWB/chargepoint/${id}/set/charge_template`; + const template = this.mqttStore.updateState( + templateTopic, active, - "active", + `time_charging.plans.${plan_id}.active`, + ) + this.$root.sendTopicToBroker( + templateTopic, + template, ); - this.$root.sendTopicToBroker(`${plan_key}`, plan); }, }, }; @@ -1254,11 +1265,14 @@ export default { > @@ -1287,7 +1301,8 @@ export default { :color="plan.active ? 'success' : 'danger'" @click=" setChargePointConnectedVehicleScheduledChargingPlanActive( - planKey, + modalChargePointId, + plan.id, !plan.active, ) " @@ -1388,11 +1403,14 @@ export default { @@ -1421,7 +1439,8 @@ export default { :color="plan.active ? 'success' : 'danger'" @click=" setChargePointConnectedVehicleTimeChargingPlanActive( - planKey, + modalChargePointId, + plan.id, !plan.active, ) " From 1cf95df0084847da0b306516d3fd6da42436867c Mon Sep 17 00:00:00 2001 From: Lutz Bender Date: Tue, 17 Jun 2025 08:58:26 +0200 Subject: [PATCH 02/25] standard-legacy: switch to integrated plans --- .../web_themes/standard_legacy/web/index.html | 58 +++++++++++----- .../standard_legacy/web/processAllMqttMsg.js | 68 +++---------------- 2 files changed, 52 insertions(+), 74 deletions(-) diff --git a/packages/modules/web_themes/standard_legacy/web/index.html b/packages/modules/web_themes/standard_legacy/web/index.html index 685657de90..a45fefb34b 100644 --- a/packages/modules/web_themes/standard_legacy/web/index.html +++ b/packages/modules/web_themes/standard_legacy/web/index.html @@ -577,7 +577,9 @@

Termine Zeitladen

Es wurden noch keine Zeitpläne eingerichtet!
+ data-plan-type="time_charging" + data-plan="" + >
--
@@ -1547,7 +1549,7 @@