From 836e41c4428e47e2202f1b7b4afd8aead216ad0c Mon Sep 17 00:00:00 2001 From: Michael Geers Date: Mon, 24 Mar 2025 20:54:13 +0100 Subject: [PATCH] Config UI: solar tariff configured (#20079) --- assets/js/components/Config/DeviceTags.vue | 1 + assets/js/views/Config.vue | 12 ++++++++++-- core/site.go | 1 + i18n/de.toml | 1 + i18n/en.toml | 1 + 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/assets/js/components/Config/DeviceTags.vue b/assets/js/components/Config/DeviceTags.vue index 89c4210d6..ea38e8d13 100644 --- a/assets/js/components/Config/DeviceTags.vue +++ b/assets/js/components/Config/DeviceTags.vue @@ -52,6 +52,7 @@ export default { } switch (name) { case "power": + case "solarForecast": return this.fmtW(value); case "energy": case "capacity": diff --git a/assets/js/views/Config.vue b/assets/js/views/Config.vue index 0a70c12bc..71132dc85 100644 --- a/assets/js/views/Config.vue +++ b/assets/js/views/Config.vue @@ -510,8 +510,13 @@ export default { return this.getChargerById(this.selectedChargerId)?.name; }, tariffTags() { - const { currency, tariffGrid, tariffFeedIn, tariffCo2 } = store.state; - if (tariffGrid === undefined && tariffFeedIn === undefined && tariffCo2 === undefined) { + const { currency, tariffGrid, tariffFeedIn, tariffCo2, tariffSolar } = store.state; + if ( + tariffGrid === undefined && + tariffFeedIn === undefined && + tariffCo2 === undefined && + tariffSolar === undefined + ) { return null; } const tags = {}; @@ -527,6 +532,9 @@ export default { if (tariffCo2) { tags.co2 = { value: tariffCo2 }; } + if (tariffSolar) { + tags.solarForecast = { value: tariffSolar }; + } return tags; }, mqttTags() { diff --git a/core/site.go b/core/site.go index 256ab3ae9..420f4937f 100644 --- a/core/site.go +++ b/core/site.go @@ -969,6 +969,7 @@ func (site *Site) prepare() { } site.publishVehicles() + site.publishTariffs(0, 0) vehicle.Publish = site.publishVehicles } diff --git a/i18n/de.toml b/i18n/de.toml index 70aea2609..b43277ac3 100644 --- a/i18n/de.toml +++ b/i18n/de.toml @@ -95,6 +95,7 @@ powerRange = "Leistung" range = "Reichweite" singlePhase = "Einphasig" soc = "Ladestand" +solarForecast = "PV-Vorhersage" temp = "Temperatur" topic = "Thema" url = "URL" diff --git a/i18n/en.toml b/i18n/en.toml index 445db7cdf..fb0259fbb 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -95,6 +95,7 @@ powerRange = "Power" range = "Range" singlePhase = "Single phase" soc = "Charge" +solarForecast = "Solar forecast" temp = "Temperature" topic = "Topic" url = "URL"