From 0b549a3a2a1370c1d43b9de1b5d2112a515eb3dc Mon Sep 17 00:00:00 2001 From: Lutz Bender Date: Thu, 13 Jun 2024 13:46:27 +0200 Subject: [PATCH 01/16] integrate energy flow view from simple interface --- packages/helpermodules/update_config.py | 16 +- .../modules/display_themes/cards/config.py | 5 + .../cards/source/public/icons/icon_Data.md | 3 + .../cards/source/public/icons/owbBattery.svg | 3 + .../source/public/icons/owbChargePoint.svg | 3 + .../cards/source/public/icons/owbGrid.svg | 3 + .../cards/source/public/icons/owbHouse.svg | 1 + .../cards/source/public/icons/owbPV.svg | 3 + .../cards/source/public/icons/owbVehicle.svg | 39 + .../src/components/DashBoard/BatteryCard.vue | 4 +- .../components/DashBoard/ChargePointsCard.vue | 2 +- .../src/components/DashBoard/FlowCard.vue | 676 ++++++++++++++++++ .../src/components/DashBoard/GridCard.vue | 2 +- .../src/components/DashBoard/HomeCard.vue | 2 +- .../src/components/DashBoard/InverterCard.vue | 2 +- .../cards/source/src/components/NavBar.vue | 6 + .../cards/source/src/router/index.js | 5 + .../cards/source/src/stores/mqtt.js | 140 +++- .../cards/source/src/views/EnergyFlowView.vue | 19 + .../cards/source/src/views/WelcomeView.vue | 3 + 20 files changed, 907 insertions(+), 30 deletions(-) create mode 100644 packages/modules/display_themes/cards/source/public/icons/icon_Data.md create mode 100644 packages/modules/display_themes/cards/source/public/icons/owbBattery.svg create mode 100644 packages/modules/display_themes/cards/source/public/icons/owbChargePoint.svg create mode 100644 packages/modules/display_themes/cards/source/public/icons/owbGrid.svg create mode 100644 packages/modules/display_themes/cards/source/public/icons/owbHouse.svg create mode 100644 packages/modules/display_themes/cards/source/public/icons/owbPV.svg create mode 100644 packages/modules/display_themes/cards/source/public/icons/owbVehicle.svg create mode 100644 packages/modules/display_themes/cards/source/src/components/DashBoard/FlowCard.vue create mode 100644 packages/modules/display_themes/cards/source/src/views/EnergyFlowView.vue diff --git a/packages/helpermodules/update_config.py b/packages/helpermodules/update_config.py index c9a1c68e39..0c844a825e 100644 --- a/packages/helpermodules/update_config.py +++ b/packages/helpermodules/update_config.py @@ -42,7 +42,7 @@ class UpdateConfig: - DATASTORE_VERSION = 52 + DATASTORE_VERSION = 53 valid_topic = [ "^openWB/bat/config/configured$", "^openWB/bat/set/charging_power_left$", @@ -1626,3 +1626,17 @@ def upgrade(topic: str, payload) -> None: Pub().pub(topic, payload) self._loop_all_received_topics(upgrade) self.__update_topic("openWB/system/datastore_version", 52) + + +def upgrade_datastore_52(self) -> None: + def upgrade(topic: str, payload) -> Optional[dict]: + if "openWB/optional/int_display/theme" == topic: + configuration_payload = decode_payload(payload) + if configuration_payload.get("type") == "cards": + configuration_payload["configuration"].update({ + "enable_energy_flow_view": True, + "enable_dashboard_card_vehicles": True, + }) + return {topic: configuration_payload} + self._loop_all_received_topics(upgrade) + self.__update_topic("openWB/system/datastore_version", 51) diff --git a/packages/modules/display_themes/cards/config.py b/packages/modules/display_themes/cards/config.py index da17e3c042..4dfa5f89b8 100644 --- a/packages/modules/display_themes/cards/config.py +++ b/packages/modules/display_themes/cards/config.py @@ -15,6 +15,8 @@ def __init__(self, enable_dashboard_card_battery_sum: bool = True, enable_dashboard_card_inverter_sum: bool = True, enable_dashboard_card_charge_point_sum: bool = True, + enable_dashboard_card_vehicles: bool = True, + enable_energy_flow_view: bool = True, enable_charge_points_view: bool = True, enable_status_view: bool = True) -> None: # display lock settings @@ -27,6 +29,9 @@ def __init__(self, self.enable_dashboard_card_battery_sum = enable_dashboard_card_battery_sum self.enable_dashboard_card_inverter_sum = enable_dashboard_card_inverter_sum self.enable_dashboard_card_charge_point_sum = enable_dashboard_card_charge_point_sum + self.enable_dashboard_card_vehicles = enable_dashboard_card_vehicles + # energy flow settings + self.enable_energy_flow_view = enable_energy_flow_view # charge point settings self.enable_charge_points_view = enable_charge_points_view # state settings diff --git a/packages/modules/display_themes/cards/source/public/icons/icon_Data.md b/packages/modules/display_themes/cards/source/public/icons/icon_Data.md new file mode 100644 index 0000000000..e0977a0983 --- /dev/null +++ b/packages/modules/display_themes/cards/source/public/icons/icon_Data.md @@ -0,0 +1,3 @@ + +Herkunft der Icons: +https://www.veryicon.com/ \ No newline at end of file diff --git a/packages/modules/display_themes/cards/source/public/icons/owbBattery.svg b/packages/modules/display_themes/cards/source/public/icons/owbBattery.svg new file mode 100644 index 0000000000..dd1fc748d3 --- /dev/null +++ b/packages/modules/display_themes/cards/source/public/icons/owbBattery.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/modules/display_themes/cards/source/public/icons/owbChargePoint.svg b/packages/modules/display_themes/cards/source/public/icons/owbChargePoint.svg new file mode 100644 index 0000000000..29cca3f93c --- /dev/null +++ b/packages/modules/display_themes/cards/source/public/icons/owbChargePoint.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/modules/display_themes/cards/source/public/icons/owbGrid.svg b/packages/modules/display_themes/cards/source/public/icons/owbGrid.svg new file mode 100644 index 0000000000..e098048efa --- /dev/null +++ b/packages/modules/display_themes/cards/source/public/icons/owbGrid.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/modules/display_themes/cards/source/public/icons/owbHouse.svg b/packages/modules/display_themes/cards/source/public/icons/owbHouse.svg new file mode 100644 index 0000000000..412dc8613b --- /dev/null +++ b/packages/modules/display_themes/cards/source/public/icons/owbHouse.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/modules/display_themes/cards/source/public/icons/owbPV.svg b/packages/modules/display_themes/cards/source/public/icons/owbPV.svg new file mode 100644 index 0000000000..becf88bc97 --- /dev/null +++ b/packages/modules/display_themes/cards/source/public/icons/owbPV.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/modules/display_themes/cards/source/public/icons/owbVehicle.svg b/packages/modules/display_themes/cards/source/public/icons/owbVehicle.svg new file mode 100644 index 0000000000..e721de12f4 --- /dev/null +++ b/packages/modules/display_themes/cards/source/public/icons/owbVehicle.svg @@ -0,0 +1,39 @@ + + + + + + diff --git a/packages/modules/display_themes/cards/source/src/components/DashBoard/BatteryCard.vue b/packages/modules/display_themes/cards/source/src/components/DashBoard/BatteryCard.vue index a11dc203f3..6560982f24 100644 --- a/packages/modules/display_themes/cards/source/src/components/DashBoard/BatteryCard.vue +++ b/packages/modules/display_themes/cards/source/src/components/DashBoard/BatteryCard.vue @@ -29,8 +29,8 @@ export default { Speicher +import { useMqttStore } from "@/stores/mqtt.js"; +import DashBoardCard from "@/components/DashBoardCard.vue"; + +export default { + name: "DashboardFlowCard", + components: { + DashBoardCard, + }, + props: { + changesLocked: { required: false, type: Boolean, default: false }, + }, + data() { + return { + mqttStore: useMqttStore(), + svgSize: { + xMin: 0, // viewBox min x + xMax: 150, // viewBox max x + yMin: 0, // viewBox min y + yMax: 105, // viewBox max y + circleRadius: 10, + strokeWidth: 0.5, + textSize: 5, + numRows: 4, + numColumns: 3, + }, + }; + }, + computed: { + // calculated svg coordinates + svgViewBox() { + return `${this.svgSize.xMin} ${this.svgSize.yMin} ${this.svgSize.xMax} ${this.svgSize.yMax}`; + }, + svgFontSize() { + return `${this.svgSize.textSize}px`; + }, + svgRectWidth() { + return ( + (this.svgSize.xMax - this.svgSize.xMin - this.svgSize.strokeWidth) / + this.svgSize.numColumns + ); + }, + svgStrokeWidth() { + return this.svgSize.strokeWidth; + }, + svgIconWidth() { + return this.svgSize.circleRadius; + }, + svgIconHeight() { + return this.svgSize.circleRadius; + }, + + // component values + gridPower() { + return this.mqttStore.getGridPower("object"); + }, + pvPower() { + return this.mqttStore.getPvPower("object"); + }, + homePower() { + return this.mqttStore.getHomePower("object"); + }, + batteryPower() { + return this.mqttStore.getBatteryPower("object"); + }, + batterySoc() { + return this.mqttStore.getBatterySoc("object").value / 100; + }, + connectedChargePoints() { + return this.mqttStore.getChargePointIds; + }, + chargePoint1Power() { + if (this.connectedChargePoints.length > 0) { + return ( + this.mqttStore.getChargePointPower( + this.connectedChargePoints[0], + "object", + ) || { textValue: "Loading..." } + ); + } + return { textValue: "N/A" }; + }, + chargePoint2Power() { + if (this.connectedChargePoints.length > 1) { + return ( + this.mqttStore.getChargePointPower( + this.connectedChargePoints[1], + "object", + ) || { textValue: "Loading..." } + ); + } + return { textValue: "N/A" }; + }, + chargePoint1Name() { + return this.mqttStore.getChargePointName(this.connectedChargePoints[0]); + }, + chargePoint2Name() { + return this.mqttStore.getChargePointName(this.connectedChargePoints[1]); + }, + chargePoint1VehicleConnected() { + return this.mqttStore.getChargePointPlugState(this.connectedChargePoints[0]); + }, + chargePoint2VehicleConnected() { + return this.mqttStore.getChargePointPlugState(this.connectedChargePoints[1]); + }, + chargePoint1ConnectedVehicleName() { + return this.mqttStore.getChargePointConnectedVehicleName( + this.connectedChargePoints[0], + ); + }, + chargePoint2ConnectedVehicleName() { + return this.mqttStore.getChargePointConnectedVehicleName( + this.connectedChargePoints[1], + ); + }, + chargePoint1ConnectedVehicleChargeMode() { + return this.mqttStore.getChargePointConnectedVehicleChargeMode( + this.connectedChargePoints[0], + ); + }, + chargePoint2ConnectedVehicleChargeMode() { + return this.mqttStore.getChargePointConnectedVehicleChargeMode( + this.connectedChargePoints[1], + ); + }, + chargePoint1ConnectedVehicleSoc() { + return ( + this.mqttStore.getChargePointConnectedVehicleSoc( + this.connectedChargePoints[0], + ).soc / 100 + ); + }, + chargePoint2ConnectedVehicleSoc() { + return ( + this.mqttStore.getChargePointConnectedVehicleSoc( + this.connectedChargePoints[1], + ).soc / 100 + ); + }, + isAnimatedGrid() { + return this.gridPower.value > 0; + }, + isAnimatedGridReverse() { + return this.gridPower.value < 0; + }, + isAnimatedPV() { + return this.pvPower.value > 100; + }, + isAnimatedHome() { + return this.homePower.value > 0; + }, + isAnimatedBattery() { + return this.batteryPower.value < 0; + }, + isAnimatedBatteryReverse() { + return this.batteryPower.value > 0; + }, + isAnimatedChargePoint1() { + return this.chargePoint1Power.value < 0; + }, + isAnimatedChargePoint1Reverse() { + return this.chargePoint1Power.value > 0; + }, + isAnimatedChargePoint2() { + return this.chargePoint2Power.value < 0; + }, + isAnimatedChargePoint2Reverse() { + return this.chargePoint2Power.value > 0; + }, + gridPositive() { + return this.gridPower.value > 0; + }, + pvPositive() { + return this.pvPower.value > 100; + }, + homePositive() { + return this.homePower.value > 0; + }, + batteryPositive() { + return this.batteryPower.value > 0; + }, + chargePoint1Positive() { + return this.chargePoint1Power.value > 0; + }, + chargePoint2Positive() { + return this.chargePoint2Power.value > 0; + }, + svgComponents() { + var components = []; + if (this.mqttStore.getThemeConfiguration.enable_dashboard_card_grid) { + components.push( + { + id: "grid", + class: { + base: "grid", + valueLabel: this.gridPositive ? "fill-danger" : "fill-success", + animated: this.isAnimatedGrid, + animatedReverse: !this.gridPositive, + }, + position: { + row: 0, + column: 0, + }, + label: ["EVU", this.gridPower.textValue], + icon: "icons/owbGrid.svg", + }, + ); + } + if (this.mqttStore.getThemeConfiguration.enable_dashboard_card_home_consumption) { + components.push( + { + id: "home", + class: { + base: "home", + valueLabel: "", + animated: this.isAnimatedHome, + animatedReverse: this.homePositive, + }, + position: { + row: 0, + column: 2, + }, + label: ["Haus", this.homePower.textValue], + icon: "icons/owbHouse.svg", + }, + ); + } + if (this.mqttStore.getPvConfigured && this.mqttStore.getThemeConfiguration.enable_dashboard_card_inverter_sum) { + components.push({ + id: "pv", + class: { + base: "pv", + valueLabel: this.pvPositive ? "fill-success" : "", + animated: this.isAnimatedPV, + animatedReverse: !this.pvPositive, + }, + position: { + row: 1, + column: 0, + }, + label: ["PV", this.pvPower.textValue], + icon: "icons/owbPV.svg", + }); + } + if (this.mqttStore.getBatteryConfigured && this.mqttStore.getThemeConfiguration.enable_dashboard_card_battery_sum) { + components.push({ + id: "battery", + class: { + base: "battery", + valueLabel: "", + animated: this.isAnimatedBattery, + animatedReverse: this.isAnimatedBatteryReverse, + }, + position: { + row: 1, + column: 2, + }, + label: ["Speicher", this.batteryPower.textValue], + soc: this.batterySoc, + icon: "icons/owbBattery.svg", + }); + } + if (this.connectedChargePoints.length > 0 && this.mqttStore.getThemeConfiguration.enable_dashboard_card_charge_point_sum) { + components.push({ + id: "charge-point-1", + class: { + base: "charge-point", + valueLabel: "", + animated: this.isAnimatedChargePoint1, + animatedReverse: this.isAnimatedChargePoint1Reverse, + }, + position: { + row: 2, + column: 0, + }, + label: [this.chargePoint1Name, this.chargePoint1Power.textValue], + icon: "icons/owbChargePoint.svg", + }); + } + if (this.connectedChargePoints.length > 1 && this.mqttStore.getThemeConfiguration.enable_dashboard_card_charge_point_sum) { + components.push({ + id: "charge-point-2", + class: { + base: "charge-point", + valueLabel: "", + animated: this.isAnimatedChargePoint2, + animatedReverse: this.isAnimatedChargePoint2Reverse, + }, + position: { + row: 2, + column: 2, + }, + label: [this.chargePoint2Name, this.chargePoint2Power.textValue], + icon: "icons/owbChargePoint.svg", + }); + } + if (this.chargePoint1VehicleConnected && this.mqttStore.getThemeConfiguration.enable_dashboard_card_vehicles) { + components.push({ + id: "vehicle-1", + class: { + base: "vehicle", + valueLabel: + "fill-" + this.chargePoint2ConnectedVehicleChargeMode.class, + }, + position: { + row: 3, + column: 0, + }, + label: [ + this.chargePoint1ConnectedVehicleName || "---", + this.chargePoint1ConnectedVehicleChargeMode.label || "---", + ], + soc: this.chargePoint1ConnectedVehicleSoc, + icon: "icons/owbVehicle.svg", + }); + } + if (this.chargePoint2VehicleConnected && this.mqttStore.getThemeConfiguration.enable_dashboard_card_vehicles) { + components.push({ + id: "vehicle-2", + class: { + base: "vehicle", + valueLabel: + "fill-" + this.chargePoint2ConnectedVehicleChargeMode.class, + }, + position: { + row: 3, + column: 2, + }, + label: [ + this.chargePoint2ConnectedVehicleName || "---", + this.chargePoint2ConnectedVehicleChargeMode.label || "---", + ], + soc: this.chargePoint2ConnectedVehicleSoc, + icon: "icons/owbVehicle.svg", + }); + } + return components; + }, + }, + methods: { + calcRowY(row) { + let yMin = + this.svgSize.yMin + + this.svgSize.strokeWidth + + this.svgSize.circleRadius; + let yMax = + this.svgSize.yMax - + this.svgSize.strokeWidth - + this.svgSize.circleRadius; + let yRange = yMax - yMin; + return row * (yRange / (this.svgSize.numRows - 1)) + yMin; + }, + calcColumnX(column) { + let xMin = + this.svgSize.xMin + this.svgSize.strokeWidth + this.svgRectWidth / 2; + let xMax = + this.svgSize.xMax - this.svgSize.strokeWidth - this.svgRectWidth / 2; + let xRange = xMax - xMin; + return column * (xRange / (this.svgSize.numColumns - 1)) + xMin; + }, + calcFlowLineAnchorX(column) { + let columnX = this.calcColumnX(column); + if (column < this.svgSize.numColumns / 2) + return columnX + this.svgRectWidth / 2 - this.svgSize.circleRadius; + else if (column > this.svgSize.numColumns / 2) + return columnX - this.svgRectWidth / 2 + this.svgSize.circleRadius; + return columnX; + }, + }, +}; + + + + + diff --git a/packages/modules/display_themes/cards/source/src/components/DashBoard/GridCard.vue b/packages/modules/display_themes/cards/source/src/components/DashBoard/GridCard.vue index e77629d398..bcc879bb9e 100644 --- a/packages/modules/display_themes/cards/source/src/components/DashBoard/GridCard.vue +++ b/packages/modules/display_themes/cards/source/src/components/DashBoard/GridCard.vue @@ -29,7 +29,7 @@ export default { EVU Übersicht + + Energiefluss + import("../views/EnergyFlowView.vue"), + }, { path: "/ChargePoints", name: "charge-points", 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 c23f4bbb62..6aa76f6ffc 100644 --- a/packages/modules/display_themes/cards/source/src/stores/mqtt.js +++ b/packages/modules/display_themes/cards/source/src/stores/mqtt.js @@ -132,8 +132,9 @@ export const useMqttStore = defineStore("mqtt", { minimumFractionDigits: 0, maximumFractionDigits: 0, }); - while (scale && (value > 999 || value < -999)) { - value = value / 1000; + var scaledValue = value; + while (scale && (scaledValue > 999 || scaledValue < -999)) { + scaledValue = scaledValue / 1000; scaled = true; switch (unitPrefix) { case "": @@ -147,12 +148,18 @@ export const useMqttStore = defineStore("mqtt", { break; } } - textValue = value.toLocaleString(undefined, { + textValue = scaledValue.toLocaleString(undefined, { minimumFractionDigits: scaled ? 2 : 0, maximumFractionDigits: scaled ? 2 : 0, }); } - return `${textValue} ${unitPrefix}${unit}`; + return { + textValue: `${textValue} ${unitPrefix}${unit}`, + value: value, + unit: unit, + scaledValue: scaledValue, + scaledUnit: `${unitPrefix}${unit}`, + }; }; }, getChartData: (state) => { @@ -185,6 +192,13 @@ export const useMqttStore = defineStore("mqtt", { } return true; }, + getEnergyFlowEnabled(state) { + if (state.getThemeConfiguration) { + return state.getThemeConfiguration.enable_energy_flow_view; + } + return true; + }, + getChargePointsEnabled(state) { if (state.getThemeConfiguration) { return state.getThemeConfiguration.enable_charge_points_view; @@ -262,11 +276,23 @@ export const useMqttStore = defineStore("mqtt", { return undefined; }, getGridPower(state) { - let gridId = state.getGridId; - if (gridId === undefined) { - return "---"; - } - return state.getValueString(`openWB/counter/${gridId}/get/power`, "W"); + return (returnType = "textValue") => { + let gridId = state.getGridId; + if (gridId === undefined) { + return "---"; + } + let power = state.getValueString( + `openWB/counter/${gridId}/get/power`, + "W", + ); + if (Object.hasOwnProperty.call(power, returnType)) { + return power[returnType]; + } + if (returnType == "object") { + return power; + } + console.error("returnType not found!", returnType, power); + }; }, getGridPowerChartData(state) { let gridId = state.getGridId; @@ -276,7 +302,19 @@ export const useMqttStore = defineStore("mqtt", { return state.getChartData(`openWB/counter/${gridId}/get/power`); }, getHomePower(state) { - return state.getValueString("openWB/counter/set/home_consumption", "W"); + return (returnType = "textValue") => { + let power = state.getValueString( + "openWB/counter/set/home_consumption", + "W", + ); + if (Object.hasOwnProperty.call(power, returnType)) { + return power[returnType]; + } + if (returnType == "object") { + return power; + } + console.error("returnType not found!", returnType, power); + }; }, getHomePowerChartData(state) { return state.getChartData("openWB/counter/set/home_consumption"); @@ -285,13 +323,31 @@ export const useMqttStore = defineStore("mqtt", { return state.getValueBool("openWB/bat/config/configured"); }, getBatteryPower(state) { - return state.getValueString("openWB/bat/get/power", "W"); + return (returnType = "textValue") => { + let power = state.getValueString("openWB/bat/get/power", "W"); + if (Object.hasOwnProperty.call(power, returnType)) { + return power[returnType]; + } + if (returnType == "object") { + return power; + } + console.error("returnType not found!", returnType, power); + }; }, getBatteryPowerChartData(state) { return state.getChartData("openWB/bat/get/power"); }, getBatterySoc(state) { - return state.getValueString("openWB/bat/get/soc", "%", "", false); + return (returnType = "textValue") => { + let soc = state.getValueString("openWB/bat/get/soc", "%", "", false); + if (Object.hasOwnProperty.call(soc, returnType)) { + return soc[returnType]; + } + if (returnType == "object") { + return soc; + } + console.error("returnType not found!", returnType, soc); + }; }, getBatterySocChartData(state) { return state.getChartData("openWB/bat/get/soc"); @@ -300,7 +356,22 @@ export const useMqttStore = defineStore("mqtt", { return state.getValueBool("openWB/pv/config/configured"); }, getPvPower(state) { - return state.getValueString("openWB/pv/get/power", "W", "", true, true); + return (returnType = "textValue") => { + var power = state.getValueString( + "openWB/pv/get/power", + "W", + "", + true, + true, + ); + if (Object.hasOwnProperty.call(power, returnType)) { + return power[returnType]; + } + if (returnType == "object") { + return power; + } + console.error("returnType not found!", returnType, power); + }; }, getPvPowerChartData(state) { return state.getChartData("openWB/pv/get/power").map((point) => { @@ -311,7 +382,19 @@ export const useMqttStore = defineStore("mqtt", { /* charge point getters */ getChargePointSumPower(state) { - return state.getValueString("openWB/chargepoint/get/power", "W"); + return (returnType = "textValue") => { + var power = state.getValueString( + "openWB/chargepoint/get/power", + "W", + ); + if (Object.hasOwnProperty.call(power, returnType)) { + return power[returnType]; + } + if (returnType == "object") { + return power; + } + console.error("returnType not found!", returnType, power); + }; }, getChargePointSumPowerChartData(state) { return state.getChartData("openWB/chargepoint/get/power"); @@ -340,11 +423,18 @@ export const useMqttStore = defineStore("mqtt", { }; }, getChargePointPower(state) { - return (chargePointId) => { - return state.getValueString( + return (chargePointId, returnType = "textValue") => { + var power = state.getValueString( `openWB/chargepoint/${chargePointId}/get/power`, "W", ); + if (Object.hasOwnProperty.call(power, returnType)) { + return power[returnType]; + } + if (returnType == "object") { + return power; + } + console.error("returnType not found!", returnType, power); }; }, getChargePointImportedSincePlugged(state) { @@ -358,7 +448,7 @@ export const useMqttStore = defineStore("mqtt", { false, "---", "imported_since_plugged", - ), + ).textValue, range: state.getValueString( `openWB/chargepoint/${chargePointId}/set/log`, "m", @@ -367,7 +457,7 @@ export const useMqttStore = defineStore("mqtt", { false, "---", "range_charged", - ), + ).textValue, }; }; }, @@ -379,11 +469,15 @@ export const useMqttStore = defineStore("mqtt", { }; }, getChargePointSetCurrent(state) { - return (chargePointId) => { - return state.getValueString( - `openWB/chargepoint/${chargePointId}/set/current`, - "A", - ); + return (chargePointId, returnType = "textValue") => { + let power = state.getValueString(`openWB/chargepoint/${chargePointId}/set/current`, "A"); + if (Object.hasOwnProperty.call(power, returnType)) { + return power[returnType]; + } + if (returnType == "object") { + return power; + } + console.error("returnType not found!", returnType, power); }; }, getChargePointPhasesInUse(state) { diff --git a/packages/modules/display_themes/cards/source/src/views/EnergyFlowView.vue b/packages/modules/display_themes/cards/source/src/views/EnergyFlowView.vue new file mode 100644 index 0000000000..fc7c374ba6 --- /dev/null +++ b/packages/modules/display_themes/cards/source/src/views/EnergyFlowView.vue @@ -0,0 +1,19 @@ + + + + + diff --git a/packages/modules/display_themes/cards/source/src/views/WelcomeView.vue b/packages/modules/display_themes/cards/source/src/views/WelcomeView.vue index 63edb8a346..5c0a7f6f6b 100644 --- a/packages/modules/display_themes/cards/source/src/views/WelcomeView.vue +++ b/packages/modules/display_themes/cards/source/src/views/WelcomeView.vue @@ -14,6 +14,9 @@ export default { if (this.mqttStore.getThemeConfiguration.enable_dashboard_view) { return "dash-board"; } + if (this.mqttStore.getThemeConfiguration.enable_energy_flow_view) { + return "energy-flow"; + } if (this.mqttStore.getThemeConfiguration.enable_charge_points_view) { return "charge-points"; } From bfb4c9316556f7a3f6159251397a1507e5d8996d Mon Sep 17 00:00:00 2001 From: Lutz Bender Date: Thu, 11 Jul 2024 15:43:35 +0200 Subject: [PATCH 02/16] fix vehicle settings header --- .../cards/source/src/views/ChargePointsView.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 fb69bb95fe..e104b96f4c 100644 --- a/packages/modules/display_themes/cards/source/src/views/ChargePointsView.vue +++ b/packages/modules/display_themes/cards/source/src/views/ChargePointsView.vue @@ -656,8 +656,8 @@ export default { From 42351cb44920766b7ed49f5f5621ce03921df141 Mon Sep 17 00:00:00 2001 From: Lutz Bender Date: Thu, 11 Jul 2024 15:43:46 +0200 Subject: [PATCH 03/16] enlarge some elements --- .../display_themes/cards/source/src/components/NavBar.vue | 2 +- .../cards/source/src/components/Status/RebootButton.vue | 2 +- .../cards/source/src/components/Status/ReloadButton.vue | 2 +- .../cards/source/src/components/Status/ShutdownButton.vue | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/modules/display_themes/cards/source/src/components/NavBar.vue b/packages/modules/display_themes/cards/source/src/components/NavBar.vue index 51ee9111b9..e65ac4d69c 100644 --- a/packages/modules/display_themes/cards/source/src/components/NavBar.vue +++ b/packages/modules/display_themes/cards/source/src/components/NavBar.vue @@ -14,7 +14,7 @@ export default {