How waveguide/go-growatt works
Go-Growatt reads Growatt inverter telemetry over Modbus, publishes stats and state changes to MQTT, and accepts MQTT commands to limit active power. The principal workflow is configuration and startup, inverter polling and decoding, then MQTT publication; command messages travel back through the application to the inverter. The README also describes an optional serial-over-TCP bridge. Inverter internals are only partially sampled, so the graph shows documented register, time, and power-control behavior without inferring unshown call details.
Main entry points: inverter.go Polling and reconnect · mqtt.go MQTT client · main.go Application coordinator · ser2net.py Serial-TCP bridge
Components 18
Application
- Application coordinator
main.go - Config loading
main.go - Logging setup
logger/logger.go - Power command handling
main.go - Stats and state publishing
main.go
Inverter access
- Polling and reconnect
inverter/inverter.go - Modbus register access
inverter/inverter.go - Stats decoding
inverter/inverter.go - Inverter time sync
inverter/inverter.go - Active power control
inverter/inverter.go
MQTT messaging
- MQTT client
mqtt/mqtt.go
Serial bridge
- Serial-TCP bridge
ser2net.py
Other components
- Operator
- YAML config
- MQTT broker
- Growatt inverter
- Serial device
- Remote TCP client
Connections 23
- Operator → YAML config: supplies
- Application coordinator → Config loading: loads config
- Config loading → YAML config: reads
- Application coordinator → Logging setup: sets up
- Application coordinator → MQTT client: initializes
- MQTT client → MQTT broker: connects
- Application coordinator → MQTT client: subscribes
- MQTT broker → MQTT client: delivers commands
- MQTT client → Power command handling: invokes callback
- Power command handling → Polling and reconnect: queues power rate
- Application coordinator → Polling and reconnect: starts polling
- Polling and reconnect → Modbus register access: reads registers
- Modbus register access → Growatt inverter: reads and writes
- Polling and reconnect → Stats decoding: decodes readings
- Polling and reconnect → Inverter time sync: checks and updates time
- Polling and reconnect → Active power control: applies commands
- Active power control → Modbus register access: writes registers
- Polling and reconnect → Stats and state publishing: sends stats
- Stats and state publishing → MQTT client: publishes data and state
- MQTT client → MQTT broker: publishes messages
- Serial-TCP bridge → Serial device: shuttles bytes
- Serial-TCP bridge → Remote TCP client: shuttles bytes
- Remote TCP client → Serial-TCP bridge: connects