Dynamic Device Creation based on Modbus - EssDcCharger

Hello,

I am creating a device implementation for the AMPT String Optimizer / ESS DC Charger:
https://www.ampt.com/products/string-optimizers/

This is a system where there are DC-DC converters for each solar string (MPPT trackers) connected to a common DC bus of the ESS. I think the OpenEMS API / Nature that best represents this is EssDcCharger.

The Modbus interface for the system is provided by an AMPT communications unit. This communicates wirelessly with the distributed DC-DC converters and provides all data in one interface.

You can see product information here:
https://www.ampt.com/products/ampt-cu/

And the instructions containing Modbus protocol here:

The Modbus protocol returns data on a per-string basis, and the number of strings is dynamic depending on how many optimizers are connected with the communications unit.

I see two ways to approach the implementation:

  1. Implement a dynamic system where a device implementing EssDcCharger is instantiated per string / optimizer. This would require the devices to be created dynamically depending on the value N (number of strings) that is read in the opening Modbus block.
  2. Add logic into the device implementation to represent all strings together as a single EssDcCharger. This would sum the current and power across all strings and represent this as a single device.

To my mind, approach 1 would provide enhanced data visibility as the performance of different strings would be more easy to visualise. However, the implementation would be more complex.

I would like to get the community’s views on this question and whether this approach is practical.

Has anyone implemented something like this before?

Hi Thomas,

yes, you could dynamically create EssDcCharger instances; but I have not done that.

What we usually do instead is, that we move this configuration (i.e. “How many MPPT/DC-Strings are connected?”) to the App. The AppCenter than takes over the task of statically creating configurations for EssDcCharger instances. See the FENECON Home 30 App as an example → openems/io.openems.edge.core/src/io/openems/edge/app/integratedsystem/FeneconHome30.java at develop · OpenEMS/openems · GitHub

Regards,
Stefan