Integrating Home Assistant with Victron GX for Battery Management

After spending several weeks setting up my home energy system, I wanted to share my experience and some tips for others looking to integrate Home Assistant (HA) with Victron GX devices. This setup has been a game-changer for managing my battery system more efficiently!

My Setup

I’ve got a Victron Multiplus II 15kVA, paired with an 80kWh BYD battery, and a Victron Cerbo-GX as the brain of the operation. The system is connected via Modbus-TCP, and I’ve integrated everything into HA running on a NUC. The goal was to optimize battery usage, especially during peak electricity rates (9am-4pm at 10c/kWh).

Key Challenges and Solutions

  1. Battery Management with Batterylife

    • I initially relied on Victron’s Batterylife feature, but it wasn’t ideal for my Li-ion battery. It tends to raise the minimum SOC unnecessarily on cloudy days, reducing available capacity when the sun returns.
    • Solution: I created custom thresholds in HA to dynamically adjust battery usage based on time of day and solar production. This ensures I’m importing energy during cheaper rates and exporting excess solar during peak times.
  2. Export Limitations on Sunny Days

    • On sunny days, my battery fills by midday, but export is capped at 4.5kW. This means potential energy loss due to throttling.
    • Solution: Using HA’s automation, I predict when the battery will be full and start exporting earlier. This has significantly increased my solar yield!
  3. Balancing Battery Health

    • To maintain battery longevity, I set up a timer that forces a full charge every two weeks. This helps balance the cells and resets the BMS SOC counter.

Implementation Steps

  • Modbus Integration: I configured Modbus-TCP to connect HA with the Cerbo-GX. This involved setting up sensors for grid import/export, battery SOC, and solar production.
  • Custom Thresholds: I created time-based thresholds for battery usage, adjusting them throughout the day to maximize efficiency.
  • Export Logic: HA now calculates the optimal grid setpoint based on current solar production, battery level, and time of day. This value is then sent to the Victron GX via a slider to avoid frequent register updates.

Results

  • Energy Savings: By optimizing when I import/export energy, I’ve reduced my grid consumption during peak hours by about 30%.
  • Battery Efficiency: The custom thresholds and forced balancing have kept my battery SOC within a healthy range, extending its lifespan.
  • Peace of Mind: The system now runs smoothly without manual intervention, even during extended cloudy periods.

Tips for Others

  • Start Small: Begin with basic Modbus integration and gradually add custom logic as you become comfortable.
  • Monitor Closely: Use HA’s built-in dashboards to track battery health, solar production, and grid usage in real-time.
  • Community Support: Don’t hesitate to reach out to forums like this one for troubleshooting. The community is incredibly helpful!

If you’re looking to optimize your energy setup, I highly recommend exploring the integration between HA and Victron GX. It’s a bit technical, but the payoff in efficiency and savings is well worth the effort! :rocket: