Kraftwerksfahrplan-Steuerung für Deye 48V-Batteriewechselrichter, MQTT, asyncio und SMA SHM2-Client

HI,

war schon angekündigt und llegt noch immer auf meinem Schreibtisch rum. Muss bis Sonntag noch eine Mietkostenabrechnung fertig machen, aber am Wochenende danach werde ich das zu Hause mal testen.

Das ist eine Kraftwerksfahrplan-Steuerung (Fahrplansteuerung) für die Deye 5K...12K...20K 48V-Batterie-Hybridwechselrichter an Solaranlagen mit Mikrowechselrichtern, Stringwechselrichtern, Energy-Management-System von verschiedenen Herstellern (z.B. SMA Sunny Home Manager 2.0 oder KSEM, Node-Red und dem Akkudoktor-EMS), BHKW, Wärmepumpe, HPC-60-kW Schnellade DC-Wallbox, CPO und CPMS auf Basis von Raspberry Pi, DC-Microgrids mit leistungselektronischer Netzkupplung usw.

Das war alles auf verschiedener Softwarebasis schon einzeln lauffähig, nur für das integrierte Gesamtsystem ist noch etwas Integrationsarbeit zu leisten.

Der Titel lautet:
"Energy Meter Gateway for Battery Inverter Feed-In Power Control.

Live control of grid-side instantaneous influx and outgoing power for Deye low-voltage battery and hybrid inverters running in grid-parallel zero-export mode.

This enables dynamic feed-in tariffs, direct energy trading, local load-shaping or scheduled application of an arbitrary load/supply power profile using a supervisory plant controller or energy management system (EMS).

In grid-side control mode, this application acts as a Modbus-to-Modbus gateway for data from an attached SDM630 energy meter, superimposing an arbitrary power offset (positive or negative) to the values reported from the meter.

This mode 100% keeps the original dynamics and tuning settings from the zero-export power closed-loop controller implemented in the Deye inverter.

In inverter-direct control mode, the energy meter for zero-export control is emulated using read-out values of current active power from the inverter itself, allowing for direct control of inverter active output power.

The grid-side or inverter-side instantaneous power setpoint can be set and continuously updated using the configured MQTT topic. MQTT topic default: cmd/deye_powercontrol/set_power

The Python code uses asyncio, async-enabled pymodbus and aiomqtt packages for cooperative multitasking.

The gateway application is configured via text file in user home folder: ~/.em_gateway/app_config.toml

This file must be edited to suit application details. [...]

2025-08-27 Ulrich Lukas

==> Jaa, das ist alles unfertiges Gebastel!
==> Und das BMS-Gateway für den netzdienlichen Matrix-Akku (bms_gateway) muss auch noch überarbeitet werden, das ist zwar sehr sicher, hängt sich aber manchmal auf.