
Since I have a photovoltaic system with a Kostal inverter, I wanted a small display that shows me the current charging and consumption status. With this, I would like to be able to react manually in the future and use the power from the sun optimally.


Base Features
* Initial start creating WiFi-Hotspot to enter setup data easily
* Setup setting WiFi connection and hostname of Kostal Inverter
* On successful connection to Kostal Inverter the displays shows:
* Loading Level of Battery (SoC)
* Show animated battery icon like smartphone
* Show the three values of power consumption (directly from solar cells [PV], from Battery [Akku] or grid [Netz]
* Show smiley with sunglasses if sun is directly used, just a normal smiley if power of battery is used and an unhappy smiley if power of grid is used.
Modbus over WiFi
When I looked into the interfaces of the inverter, I found that it uses Modbus to read out the data. A protocol, since I had not used yet. But with some training time you can access the necessary data from an ESP32 via WiFi quite easily. Below there is a link reference to find data register of Kostal inverter.
The data is loaded periodically.
Used Libraries
modbus-esp8266
This library support reading data via modbus protocol.
https://github.com/emelianov/modbus-esp8266
U8g2
This is a very common lib to show data on several display like the 128x64 I2C/SPI OLED Display of DFRobot.
https://github.com/olikraus/u8g2
ESP-WiFiSettings
This is a simple WiFi configuration manager for ESP32 and ESP8266. It will allow you to configure your WiFi network name (SSID) and password via a captive portal: the ESP becomes an access point with a web based configuration page. In addition some initial settings could also be added on captive portal page.
https://github.com/Juerd/ESP-WiFiSettings
Links
- Source Code Repository of project on GitHub
- Modbus Documentation of Kostal Inverter: https://www.kostal-solar-electric.com/en-gb/download/download/-/media/document-library-folder---kse/2020/12/15/13/38/ba_kostal-interface-description-modbus-tcp_sunspec_hybrid.pdf

