Architecture & Implementation: The Inverter Abstraction Layer

November 10, 2025 | 2 min read

Background

I worked as a Lead Software Developer for a solar energy company. I was responsible for leading the design, development, and documentation of a modular, Python-based abstraction layer. This layer enabled connectivity with solar inverters from multiple brands.

This system runs in Docker containers on a SunBerry device. It connects to the solar inverter using Modbus. I also introduced MQTT for integration with home automation systems and for communication between the different processes.


What is the SunBerry

The SunBerry is located locally at the customer’s site and can be accessed remotely via VPN. The device manages the energy flow to the connected battery, boiler, and other devices. The SunBerry contains all necessary services locally, such as a web server for the user interface, data storage, and more.

The abstraction layer

As mentioned, the solar inverter is connected to the SunBerry via Modbus RTU. The challenge was that we needed to support multiple inverter models and brands. Each brand and model uses different Modbus registers, register sizes, and protocol versions.

While one could use a separate register table for every model, we chose a smarter approach. Models like the GoodWe ET, BT, and EM have many similar registers and could be grouped together. Also, for new protocol versions, only the new register differences needs to be specified, not the entire table.

The abstraction layer also includes functionality to debug and test the features together with the actual inverter.

The inverter process

The inverter process (which contains the abstraction layer) manages all communication between the client processes and the inverter. Examples of client processes include Battery Management and Boiler Management.

Communication with the inverter process is done via MQTT and is always the same, regardless of which inverter is connected.


MQTT

The introduced MQTT server is used not only for internal inter-process communication but also for the possibility to integrate with home automation systems and for sending commands to the system via the user interface.

MQTT is also very helpful during the development process. Communication can be easily made visible using a standard MQTT client or a desktop tool like MQTT Explorer. This allowed services to be developed and tested locally, without needing the complete system.