Update: Battery Optimizer v3.4.0 mit allen Fixes und Features

This commit is contained in:
felix.zoesch
2025-12-12 08:20:19 +01:00
commit d2a41aad2d
78 changed files with 18053 additions and 0 deletions

View File

@@ -0,0 +1,325 @@
# ===================================================================
# Batterie-Optimierung Dashboard
# Übersichtliches Layout mit maximal 4 Spalten
# ===================================================================
title: Batterie-Optimierung
path: battery-optimizer
icon: mdi:battery-charging
badges: []
cards:
# ===================================================================
# SECTION 1: STATUS OVERVIEW (Volle Breite)
# ===================================================================
- type: vertical-stack
cards:
# Haupt-Status-Karte
- type: custom:bubble-card
card_type: pop-up
hash: '#battery-status'
name: Batterie Status
icon: mdi:battery-charging-80
margin_top_mobile: 18px
margin_top_desktop: 74px
width_desktop: 540px
# Power Flow Visualisierung
- type: custom:power-flow-card-plus
entities:
battery:
entity: sensor.ess0_activepower
state_of_charge: sensor.esssoc
display_state: two_way
grid:
entity: sensor.grid_activepower
solar:
entity: sensor.production_activepower
clickable_entities: true
display_zero_state:
transparency: 50
w_decimals: 0
kw_decimals: 2
# ===================================================================
# SECTION 2: STEUERUNG & AKTUELLER PLAN (2+2 Spalten)
# ===================================================================
- type: horizontal-stack
cards:
# LINKE SEITE: Steuerung (2 Spalten)
- type: vertical-stack
cards:
# Optimizer Toggle
- type: custom:bubble-card
card_type: button
button_type: switch
entity: input_boolean.battery_optimizer_enabled
name: Automatische Optimierung
icon: mdi:robot
show_state: true
# Manuelle Steuerung
- type: custom:bubble-card
card_type: button
button_type: switch
entity: input_boolean.goodwe_manual_control
name: Manuelle Steuerung
icon: mdi:hand-back-right
show_state: true
# Wichtige Parameter
- type: entities
title: Parameter
entities:
- entity: input_number.battery_optimizer_min_soc
name: Min. SOC
- entity: input_number.battery_optimizer_max_soc
name: Max. SOC
- entity: input_number.battery_optimizer_max_charge_power
name: Ladeleistung
- entity: input_number.battery_optimizer_reserve_capacity
name: Reserve
- type: divider
- entity: sensor.hastrom_flex_ext
name: Aktueller Preis
icon: mdi:currency-eur
- entity: sensor.esssoc
name: Aktueller SOC
icon: mdi:battery
# RECHTE SEITE: Aktueller Plan (2 Spalten)
- type: vertical-stack
cards:
# Plan Header
- type: custom:bubble-card
card_type: button
entity: sensor.battery_charging_plan_status
name: Ladeplan
icon: mdi:calendar-clock
show_state: true
show_last_changed: true
# Kompakte Plan-Anzeige
- type: markdown
content: |
{% set schedule = state_attr('pyscript.battery_charging_plan', 'schedule') %}
{% set last_updated = state_attr('pyscript.battery_charging_plan', 'last_updated') %}
{% if schedule %}
**Plan erstellt:** {{ last_updated[:16] if last_updated else 'Unbekannt' }}
**Geplante Ladestunden:**
{% for slot in schedule %}
{% if slot.action == 'charge' %}
- **{{ slot.time[:16] }}**
🔋 {{ slot.power }}W · 💶 {{ slot.price }}ct/kWh
*{{ slot.reason }}*
{% endif %}
{% endfor %}
{% else %}
⚠️ Kein Plan verfügbar
{% endif %}
# Nächste Aktion
- type: custom:bubble-card
card_type: button
entity: sensor.battery_next_charge_time
name: Nächste Ladung
icon: mdi:clock-start
show_state: true
# ===================================================================
# SECTION 3: VISUALISIERUNGEN (Volle Breite)
# ===================================================================
- type: vertical-stack
cards:
# Strompreis-Verlauf mit geplanten Ladezeiten
- type: custom:plotly-graph
title: Strompreis & Ladeplanung
hours_to_show: 48
refresh_interval: 10
layout:
height: 300
showlegend: true
xaxis:
title: Zeit
yaxis:
title: Preis (ct/kWh)
side: left
entities:
# Strompreis
- entity: sensor.hastrom_flex_ext
name: Strompreis
line:
color: rgb(255, 152, 0)
width: 2
fill: tozeroy
fillcolor: rgba(255, 152, 0, 0.1)
# Geplante Ladezeiten (als Marker)
- entity: ''
name: Geplante Ladung
internal: true
data_generator: |
return Object.entries(hass.states['pyscript.battery_charging_plan'].attributes.schedule || {})
.filter(([k,v]) => v.action === 'charge')
.map(([k,v]) => ({
x: v.time,
y: parseFloat(v.price),
text: `${v.power}W`
}));
mode: markers
marker:
color: rgb(76, 175, 80)
size: 12
symbol: diamond
# SOC & Batterie-Leistung
- type: custom:plotly-graph
title: Batterie SOC & Leistung
hours_to_show: 24
refresh_interval: 10
layout:
height: 300
showlegend: true
xaxis:
title: Zeit
yaxis:
title: SOC (%)
side: left
range: [0, 100]
yaxis2:
title: Leistung (W)
side: right
overlaying: y
entities:
# SOC
- entity: sensor.esssoc
name: SOC
yaxis: y
line:
color: rgb(33, 150, 243)
width: 3
fill: tozeroy
fillcolor: rgba(33, 150, 243, 0.1)
# Batterie-Leistung
- entity: sensor.ess0_activepower
name: Ladeleistung
yaxis: y2
line:
color: rgb(76, 175, 80)
width: 2
dash: dot
# Energie-Fluss über Zeit
- type: custom:plotly-graph
title: Energie-Flüsse
hours_to_show: 24
refresh_interval: 10
layout:
height: 300
showlegend: true
xaxis:
title: Zeit
yaxis:
title: Leistung (W)
entities:
- entity: sensor.production_activepower
name: PV-Produktion
line:
color: rgb(255, 193, 7)
width: 2
fill: tozeroy
fillcolor: rgba(255, 193, 7, 0.2)
- entity: sensor.grid_activepower
name: Netzbezug
line:
color: rgb(244, 67, 54)
width: 2
- entity: sensor.ess0_activepower
name: Batterie
line:
color: rgb(76, 175, 80)
width: 2
# ===================================================================
# SECTION 4: DETAILLIERTER PLAN (Ausklappbar)
# ===================================================================
- type: custom:bubble-card
card_type: separator
name: Detaillierte Plan-Ansicht
icon: mdi:table
- type: markdown
title: Vollständiger Ladeplan
content: |
{% set schedule = state_attr('pyscript.battery_charging_plan', 'schedule') %}
{% set stats = state_attr('pyscript.battery_charging_plan', 'plan_statistics') %}
{% if schedule and stats %}
### 📊 Plan-Statistiken
| Metrik | Wert |
|--------|------|
| Geplante Ladestunden | {{ stats.total_charging_hours }} |
| Gesamte Energie | {{ stats.total_energy_kwh | round(2) }} kWh |
| Durchschnittspreis | {{ stats.average_price | round(2) }} ct/kWh |
| Günstigster Preis | {{ stats.min_price | round(2) }} ct/kWh |
| Teuerster Preis | {{ stats.max_price | round(2) }} ct/kWh |
---
### 📅 Stunden-Details
| Zeit | Aktion | Leistung | Preis | Grund |
|------|--------|----------|-------|-------|
{% for slot in schedule %}
| {{ slot.time[11:16] }} | {{ '🔋 Laden' if slot.action == 'charge' else '⏸️ Warten' }} | {{ slot.power if slot.power else '-' }}W | {{ slot.price }}ct | {{ slot.reason }} |
{% endfor %}
{% else %}
⚠️ **Kein Ladeplan verfügbar**
Der Plan wird täglich um 14:05 Uhr neu berechnet.
{% endif %}
# ===================================================================
# SECTION 5: SYSTEM-INFOS (Ausklappbar)
# ===================================================================
- type: custom:bubble-card
card_type: separator
name: System-Informationen
icon: mdi:information
- type: entities
title: System-Status
show_header_toggle: false
entities:
- entity: sensor.openems_state
name: OpenEMS Status
- type: divider
- entity: sensor.battery_capacity
name: Batteriekapazität
- entity: sensor.ess0_capacity
name: Installierte Kapazität
- type: divider
- entity: sensor.forecast_solar_energy_today
name: PV-Prognose Heute
- entity: sensor.forecast_solar_energy_tomorrow
name: PV-Prognose Morgen
- type: divider
- entity: automation.battery_charging_schedule_calculation
name: Tägliche Berechnung
- entity: automation.battery_charging_schedule_execution
name: Stündliche Ausführung