## 🎯 Hauptänderungen ### Version 3.4.0 - SOC-Drift & Charging Capacity - ✨ Sicherheitspuffer (20-50% konfigurierbar) für untertägige SOC-Schwankungen - ✨ Monatliche automatische Batterie-Kalibrierung - 🐛 SOC-Plausibilitäts-Check (filtert 65535% Spikes beim Modus-Wechsel) - 🐛 Zeitabhängige API-Abfrage (vor/nach 14:00 Uhr) ### Neue Features - 🔋 **Safety Buffer**: Kompensiert SOC-Drift und Eigenverbrauch - 🔋 **Auto-Calibration**: Monatlicher Vollzyklus für SOC-Genauigkeit - 🔋 **Spike Protection**: 4-fach Schutz gegen ungültige SOC-Werte - 🔋 **Smart API**: Verhindert HTTP 500 Errors bei fehlenden Tomorrow-Preisen ### Dokumentation - 📚 SOC_CALIBRATION_GUIDE.md - Umfassender Kalibrierungs-Guide - 📚 FIX_CHARGING_CAPACITY.md - Sicherheitspuffer-Dokumentation - 📚 FIX_SOC_SPIKE_PROBLEM.md - Spike-Protection-Lösung - 📚 FIX_API_TIMING.md - Zeitabhängige API-Abfrage - 📚 DIAGNOSE_LADE_PROBLEM.md - Debug-Guide ### Neue Dateien - battery_calibration_automation.yaml - 4 Automations für Kalibrierung - battery_calibration_input_helper.yaml - Input Helper Config - battery_optimizer_input_helper_safety_buffer.yaml - Puffer Config - debug_schedule.py - Umfassendes Debug-Script ### Scripts - battery_charging_optimizer.py v3.4.0 - hastrom_flex_extended.py v1.1.0 - debug_schedule.py v1.0.0 ### Fixes - 🐛 SOC springt auf 65535% beim ESS-Modus-Wechsel → Debounce + Plausibilitäts-Check - 🐛 API-HTTP-500 vor 14:00 → Zeitabhängige Abfrage - 🐛 Batterie nicht bis 100% geladen → Sicherheitspuffer - 🐛 SOC driftet ohne Vollzyklen → Automatische Kalibrierung ## 🚀 Installation 1. Input Helper erstellen (siehe battery_optimizer_input_helper_safety_buffer.yaml) 2. Automations installieren (siehe battery_calibration_automation.yaml) 3. Scripts aktualisieren (battery_charging_optimizer.py v3.4.0) 4. PyScript neu laden ## 📊 Verbesserungen - Präzisere Ladeplanung durch Sicherheitspuffer - Robustheit gegen SOC-Drift - Keine API-Fehler mehr vor 14:00 - Hardware-Stopp bei 100% wird respektiert - Bessere Batterie-Gesundheit durch regelmäßige Kalibrierung 🤖 Generated with Claude Code (claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
133 lines
3.8 KiB
YAML
133 lines
3.8 KiB
YAML
# ============================================
|
|
# Battery Charging Optimizer - Configuration
|
|
# ============================================
|
|
# Diese Konfiguration zu deiner configuration.yaml hinzufügen
|
|
|
|
# WICHTIG: Kein input_text/input_textarea nötig!
|
|
# Der Ladeplan wird als Attribut in pyscript.battery_charging_schedule gespeichert
|
|
# (PyScript kann States mit beliebig großen Attributen erstellen)
|
|
|
|
# Input Numbers für Konfiguration
|
|
input_number:
|
|
battery_optimizer_min_soc:
|
|
name: "Batterie Min SOC"
|
|
min: 0
|
|
max: 100
|
|
step: 5
|
|
initial: 20
|
|
unit_of_measurement: "%"
|
|
icon: mdi:battery-low
|
|
|
|
battery_optimizer_max_soc:
|
|
name: "Batterie Max SOC"
|
|
min: 0
|
|
max: 100
|
|
step: 5
|
|
initial: 100
|
|
unit_of_measurement: "%"
|
|
icon: mdi:battery-high
|
|
|
|
battery_optimizer_price_threshold:
|
|
name: "Preis-Schwellwert für Laden"
|
|
min: 0
|
|
max: 50
|
|
step: 0.5
|
|
initial: 28
|
|
unit_of_measurement: "ct/kWh"
|
|
icon: mdi:currency-eur
|
|
|
|
battery_optimizer_max_charge_power:
|
|
name: "Max Ladeleistung"
|
|
min: 1000
|
|
max: 10000
|
|
step: 500
|
|
initial: 10000
|
|
unit_of_measurement: "W"
|
|
icon: mdi:lightning-bolt
|
|
|
|
battery_optimizer_reserve_capacity:
|
|
name: "Reserve für Eigenverbrauch"
|
|
min: 0
|
|
max: 10
|
|
step: 0.5
|
|
initial: 2
|
|
unit_of_measurement: "kWh"
|
|
icon: mdi:battery-medium
|
|
|
|
# Input Boolean für Steuerung
|
|
input_boolean:
|
|
battery_optimizer_enabled:
|
|
name: "Batterie-Optimierung aktiv"
|
|
initial: true
|
|
icon: mdi:robot
|
|
|
|
battery_optimizer_manual_override:
|
|
name: "Manuelle Steuerung"
|
|
initial: false
|
|
icon: mdi:hand-back-right
|
|
|
|
# Input Select für Strategie
|
|
input_select:
|
|
battery_optimizer_strategy:
|
|
name: "Lade-Strategie"
|
|
options:
|
|
- "Konservativ (nur sehr günstig)"
|
|
- "Moderat (unter Durchschnitt)"
|
|
- "Aggressiv (mit Arbitrage)"
|
|
initial: "Konservativ (nur sehr günstig)"
|
|
icon: mdi:strategy
|
|
|
|
# Sensor Templates für Visualisierung
|
|
template:
|
|
- sensor:
|
|
- name: "Nächste Ladestunde"
|
|
unique_id: next_charging_hour
|
|
state: >
|
|
{% set schedule = state_attr('pyscript.battery_charging_schedule', 'schedule') %}
|
|
{% if schedule %}
|
|
{% set ns = namespace(next_hour=None) %}
|
|
{% for hour, data in schedule.items() %}
|
|
{% if data.action == 'charge' and hour > now().strftime('%Y-%m-%d %H:00:00') %}
|
|
{% if ns.next_hour is none or hour < ns.next_hour %}
|
|
{% set ns.next_hour = hour %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
{{ ns.next_hour if ns.next_hour else 'Keine' }}
|
|
{% else %}
|
|
Kein Plan erstellt
|
|
{% endif %}
|
|
icon: mdi:clock-start
|
|
|
|
- name: "Geplante Ladungen heute"
|
|
unique_id: planned_charges_today
|
|
state: >
|
|
{% set schedule = state_attr('pyscript.battery_charging_schedule', 'schedule') %}
|
|
{% if schedule %}
|
|
{% set today = now().strftime('%Y-%m-%d') %}
|
|
{% set ns = namespace(count=0) %}
|
|
{% for hour, data in schedule.items() %}
|
|
{% if data.action == 'charge' and hour.startswith(today) %}
|
|
{% set ns.count = ns.count + 1 %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
{{ ns.count }}
|
|
{% else %}
|
|
0
|
|
{% endif %}
|
|
unit_of_measurement: "Stunden"
|
|
icon: mdi:counter
|
|
|
|
- name: "Durchschnittspreis heute"
|
|
unique_id: average_price_today
|
|
state: >
|
|
{% set prices = state_attr('sensor.hastrom_flex_pro', 'prices_today') %}
|
|
{% if prices %}
|
|
{{ (prices | sum / prices | count) | round(2) }}
|
|
{% else %}
|
|
unknown
|
|
{% endif %}
|
|
unit_of_measurement: "ct/kWh"
|
|
icon: mdi:chart-line
|
|
device_class: monetary
|