Hi HASS community!
I’d like to share a custom Home Assistant integration I’ve been working on that optimizes household energy flow using a Mixed-Integer Linear Programming (MILP) solver.
It’s unfortunately (at the moment) designed only for setups using Czech spot electricity prices, a SolaX inverter via Modbus, and Forecast.Solar. The integration predicts photovoltaic production and household load, applies battery constraints, and calculates the most cost-effective strategy for grid import and export on an hourly basis. The only direct action it takes is managing when energy is imported from or exported to the grid.
You can run it in “observe” mode, where it only calculates and shows the optimization results (make sure to give a try), or in “manage” mode, where it actively applies the grid strategy.
One feature that differentiates this integration from other similar integration is Second Home support. Given that you have the correct hardware installed (Shelly devices capable of measuring consumption - Shelly Pro 3EM, …), you can either monitor it in view mode or include it in a shared optimization setup. This allows coordinated energy strategies across multiple properties and opens the door to community energy sharing.
I’m looking for feedback from real-world deployments, especially multi-home setups and edge cases. If you’re interested in testing or improving it together, I’d love to hear your thoughts.
Check out the repository: