A simple Python Script for reading Growatt PV Inverter Modbus RS485 RTU Protocol and publishing telemetry via MQTT
- Some hardware running a Linux based OS with Python 3 (eg. Raspberry Pi)
- Connect your Linux based OS to the RS485 port on the inverter via a RS485 to USB cable
- Copy
solarmon.cfg.exampletosolarmon.cfgand modify the config values to your setup as needed - Run
pip install -r requirements.txt - Run
python solarmon.pyin a screen (or you could setup a service if that is your preference)
To read from multiple units add a new section to the solarmon.cfg config with the unit's id.
[inverters.<name>]
unit = <id>Example:
[inverters.unit2]
unit = 2Use your MQTT broker and client (for example Home Assistant MQTT discovery) to view inverter telemetry.
- Copy
solarmon.serviceto/etc/systemd/system - Modify the
WorkingDirectoryandUserto suit your setup. - Run
systemctl start solarmonto start the service. - Run
systemctl status solarmonand ensure that the service is running correctly. - Run
systemctl enable solarmonto make the service automatically start when the system does.