From 89266d9af45569cdb0f2019e2bbc52120f6bd38e Mon Sep 17 00:00:00 2001 From: Brett-S-OWB Date: Wed, 15 Jul 2026 17:22:14 +0200 Subject: [PATCH 1/4] Add consumer component to display flow chart --- .../display_themes/cards/source/src/App.vue | 2 ++ .../source/src/assets/icons/owbConsumer.svg | 1 + .../src/components/Dashboard/FlowCard.vue | 34 +++++++++++++++++++ .../display_themes/cards/source/src/main.scss | 1 + .../cards/source/src/stores/mqtt.js | 18 ++++++++++ 5 files changed, 56 insertions(+) create mode 100644 packages/modules/display_themes/cards/source/src/assets/icons/owbConsumer.svg diff --git a/packages/modules/display_themes/cards/source/src/App.vue b/packages/modules/display_themes/cards/source/src/App.vue index 6058e5320e..89dbc297c7 100644 --- a/packages/modules/display_themes/cards/source/src/App.vue +++ b/packages/modules/display_themes/cards/source/src/App.vue @@ -60,6 +60,8 @@ export default { "openWB/chargepoint/+/set/log", "openWB/chargepoint/+/set/rfid", "openWB/chargepoint/get/power", + "openWB/consumer/+/module", + "openWB/consumer/get/power", "openWB/counter/+/get/power", "openWB/counter/get/hierarchy", "openWB/counter/set/home_consumption", diff --git a/packages/modules/display_themes/cards/source/src/assets/icons/owbConsumer.svg b/packages/modules/display_themes/cards/source/src/assets/icons/owbConsumer.svg new file mode 100644 index 0000000000..ee05b02183 --- /dev/null +++ b/packages/modules/display_themes/cards/source/src/assets/icons/owbConsumer.svg @@ -0,0 +1 @@ + diff --git a/packages/modules/display_themes/cards/source/src/components/Dashboard/FlowCard.vue b/packages/modules/display_themes/cards/source/src/components/Dashboard/FlowCard.vue index 2c00091667..89634a387d 100644 --- a/packages/modules/display_themes/cards/source/src/components/Dashboard/FlowCard.vue +++ b/packages/modules/display_themes/cards/source/src/components/Dashboard/FlowCard.vue @@ -10,6 +10,7 @@ import PvIcon from "../../assets/icons/owbPV.svg?component"; import HouseIcon from "../../assets/icons/owbHouse.svg?component"; import VehicleIcon from "../../assets/icons/owbVehicle.svg?component"; import ChargePointIcon from "../../assets/icons/owbChargePoint.svg?component"; +import ConsumerIcon from "../../assets/icons/owbConsumer.svg?component"; export default { name: "DashboardFlowCard", @@ -84,6 +85,12 @@ export default { showHomePower() { return this.homePower.value !== undefined; }, + consumerPower() { + return this.mqttStore.getConsumerSumPower("object"); + }, + showConsumerPower() { + return this.mqttStore.getConsumerIds.length > 0; + }, batteryPower() { return this.mqttStore.getBatteryPower("object"); }, @@ -255,6 +262,9 @@ export default { homeProduction() { return this.homePower.value < 0; }, + consumerConsuming() { + return this.consumerPower.value > 0; + }, pvProduction() { return this.pvPower.value < 0; }, @@ -355,6 +365,25 @@ export default { iconColor: "var(--color--light)", }); } + // add consumer sum component + if (this.showConsumerPower) { + components.push({ + id: "consumer", + class: { + base: "consumer", + valueLabel: "", + animated: false, + animatedReverse: this.consumerConsuming, + }, + position: { + row: 0, + column: 1, + }, + label: ["Verbraucher", this.absoluteValue(this.consumerPower).textValue], + iconComponent: ConsumerIcon, + iconColor: "var(--color--consumer)", + }); + } // add pv sum component if ( this.mqttStore.getPvConfigured && @@ -970,6 +999,11 @@ path.animatedReverse.grid { stroke: var(--color--success); } +path.animated.consumer, +path.animatedReverse.consumer { + stroke: var(--color--consumer); +} + path.animated.pv, path.animatedReverse.pv { stroke: var(--color--success); diff --git a/packages/modules/display_themes/cards/source/src/main.scss b/packages/modules/display_themes/cards/source/src/main.scss index 815184bfc9..7126d07f2f 100644 --- a/packages/modules/display_themes/cards/source/src/main.scss +++ b/packages/modules/display_themes/cards/source/src/main.scss @@ -4,6 +4,7 @@ :root { --spacing: 0.5rem; --body--background--dark: #242526; + --color--consumer: #7d42f5; } /* prevent touch gestures */ 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 aa4c0218ba..f88736f9eb 100644 --- a/packages/modules/display_themes/cards/source/src/stores/mqtt.js +++ b/packages/modules/display_themes/cards/source/src/stores/mqtt.js @@ -424,6 +424,24 @@ export const useMqttStore = defineStore("mqtt", { }); }, + /* consumer getters */ + + getConsumerIds(state) { + return state.getWildcardIndexList("openWB/consumer/+/module"); + }, + getConsumerSumPower(state) { + return (returnType = "textValue") => { + var power = state.getValueString("openWB/consumer/get/power", "W"); + if (Object.hasOwnProperty.call(power, returnType)) { + return power[returnType]; + } + if (returnType == "object") { + return power; + } + console.error("returnType not found!", returnType, power); + }; + }, + /* charge point getters */ getChargePointSumPower(state) { From 391a9ccb5abcdb8bbfca977a55731b0e1c91076b Mon Sep 17 00:00:00 2001 From: Brett-S-OWB Date: Thu, 16 Jul 2026 16:44:58 +0200 Subject: [PATCH 2/4] Add user management role --- .../config/mosquitto/public/default-dynamic-security.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/data/config/mosquitto/public/default-dynamic-security.json b/data/config/mosquitto/public/default-dynamic-security.json index e1d2f2ca31..4988e91592 100644 --- a/data/config/mosquitto/public/default-dynamic-security.json +++ b/data/config/mosquitto/public/default-dynamic-security.json @@ -70,7 +70,7 @@ "anonymousGroup": "anonymous", "roles": [ { - "rolename": "openwb-version:8", + "rolename": "openwb-version:9", "textname": "openWB Versionsnummer", "textdescription": "Diese Rolle ist ein Platzhalter für die openWB Versionsnummer und wird automatisch aktualisiert. Sie hat keine direkten Berechtigungen.", "acls": [] @@ -2926,6 +2926,12 @@ "topic": "openWB/consumer/get/+", "priority": 0, "allow": true + }, + { + "acltype": "publishClientReceive", + "topic": "openWB/consumer/+/module", + "priority": 0, + "allow": true } ] }, From 8f1724e86458b7717bea1c313667c5faa4e5bc6c Mon Sep 17 00:00:00 2001 From: Brett-S-OWB Date: Thu, 16 Jul 2026 17:31:14 +0200 Subject: [PATCH 3/4] Update individual consumer template --- data/config/mosquitto/public/role-templates.json | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/data/config/mosquitto/public/role-templates.json b/data/config/mosquitto/public/role-templates.json index f09a94e480..fb373199dd 100644 --- a/data/config/mosquitto/public/role-templates.json +++ b/data/config/mosquitto/public/role-templates.json @@ -80,25 +80,19 @@ "acls": [ { "acltype": "publishClientSend", - "topic": "openWB/set/consumer//set/charge_template", + "topic": "openWB/set/consumer//usage", "priority": 0, "allow": true }, { "acltype": "publishClientSend", - "topic": "openWB/set/consumer//set/manual_lock", + "topic": "openWB/set/command/+/todo/addConsumerSchedulePlan", "priority": 0, "allow": true }, { "acltype": "publishClientSend", - "topic": "openWB/set/consumer//config/ev", - "priority": 0, - "allow": true - }, - { - "acltype": "publishClientSend", - "topic": "openWB/set/consumer//get/rfid", + "topic": "openWB/set/command/+/todo/addConsumerTimePlan", "priority": 0, "allow": true }, From 635aafcae7de7df119ca7c82f5600334a48542c5 Mon Sep 17 00:00:00 2001 From: Brett-S-OWB Date: Mon, 20 Jul 2026 16:50:40 +0200 Subject: [PATCH 4/4] Update user management data and consumer detection --- data/config/mosquitto/public/default-dynamic-security.json | 6 ------ packages/modules/display_themes/cards/source/src/App.vue | 1 - .../cards/source/src/components/Dashboard/FlowCard.vue | 2 +- .../modules/display_themes/cards/source/src/stores/mqtt.js | 3 --- 4 files changed, 1 insertion(+), 11 deletions(-) diff --git a/data/config/mosquitto/public/default-dynamic-security.json b/data/config/mosquitto/public/default-dynamic-security.json index 4988e91592..238cc78842 100644 --- a/data/config/mosquitto/public/default-dynamic-security.json +++ b/data/config/mosquitto/public/default-dynamic-security.json @@ -2926,12 +2926,6 @@ "topic": "openWB/consumer/get/+", "priority": 0, "allow": true - }, - { - "acltype": "publishClientReceive", - "topic": "openWB/consumer/+/module", - "priority": 0, - "allow": true } ] }, diff --git a/packages/modules/display_themes/cards/source/src/App.vue b/packages/modules/display_themes/cards/source/src/App.vue index 89dbc297c7..4e39aaac5d 100644 --- a/packages/modules/display_themes/cards/source/src/App.vue +++ b/packages/modules/display_themes/cards/source/src/App.vue @@ -60,7 +60,6 @@ export default { "openWB/chargepoint/+/set/log", "openWB/chargepoint/+/set/rfid", "openWB/chargepoint/get/power", - "openWB/consumer/+/module", "openWB/consumer/get/power", "openWB/counter/+/get/power", "openWB/counter/get/hierarchy", diff --git a/packages/modules/display_themes/cards/source/src/components/Dashboard/FlowCard.vue b/packages/modules/display_themes/cards/source/src/components/Dashboard/FlowCard.vue index 89634a387d..cccbf1afcb 100644 --- a/packages/modules/display_themes/cards/source/src/components/Dashboard/FlowCard.vue +++ b/packages/modules/display_themes/cards/source/src/components/Dashboard/FlowCard.vue @@ -89,7 +89,7 @@ export default { return this.mqttStore.getConsumerSumPower("object"); }, showConsumerPower() { - return this.mqttStore.getConsumerIds.length > 0; + return this.consumerPower.value !== undefined; }, batteryPower() { return this.mqttStore.getBatteryPower("object"); 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 f88736f9eb..6d33f908e0 100644 --- a/packages/modules/display_themes/cards/source/src/stores/mqtt.js +++ b/packages/modules/display_themes/cards/source/src/stores/mqtt.js @@ -426,9 +426,6 @@ export const useMqttStore = defineStore("mqtt", { /* consumer getters */ - getConsumerIds(state) { - return state.getWildcardIndexList("openWB/consumer/+/module"); - }, getConsumerSumPower(state) { return (returnType = "textValue") => { var power = state.getValueString("openWB/consumer/get/power", "W");