A complete, tested ESPHome configuration for monitoring Growatt MOD 5000TL3-X solar inverters via RS485 Modbus RTU protocol, integrated with Home Assistant and/or MQTT for real-time solar energy monitoring. The setup additionally allows the user to limit the inverter power output (wattage), or turn the inverter on and off altogether.
- Architecture Overview
- Hardware Components and Wiring
- ESP32 Configuration with ESPHome
- Modbus Registers Explanation
This project creates a complete solar monitoring and control solution using a modern, local-first approach:
Solar Panels → Growatt MOD 5000TL3-X Inverter → RS485/Modbus RTU → LilyGO T-CAN485 ESP32 → WiFi → Home Assistant / MQTT
Home Assistant
- Central monitoring and automation platform
- Real-time dashboards and energy analytics
- Historical data storage and visualization
- Automation triggers based on solar production
ESPHome
- ESP32 Firmware platform providing seamless Home Assistant integration
- Automatic device discovery and configuration
- Over-the-air (OTA) updates
- Native Home Assistant API integration
LilyGO T-CAN485 ESP32 Board
- ESP32 microcontroller with built-in RS485 transceiver, no soldering or wiring required.
- Eliminates need for external RS485 converter circuits
- WiFi connectivity for Home Assistant communication
- GPIO pins pre-configured for RS485 communication
Modbus RTU Protocol
- Industrial-standard communication protocol
- Reliable data transmission over RS485
- Supports multiple data types (16-bit, 32-bit integers)
- Error detection and correction
Growatt MOD 5000TL3-X Inverter
- Solar inverter with built-in SYS COM port
- Modbus RTU slave device (default address: 1)
- Provides real-time solar production data
- System status and diagnostic information
- Solar Production: Inverter converts DC from panels to AC for grid
- Data Collection: Inverter continuously updates internal registers
- Modbus Communication: ESP32 polls inverter every 30 seconds via RS485
- Data Processing: ESPHome processes raw Modbus data and applies scaling
- Home Assistant Integration: Processed data sent via WiFi to Home Assistant
- Visualization: Real-time dashboards, historical charts, and automation triggers
- Local Control: No cloud dependency, works offline
- Real-time Monitoring: 30-second update intervals, or less
- Professional Integration: Native Home Assistant device discovery
- Expandable: Easy to add multiple inverters or additional sensors
- Reliable: Industrial Modbus protocol ensures data integrity
The LilyGO T-CAN485 board is specifically designed for industrial communication applications, making this project straightforward:
Built-in RS485 Transceiver
- No external RS485 converter needed
- No complex wiring diagrams
- No additional components to purchase
- Professional-grade signal conditioning
Integrated Design
- ESP32 microcontroller with WiFi
- RS485 transceiver on-board
- Power management included
- Compact form factor
Pre-configured LiliGo GPIO Mapping
- GPIO21: RS485 RX (connects to RS485-B)
- GPIO22: RS485 TX (connects to RS485-A)
- GPIO16: 5V rail enable for RS485 chip
- GPIO17: Auto-direction control
- GPIO19: RS485 chip enable
Component | Description | Where I got it |
---|---|---|
LilyGO T-CAN485 | ESP32 Development Board with RS485 | TinyTronics SKU: 005278 - €16,50 |
External antenna | Antenna for ESP32 development board | TinyTronics SKU: 001098 - €2,00 |
Growatt 16-pin COM Connector | SYS COM port connector | Stralend Groen |
2-Wire Cable | RS485 communication cable | Any electronics supplier. |
USB-C Power Supply | For LiliGo board | TinyTronics SKU: 002192 - €9,00 |
IP65 Enclosure | Weatherproof housing | TinyTronics SKU: 001800 - €8,00 |
Important: Always refer to the official Growatt MOD Inverter Documentation for complete SYS COM port specifications.
Based on the Growatt MOD series documentation, the 16-pin SYS COM connector uses the following pins for RS485 communication:
Growatt SYS COM Pin | Function | LilyGO T-CAN485 Pin |
---|---|---|
Pin 3 | RS485-A | GPIO22 (TX) |
Pin 4 | RS485-B | GPIO21 (RX) |
-
Prepare the data wire
- Strip 5mm of insulation from 2-wire cable on both ends
-
Connect wires to Growatt SYS COM Port and LiliGo terminals
Instead of using command-line tools, we'll use the ESPHome web interface for a user-friendly configuration experience.
- Open ESPHome dashboard
- Click + NEW DEVICE, and follow the instructions on the screen.
- Enter device name:
growatt-tcan485
- Select ESP32 as device type
- Choose ESP32 Dev Module board
Use the provided growatt-liligo-tcan485.yaml
configuration file as an example, and copy sections over to the config esphome created.
(Do not use API key, OTA password, and fallback WiFi key from the yaml in this repository. Esphome should have created those for you on adding a new device)
-
Prepare secrets.yaml
wifi_ssid: "Your_WiFi_Network" wifi_password: "Your_WiFi_Password"
-
Compile Firmware
- Click INSTALL in ESPHome dashboard
- Select Manual download
- Wait for compilation to complete
-
Initial Upload via USB
- Connect ESP32 to computer via USB-C
- Click Plug into this computer
- Select the compiled firmware file
- Upload to device
-
Subsequent Updates (OTA)
- After initial setup, updates can be done wirelessly
- ESPHome will update over WiFi
- Check ESPHome Logs
- Click LOGS in ESPHome dashboard
- Verify WiFi connection
- Check Modbus communication
No Modbus Communication
- Verify RS485 wiring (A and B may be swapped)
- Check inverter is powered and operational
WiFi Connection Issues
- Check secrets.yaml file
- Verify WiFi credentials
- Use fallback hotspot if needed
Compilation Errors
- Ensure ESPHome is up to date
- Check YAML syntax
- Verify all required libraries are available
The Growatt inverter uses two types of Modbus registers:
Holding Registers (Function Code 3)
- Read/write registers for configuration
- Used for inverter settings and control
- Examples: On/Off control, power limits
Input Registers (Function Code 4)
- Read-only registers for measurements
- Real-time sensor data and status
- Examples: Power output, energy totals, voltages
Many important values (power, energy) are stored as 32-bit integers across two consecutive 16-bit registers:
Why register_count: 2
is Required
- platform: modbus_controller
name: "Growatt AC Output Power"
address: 35 # Start address (Pac H)
register_count: 2 # Read 2 registers (35 + 36)
value_type: U_DWORD # Unsigned 32-bit integer
filters:
- multiply: 0.1 # Convert to watts
Register Layout for 32-bit Values
- High Register: Contains upper 16 bits
- Low Register: Contains lower 16 bits
- Combined: Forms complete 32-bit value
Based on the growatt-liligo-tcan485.yaml
configuration and Growatt Modbus Documentation:
YAML Address | Modbus Register | Description | Data Type | Scaling | Unit |
---|---|---|---|---|---|
35-36 | Pac H/L | AC Output Power | U_DWORD | ×0.1 | W |
5-6 | Ppv1 H/L | PV1 Input Power | U_DWORD | ×0.1 | W |
9-10 | Ppv2 H/L | PV2 Input Power | U_DWORD | ×0.1 | W |
YAML Address | Modbus Register | Description | Data Type | Scaling | Unit |
---|---|---|---|---|---|
53-54 | EAC today H/L | Daily Energy Production | U_DWORD | ×0.1 | kWh |
55-56 | EAC total H/L | Total Energy Production | U_DWORD | ×0.1 | kWh |
YAML Address | Modbus Register | Description | Data Type | Scaling | Unit |
---|---|---|---|---|---|
3 | Vpv1 | PV1 Voltage | U_WORD | ×0.1 | V |
7 | Vpv2 | PV2 Voltage | U_WORD | ×0.1 | V |
4 | PV1Curr | PV1 Current | U_WORD | ×0.1 | A |
8 | PV2Curr | PV2 Current | U_WORD | ×0.1 | A |
38 | Vac1 | Grid Voltage | U_WORD | ×0.1 | V |
37 | Fac | Grid Frequency | U_WORD | ×0.01 | Hz |
YAML Address | Modbus Register | Description | Data Type | Values |
---|---|---|---|---|
0 | Inverter Status | Operating State | U_WORD | 0=Waiting, 1=Normal, 3=Fault |
93 | Temp1 | Inverter Temperature | U_WORD | ×0.1 °C |
105 | Fault Code | Error Code | U_WORD | See fault code table |
YAML Address | Modbus Register | Description | Data Type | Range |
---|---|---|---|---|
0 | OnOff | Remote On/Off | U_WORD | 0=Off, 1=On |
3 | Active P Rate | Power Limit | U_WORD | 0-100% |
Power Reading Example
# Raw Modbus value: 25000 (from registers 35-36)
# Scaled value: 25000 × 0.1 = 2500.0 W
filters:
- multiply: 0.1
Energy Reading Example
# Raw Modbus value: 1234 (from registers 53-54)
# Scaled value: 1234 × 0.1 = 123.4 kWh
filters:
- multiply: 0.1
Frequency Reading Example
# Raw Modbus value: 5000 (from register 37)
# Scaled value: 5000 × 0.01 = 50.00 Hz
filters:
- multiply: 0.01
This configuration has been verified against:
- growatt-modbus-docs.pdf: Complete Modbus register specification
- growatt-mod-inverter-docs.pdf: MOD series hardware documentation
- Actual MOD 5000TL3-X inverter: Field-tested and verified
Once configured, the following entities will automatically appear in Home Assistant:
- Always disconnect AC and DC power before wiring
- Use insulated tools and follow electrical safety procedures
Installation Requirements
- Must be installed by qualified electrical personnel
- Comply with local electrical codes and regulations
- Obtain necessary permits and utility approvals
System Compatibility
- ✅ Tested with Growatt MOD 5000TL3-X
- ESPHome Modbus Controller Documentation
- Growatt Modbus Protocol Specification
- Growatt MOD Inverter Installation Manual
- LilyGO T-CAN485 Hardware Documentation
Status: ✅ Fully tested and operational with Growatt MOD 5000TL3-X