From 8c46a1c84b2b23b982487ef5a3c5b3b59b099185 Mon Sep 17 00:00:00 2001 From: Lutz Bender Date: Wed, 16 Feb 2022 13:48:20 +0100 Subject: [PATCH 1/3] add mqtt clientId to component state mixin --- src/App.vue | 10 ++++++++++ src/components/mixins/ComponentState.vue | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/src/App.vue b/src/App.vue index 417c7de3..61e4e262 100644 --- a/src/App.vue +++ b/src/App.vue @@ -58,6 +58,16 @@ export default { }; }, computed: { + /** + * @return {Str} - Mqtt client id of our connection + */ + mqttClientId() { + try { + return this.client.options.clientId; + } catch (error) { + return undefined; + } + }, /** * @return {Array} - Array of topics (String) */ diff --git a/src/components/mixins/ComponentState.vue b/src/components/mixins/ComponentState.vue index 25156cfe..996043df 100644 --- a/src/components/mixins/ComponentState.vue +++ b/src/components/mixins/ComponentState.vue @@ -13,6 +13,9 @@ export default { "Sonntag", ]; }, + mqttClientId() { + return this.$root.mqttClientId; + }, }, methods: { updateState(topic, value, objectPath = undefined) { @@ -82,6 +85,9 @@ export default { }, }, mounted() { + this.mqttTopicsToSubscribe.push( + "openWB/log/" + this.mqttClientId + "/data" + ); this.mqttTopicsToSubscribe.forEach((topic) => { if (topic.includes("#") || topic.includes("+")) { console.debug("skipping init of wildcard topic:", topic); From 4c0a54442a596e8856be0359716ae81e14e3087b Mon Sep 17 00:00:00 2001 From: Lutz Bender Date: Wed, 16 Feb 2022 13:49:06 +0100 Subject: [PATCH 2/3] add debug graph data in charge log --- src/views/ChargeLog.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/views/ChargeLog.vue b/src/views/ChargeLog.vue index f857870e..a50e6080 100644 --- a/src/views/ChargeLog.vue +++ b/src/views/ChargeLog.vue @@ -6,7 +6,7 @@ title="Zeitraum" subtype="month" min="2018-01" - max="2021-12" + max="2022-12" v-model="chargeLogDate" /> + +
{{
+					JSON.stringify(
+						$store.state.mqtt[
+							"openWB/log/" + mqttClientId + "/data"
+						]
+					)
+				}}
+
From 5667ab3cb0f902eb175afba62491b5be8e2be249 Mon Sep 17 00:00:00 2001 From: Lutz Bender Date: Wed, 16 Feb 2022 13:49:56 +0100 Subject: [PATCH 3/3] beginning of daily graph page --- src/components/OpenwbPageNavbar.vue | 27 ++++++++ src/router/index.js | 12 ++++ src/views/DailyGraph.vue | 104 ++++++++++++++++++++++++++++ 3 files changed, 143 insertions(+) create mode 100644 src/views/DailyGraph.vue diff --git a/src/components/OpenwbPageNavbar.vue b/src/components/OpenwbPageNavbar.vue index 9f3f058e..d7d8fef6 100644 --- a/src/components/OpenwbPageNavbar.vue +++ b/src/components/OpenwbPageNavbar.vue @@ -198,6 +198,33 @@ Status +