CustomSDM is a smart "man-in-the-middle" device that sits between your energy meter and PV inverter. It reads, modifies, and simulates Modbus power data in real-time — allowing you to fine-tune feed-in behavior, battery charging, and load control without modifying inverter firmware.
This project is designed for hobbyists, energy enthusiasts, and tinkerers who want more control over their home energy flow — especially when using ESP32-based hardware and SDM72 / SDM630 energy meters powered by ESPHome software with Home Assistant integration.
CustomSDM intercepts the RS485 communication between your PV inverter and energy meter, modifies selected Modbus registers according to your configuration, and passes adjusted values back to the inverter. This enables scenarios such as "slight feed-in", grid-based charging, or energy redirection to heat pumps.
- Reads data from SDM72 / SDM630 (and compatible) energy meters
- Simulates an SDM630 on the second RS485 output (only key registers)
- Modifies power readings dynamically based on user-defined offsets
- Reads grid energy meters via IR interface
- Built-in relay output for PV overproduction signaling (e.g. to control a heat pump)
Some inverters can’t achieve a perfect zero-watt feed-in and still draw ~20 W from the grid.
By setting a Fixed Power Offset (e.g. +60 W), the inverter outputs 60 W more — slightly feeding into the grid and reducing grid draw.
If your feed-in is priced according to EPEX spot prices, you can maximize profits by selling during high-price periods. Most inverters can’t handle this easily, or only via complex MODBUS manipulations.
With a Dynamic Power Offset (e.g. +10 000 W), the inverter provides an additional 10 kW directly to the grid.
For dynamic tariffs or to fully charge your battery, set the Dynamic Power Offset to a negative value (e.g. –8000 W).
The inverter will then draw power from the grid.
Note: The inverter must support storing AC energy into the batteries (e.g. via an AC-coupled inverter).
Enable Automatic Relay Control.
Set:
- Relay Power ON Power →
–1000 W - Relay Power OFF Difference →
800 W
When feed-in power stays above –1000 W for more than 5 minutes, the relay turns on, allowing the heat pump to use excess PV energy.
If feed-in power drops below –200 W (–1000 W + 800 W) for more than 5 minutes, the relay turns off.
A custom carrier PCB was designed for off-the-shelf components.
- Some SMD soldering is required for the relay
- RS485 modules, ESP32 Dev Board, terminals, and a DIN-rail case can be sourced from AliExpress or similar suppliers
| Component | Description | Notes |
|---|---|---|
| ESP32 Dev Board | Main controller | 30 pin devkit |
| RS485 Modules | Communication interfaces | Two required |
| SDM72 / SDM630 | Energy meter | Compatible with Modbus |
| Relay | PV excess control | Requires SMD soldering |
| DIN-rail case | Mounting |
- Enable fine-grained inverter control via Modbus
- Support DIY and open hardware enthusiasts
- Make PV systems more flexible and energy-smart
This is an experimental DIY project. Use it at your own risk — especially when working with mains electricity or grid-connected systems. Always follow proper electrical safety standards.
See the LICENSE file for details.