Could Someone Give me Advice on Integrating a Custom Battery Management System (BMS) with OpenEMS?

Hello there,

I am new to the OpenEMS community and excited to start integrating OpenEMS into my renewable energy setup. I have a specific challenge that I hope to get some advice on from the experienced members of this forum.

I am working on a project that involves a custom-built Battery Management System (BMS) designed to optimize the performance and lifespan of our battery storage solution.

This BMS is not a standard commercial product and has unique communication protocols and data outputs. I am looking to integrate this BMS with OpenEMS; but I am unsure about the best approach to take.

Custom-built with a focus on Li-ion batteries.
Communication via CAN bus and Modbus.

Data output includes parameters like State of Charge (SoC); State of Health (SoH); voltage; current; temperature; and individual cell data.

Solar panels connected to a hybrid inverter.
Battery storage system with the custom BMS.
A Raspberry Pi running OpenEMS as the central controller.

Developing a custom driver or interface for OpenEMS to communicate with the BMS.
Ensuring real-time data synchronization and accurate state reporting.
Implementing control algorithms to optimize charging and discharging cycles based on the data provided by the BMS.

I would greatly appreciate any guidance or references to documentation that could help me get started. If anyone has experience with similar integrations or has developed custom drivers for OpenEMS; your insights would be incredibly valuable.

Also, I have gone through this post: https://community.openems.io/t/seeking-guidance-for-implementing-a-battery-device-in-openems-devops which definitely helped me out a lot.

Additionally, any tips on debugging communication issues between OpenEMS and external hardware would also be helpful.

Thank you in advance for your assistance.

2 Likes

Hi Dom5,

I am unsure on your actual questions. I assume your OpenEMS Edge configuration will eventually look similar to this: (sorry, German)

The image shows:

  • An Ess.Generic.ManagedSymmetric that logically combines a battery inverter and a battery
  • A Battery Inverter (in the image its a KACO blueplanet gridsave 92)
  • A Battery (in the image its a BYD Commercial Battery Box)
  • On the other end, there is a Grid-Meter measuring grid-buy-power and grid-sell-power
  • That information is used as an input for a Balancing-Controller, i.e. a control algorithm that tries to charge the battery on grid-feed-in and discharges the battery when otherwise buying from grid.

Communication via CAN bus and Modbus.

If you can, I would recommend to start with Modbus, because it is very well supported in OpenEMS. You can roughly follow the Implementing a Device tutorial, but instead of a Meter, implement a Battery by providing the modbus register table and mapping the registers to the required datapoints.

And of course I’d appreciate if you could publish the code of your BMS as well as the OpenEMS code. That’s the open source spirit! :slight_smile:

Regards,
Stefan

2 Likes

Dear Dom,
Have you got some hints to implement a custom battery communicate via CAN. I implemented a CAN bridge with help of this repository GitHub - opernikus-common/openems at feature/can-bridge. I have a libsocket can read and write via socket can and it really works. But I don’t know what to do next. Shall we exchange our idea?
Thanks a lot.

Hi. We’ve recently tried this open source tool on the recommended hardware with CAN-to-Modbus in a little prototype.

Can recommend it… the integration to OpenEMS Edge is not open-sourced though, yet.

Regards,
Stefan

1 Like