Skip to content

PalmManiac/battery-smartflow-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,574 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Battery SmartFlow AI


GitHub Release Maintained GitHub Repo Size Active installs GitHub Stars License HACS


Intelligent, economic and stable control for Zendure SolarFlow systems in Home Assistant


🌍 Language

  • 🇬🇧 English
  • 🇩🇪 Deutsch

What does this integration do?

Battery SmartFlow AI automatically controls your Zendure SolarFlow system – based on:

  • ☀️ PV generation
  • 🏠 Real household load
  • 🔋 Battery SoC
  • 💶 Dynamic electricity prices (optional)
  • ⚙️ Device-specific control profiles

The integration combines this data into a physically stable and economically optimized charging and discharging strategy.

Goal:

Minimal grid import.
Maximum economic efficiency.
No hectic direction changes.


🧠 Core functions (V2 architecture)

  • Adaptive peak detection (individually configurable)
  • Price pre-planning with valley detection
  • Dynamic grid regulation (regulation instead of full power)
  • Device profiles per model
  • Hard-sync with real AC mode
  • Transparency sensors for price logic
  • Profit / savings calculation
  • Seasonal logic (summer/winter)

⚠️ Mandatory prerequisites

For the integration to work correctly, the following points must be fulfilled:


1️⃣ Zendure original app

In the Zendure app:

  • Charge power → Maximum
  • Discharge power → Maximum
  • HEMS → disabled
  • No parallel automations

⚠️ Control takes place exclusively via Home Assistant.


2️⃣ Zendure Home Assistant integration

The following settings are mandatory:

  • Do not select a P1 sensor
  • Energy export: Allowed
  • Zendure Manager → Operating mode OFF

Incorrect settings lead to:

  • Blocked AC modes
  • Discharge interruptions
  • Unstable regulation

3️⃣ Configure grid sensor correctly

Recommended:

  • Split mode with separate import & export
    (e.g. Shelly Pro 3EM)

4️⃣ Electricity price integration (optional)

Supported:

  • Tibber
  • EPEX
  • Octopus (including German Forecast API)

Without an electricity price, PV- and load-based control still works.


🛠 Installation (HACS)

HACS Repository

  1. Open HACS
  2. ⋮ → Custom repositories
  3. Add repository:
    https://github.com/PalmManiac/battery-smartflow-ai
  4. Type: Integration
  5. Install
  6. Restart Home Assistant

⚙️ Configuration

After installation:

Settings → Devices & Services → Add Integration → Battery SmartFlow AI


1️⃣ Main configuration

Screenshot 2026-02-19 134834Screenshot 2026-02-25 141115

Here you select:

  • Device profile
  • Battery SoC sensor
  • PV power
  • Electricity price (optional)
  • Price history (optional)
  • Zendure AC mode
  • Charge & discharge entities
  • Grid mode

📖 Detailed explanations can be found in the manual (V2).


2️⃣ Grid measurement

Screenshot 2026-02-25 141200

You can choose between:

  • No grid sensor
  • One combined sensor (+/-)
  • Two sensors (import & export)

Recommended: Two sensors.


3️⃣ Split sensor selection

Screenshot 2026-02-25 141224

Here you select:

  • Grid import
  • Grid export

separately.


⚙️ Device profiles

The integration uses model-dependent control parameters.

Currently supported:

  • SF800Pro
  • SF1600AC+
  • SF2400AC

The profile influences, among other things:

  • Target grid import
  • Regulation speed
  • Export tolerance
  • Hardware limits

🧠 Peak factor (Adaptive Peak)

The peak factor can be adjusted via the GUI and influences the detection of price peaks.

Formula:

Peak threshold = max( Average price × Peak factor, Average price + €0.03 )

Default: 1.35

  • Lower → detects more peaks (more sensitive)
  • Higher → detects only strong price peaks (more conservative)

📊 Transparency sensors (V2)

V2 makes the price logic visible, e.g.:

  • Ø daily price
  • Current peak threshold
  • Engine status
  • Adaptive peak active

💶 Profit / savings

The integration can show:

  • Ø charging price (weighted average)
  • Discharged energy
  • Price difference
  • Total profit in €

Note: Details about the calculation are in the manual (V2).


🔄 Operating modes

Automatic (recommended)

Price + PV + load combined.

Summer

Focus on autonomy, without price planning.

Winter

Focus on economic efficiency, with price planning.

Manual

No AI interventions, charging/discharging/standby manually.


🛡 Safety mechanisms

  • SoC minimum / SoC maximum
  • BMS limit detection (SoC limit status)
  • Emergency charging function
  • Hard-sync with real Zendure AC mode

📖 Documentation

This README provides an overview.

For details (including screenshots, examples, FAQ) see:

  • Manual (V2)

Support & Contribution

  • GitHub Issues for bugs & feature requests
  • Pull Requests welcome

Battery SmartFlow AI – understandable, stable, economical.


Deutsche Version

Battery SmartFlow AI

Intelligente, wirtschaftliche und stabile Steuerung für Zendure SolarFlow Systeme in Home Assistant


Was macht diese Integration?

Battery SmartFlow AI steuert dein Zendure SolarFlow System automatisch – basierend auf:

  • ☀️ PV-Erzeugung
  • 🏠 Realer Hauslast
  • 🔋 Batterie-SoC
  • 💶 Dynamischen Strompreisen (optional)
  • ⚙️ Gerätespezifischen Regelprofilen

Die Integration kombiniert diese Daten zu einer physikalisch stabilen und wirtschaftlich optimierten Lade- und Entladestrategie.

Ziel:

Minimaler Netzbezug.
Maximale Wirtschaftlichkeit.
Keine hektischen Richtungswechsel.


🧠 Kernfunktionen (V2 Architektur)

  • Adaptive Peak-Erkennung (individuell einstellbar)
  • Preis-Vorplanung mit Valley-Erkennung
  • Dynamische Netzregelung (Regelung statt Vollgas)
  • Geräteprofile pro Modell
  • Hard-Sync mit realem AC-Modus
  • Transparenz-Sensoren für Preislogik
  • Gewinn-/Ersparnis-Berechnung
  • Saisonale Logik (Sommer/Winter)

⚠️ Zwingende Voraussetzungen

Damit die Integration korrekt arbeitet, müssen folgende Punkte erfüllt sein:


1️⃣ Zendure Original-App

In der Zendure App:

  • Ladeleistung → Maximum
  • Entladeleistung → Maximum
  • HEMS → deaktivieren
  • Keine parallelen Automationen

⚠️ Die Steuerung erfolgt ausschließlich über Home Assistant.


2️⃣ Zendure Home Assistant Integration

Folgende Einstellungen sind zwingend erforderlich:

  • Kein P1-Sensor auswählen
  • Energie-Export: Erlaubt
  • Zendure Manager → Betriebsmodus AUS

Falsche Einstellungen führen zu:

  • Blockierten AC-Modi
  • Entladeabbrüchen
  • Instabiler Regelung

3️⃣ Netzsensor korrekt konfigurieren

Empfohlen:

  • Split-Modus mit separatem Bezug & Einspeisung
    (z. B. Shelly Pro 3EM)

4️⃣ Strompreis-Integration (optional)

Unterstützt:

  • Tibber
  • EPEX
  • Octopus (inkl. deutscher Forecast API)

Ohne Strompreis funktioniert PV- und lastbasierte Steuerung weiterhin.


🛠 Installation (HACS)

HACS Repository

  1. HACS öffnen
  2. ⋮ → Benutzerdefinierte Repositories
  3. Repository hinzufügen:
    https://github.com/PalmManiac/battery-smartflow-ai
  4. Typ: Integration
  5. Installieren
  6. Home Assistant neu starten

⚙️ Konfiguration

Nach der Installation:

Einstellungen → Geräte & Dienste → Integration hinzufügen → Battery SmartFlow AI


1️⃣ Hauptkonfiguration

Screenshot 2026-02-19 134834Screenshot 2026-02-25 141115

Hier werden ausgewählt:

  • Geräteprofil
  • Batterie-SoC Sensor
  • PV-Leistung
  • Strompreis (optional)
  • Preisverlauf (optional)
  • Zendure AC-Modus
  • Lade- & Entlade-Entitäten
  • Netzmodus

📖 Detaillierte Erklärungen findest du in der Anleitung (V2).


2️⃣ Netzmessung

Screenshot 2026-02-25 141200

Du kannst wählen zwischen:

  • Kein Netzsensor
  • Ein kombinierter Sensor (+/-)
  • Zwei Sensoren (Bezug & Einspeisung)

Empfohlen: Zwei Sensoren.


3️⃣ Split-Sensor Auswahl

Screenshot 2026-02-25 141224

Hier werden:

  • Netzbezug
  • Netzeinspeisung

separat ausgewählt.


⚙️ Geräteprofile

Die Integration nutzt modellabhängige Regelparameter.

Aktuell unterstützt:

  • SF800Pro
  • SF1600AC+
  • SF2400AC

Das Profil beeinflusst u. a.:

  • Ziel-Netzbezug
  • Regelgeschwindigkeit
  • Export-Toleranz
  • Hardware-Grenzen

🧠 Peak-Faktor (Adaptive Peak)

Der Peak-Faktor ist über die GUI einstellbar und beeinflusst die Erkennung von Preisspitzen.

Formel:

Peak-Schwelle = max( Durchschnittspreis × Peak-Faktor, Durchschnittspreis + 0,03 € )

Standard: 1.35

  • Niedriger → erkennt mehr Peaks (sensitiver)
  • Höher → erkennt nur starke Preisspitzen (konservativer)

📊 Transparenz-Sensoren (V2)

V2 macht die Preislogik sichtbar, z. B.:

  • Ø Tagespreis
  • Aktuelle Peak-Schwelle
  • Engine-Status
  • Adaptive Peak aktiv

💶 Gewinn / Ersparnis

Die Integration kann:

  • Ø Ladepreis (gewichteter Durchschnitt)
  • Entladene Energie
  • Preis-Differenz
  • Gesamtgewinn in €

sichtbar machen.

Hinweis: Details zur Berechnung stehen in der Anleitung (V2).


🔄 Betriebsmodi

Automatik (empfohlen)

Preis + PV + Last kombiniert.

Sommer

Autarkie-Fokus, ohne Preisplanung.

Winter

Wirtschaftlichkeits-Fokus, mit Preisplanung.

Manuell

Keine KI-Eingriffe, Laden/Entladen/Standby manuell.


🛡 Sicherheitsmechanismen

  • SoC-Minimum / SoC-Maximum
  • BMS-Limit-Erkennung (SoC-Limit Status)
  • Notladefunktion (Emergency)
  • Hard-Sync mit realem Zendure AC-Modus

📖 Dokumentation

Diese README bietet eine Übersicht.

Für Details (inkl. Screenshots, Beispiele, FAQ) siehe:

  • Anleitung (V2)

Support & Mitwirkung

  • GitHub Issues für Bugs & Feature-Wünsche
  • Pull Requests willkommen

Battery SmartFlow AI – erklärbar, stabil, wirtschaftlich.