I'm living in the Netherlands and utilizing an hourly-based energy contract where the pricing fluctuates based on the market. I have solar panels, and I'm often in situations where I'm being paid to feed energy into the grid during windy and sunny days. However, with my old SolarEdge SE1500M inverter, I can't extend the setup since it only transfers energy directly from the solar panels to the grid and lacks flexibility. I'm looking for a solution to manage the excess solar energy better.
I've got a P1 Energy meter that connects via REST API, so I can monitor if I'm sending energy out or receiving it, and I know the limit for sending energy back to the grid is 800W through a standard 220V AC socket.
Here's what I'm thinking for my setup:
1. Use a 220V AC to 24V battery charger, preferably one with an output current regulator, but I'm cautious about tinkering with anything that could cause safety issues.
- My first question: Can I integrate a PWM DC motor speed regulator after the battery charger to control the power with an ESP32?
2. I trust that the battery charger will manage the voltage, and the battery has BMS as protection, but I'm unsure if the regulator could interfere with the charging process.
3. I plan to connect the battery to a Micro Inverter that can sync with the grid and supply energy when available.
- My second question: Is it viable to use the same current regulator and ESP32 to limit the current from the battery to the Micro Inverter, given the lack of AC power regulators?
Additionally, I might need to implement two relays for strictly charging and discharging operations. The logic flow will involve the ESP32 controlling both the charging and discharging relays according to the schedule and balancing energy usage against grid allowances. I'm aiming for a straightforward solution, avoiding overly complex DIY issues. If it turns out to be too complicated to execute safely and effectively, I'd prefer to keep the existing system running.
2 Answers
You could definitely use ESP32 with relays and something like ESPHome to automate everything. It won't be the fanciest setup, but you can get basic on/off functionality pretty easily. For more precise control, you’ll want to explore incorporating a solid-state relay (SSR) to manage your PWM output effectively. Just keep in mind, you might run into issues depending on how your energy meter averages the consumption.
It sounds like replacing your inverter might actually be a simpler option than building out this whole system. There are several inverters available that support load shifting, allowing you to store energy in batteries during peak solar generation times and use it when energy costs are higher. While your DIY idea is creative, the cost and time you’d invest might not be worth it for a solid off-the-shelf inverter that meets your needs. Just something to consider!
I totally get where you’re coming from, but many inverters aren’t that accessible due to the lack of REST APIs or they can be super expensive! It’s a tough market if you’re looking for something niche. It feels like it's almost handmade solutions or all high-priced commercial products.
Plus, your approach might give you the flexibility to buy energy low and sell high, which is really appealing. It's like being your own mini utility!

Absolutely, the relays can be a great start! Although, finding DC rated relays might cost a bit due to their high demand. You'd want to consider that in your budget.