Skip to content
tobiasfaust edited this page Nov 21, 2023 · 13 revisions

Modbus-RTU to MQTT Gateway for Solar Inverter

license ESP32 Architecture GitHub release (latest by date including pre-releases) GitHub All Releases

This project implements a Gatewayx for Solar Inverter with with Modbus-RTU communication to MQTT on ESP32 basis.
Direkt Communication wit OpenWB is implemented.

Supported Solar Inverter

Basically, all Inverters with Modbus RS485 RTU communication. Currently the following Inverters are with thier special registers integrated:

  • Solax Hybrid X1
  • Solax Hybrid X3
  • Solax MIC
  • Growatt SPH
  • Sofar-KTL Solarmax-SGA
  • Deye Sun SG04LP3

If your Solar Inverter is not listed, feel free to add the special register simply, please check th wiki page or contact me by opening a new issue in github.

What you need

  • ESP32 NodeMCU
  • MAX485 Module TTL Switch Schalter to RS-485 Module RS485 5V Modul (this can also handle 3.3V from ESP)

An ESP8266 is actually not sufficient, because Modbus communication works fail-free only with hardwareserial. ESP8266 has only one Hardwareserial port which is used by serial/debug output. ESP32 has 3 Hardewareserial ports and we use one of them. Another reason is available memory for such huge json definition or such large modbus answers.
Please check also the wiki page, how to wire the circuit.

How to start

It´s recommend to start with one example to check wiring works correctly. The example request the inverter SN and if wiring is correct, the inverter will answer with his number.

request: 01 03 00 00 00 07 08 04

Response: 01 03 .....

There is also a page with all configured livedata items available. This page is refreshing every 5 seconds. Please check Modbus Item Configuration page.