diff --git a/ROADMAP.md b/ROADMAP.md index 531a54b..87a152b 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -96,3 +96,4 @@ | v1.8.19 | 2026-05-05 | Fix: Mobile-Layout — Tabs scrollen, kein horizontaler Overflow | | v1.8.20 | 2026-05-05 | Fix: Eigenversorgungskarte bei PV offline, Stromtarif-Einstellungen gehen nicht verloren | | v1.8.21 | 2026-05-05 | Fix: Finanzen-Tab bleibt nicht bei "Lade..." hängen (fEur/fKwh Scope-Bug) | +| v1.8.22 | 2026-05-06 | Fix: Stromtarif-Einstellungen bleiben nach Neustart erhalten; Finanzen-Tab Layout | diff --git a/haos-addon/config.yaml b/haos-addon/config.yaml index 642fba1..fc4a1ce 100644 --- a/haos-addon/config.yaml +++ b/haos-addon/config.yaml @@ -1,5 +1,5 @@ name: ShineBridge -version: "1.8.21" +version: "1.8.22" slug: shinebridge description: Growatt Wechselrichter lokal in Home Assistant — Modbus TCP via ShineLAN-X, MQTT Discovery, Web UI url: https://gitea.bitfire.work/retr0/shinebridge diff --git a/haos-addon/src/main.py b/haos-addon/src/main.py index b990f72..29b2cdb 100644 --- a/haos-addon/src/main.py +++ b/haos-addon/src/main.py @@ -952,8 +952,12 @@ if __name__ == "__main__": history.init_db() cfg = load_config() with State.lock: - State.mqtt_cfg = {k: cfg[k] for k in - ("mqtt_broker", "mqtt_port", "mqtt_user", "mqtt_pass")} + State.mqtt_cfg = {k: cfg[k] for k in ( + "mqtt_broker", "mqtt_port", "mqtt_user", "mqtt_pass", + "price_import", "price_export", "billing_day", "billing_month", + "tariff_type", "spot_country", "spot_markup", "spot_chart", + "billing_tracker_enabled", "monthly_rate_eur", "grundpreis_eur_per_month", + ) if k in cfg} State.inverters_cfg = cfg.get("inverters", []) State.surplus_devices_cfg = cfg.get("surplus_devices", []) State.z2m_base = cfg.get("z2m_base", "zigbee2mqtt") diff --git a/haos-addon/src/web/index.html b/haos-addon/src/web/index.html index 099c76c..dd3538f 100644 --- a/haos-addon/src/web/index.html +++ b/haos-addon/src/web/index.html @@ -957,37 +957,39 @@ async function loadFinance() { const lohnt = savings_eur > 0; const col = lohnt ? C.green : C.red; const icon = lohnt ? '✓' : '✗'; - empfehlung = `
+ empfehlung = `
${icon} Flexibler Tarif würde sich ${lohnt ? 'lohnen' : 'nicht lohnen'}
-
Basierend auf ${spot_days} Tagen im Abrechnungsjahr
+
Basierend auf ${spot_days} Tagen im Abrechnungsjahr
-
${lohnt ? '−' : '+'}${fEur(Math.abs(savings_eur))}
+
${lohnt ? '−' : '+'}${fEur(Math.abs(savings_eur))}
`; } // ── Summary-Karten ─────────────────────────────────────────── const spotCard = spot_total_eur !== null - ? `
-
${fEur(spot_total_eur)}
-
Spot-Tarif (hypothetisch)
${spot_days} Tage mit Preisdaten
+ ? `
+
${fEur(spot_total_eur)}
+
Spot-Tarif (hypothetisch)
${spot_days} Tage mit Preisdaten
` - : `
Spot-Tarif
Noch keine Daten
`; + : `
Spot-Tarif
Noch keine Daten
`; const savCard = savings_eur !== null - ? `
-
${savings_eur > 0 ? '−' : '+'}${fEur(Math.abs(savings_eur))}
-
${savings_eur > 0 ? 'Ersparnis mit Spot' : 'Mehrkosten mit Spot'}
gegenüber Festpreis
+ ? `
+
${savings_eur > 0 ? '−' : '+'}${fEur(Math.abs(savings_eur))}
+
${savings_eur > 0 ? 'Ersparnis mit Spot' : 'Mehrkosten mit Spot'}
gegenüber Festpreis
` : ''; - const cards = `
-
-
${fEur(fixed_total_eur)}
-
Festpreis-Kosten
${total_days} Tage
-
- ${spotCard}${savCard} -
`; + const cards = ` +
Kostenübersicht · Abrechnungsjahr
+
+
+
${fEur(fixed_total_eur)}
+
Festpreis-Kosten
${total_days} Tage
+
+ ${spotCard}${savCard} +
`; // ── SVG-Balkendiagramm ──────────────────────────────────────── const W = 600, H = 180, PL = 44, PR = 12, PT = 10, PB = 28; @@ -1027,13 +1029,17 @@ async function loadFinance() { const legend = `■ Festpreis ■ Spot (hypothetisch)`; - const chart = `
- - ${gridLines}${yLabels}${bars}${xLabels}${legend} - -
`; + const chartSection = ` +
+
Kosten je Tag
+
+ + ${gridLines}${yLabels}${bars}${xLabels}${legend} + +
+
`; - el.innerHTML = empfehlung + cards + chart; + el.innerHTML = `
${empfehlung}${cards}${chartSection}
`; } catch(e) { el.innerHTML = '
Fehler beim Laden
'; console.error('loadFinance:', e); } }