Skip to content

Prometheus (Grafana) / MQTT (Home Assistant) exporter for Growatt solar inverters

License

Notifications You must be signed in to change notification settings

infertux/growatt_exporter

Repository files navigation

growatt_exporter

growatt_exporter is a standalone program written in C that can query Growatt solar inverters and output metrics compatible with Prometheus, Grafana, MQTT and Home Assistant. This allows to monitor PV production, battery status, etc. on a nice Grafana interface.

This has been tested extensively on the SPF 5000 ES but should work with any product offering a RS485 interface.

Screenshots

PV Production Inverter Output Home Assistant

The complete list of sensors can be found in growatt.h.

Build

From source

apt install clang libbsd-dev libconfig-dev libmodbus-dev libmosquitto-dev mosquitto-clients
make

Using Docker

./docker-build.sh

Install

  1. Install runtime dependencies:

apt install libconfig9 libmodbus5 libmosquitto1

  1. Copy binary:

cp growatt_exporter /opt/growatt-exporter

  1. Create config file /etc/growatt-exporter.conf:
device_or_uri = "/dev/ttyUSB0"

prometheus = {
  port = 1234
}

mqtt = {
  host = "10.0.0.1"
  port = 1883
  username = "homeassistant"
  password = "foobar"
}
  1. Create systemd service file /etc/systemd/system/growatt-exporter.service:
[Unit]
After=network.target

[Service]
ExecStart=/opt/growatt-exporter /etc/growatt-exporter.conf
Restart=on-failure
RestartSec=10
PrivateTmp=true
ProtectHome=true
ProtectProc=invisible
ProtectSystem=full

[Install]
WantedBy=multi-user.target
  1. Enable and start systemd service:

systemctl enable --now growatt-exporter

Kudos

The "Growatt OffGrid SPF5000 Modbus RS485 RTU Protocol" PDF document has been a very valuable resource. A copy of it is included in this Git repository. Thank you to the original author for their work.

Other brands

Would like to monitor Epever/Epsolar Tracer solar charge controllers instead? Here is a sister repository for that: https://github.com/infertux/epever_exporter

Other approaches

License

AGPLv3+

About

Prometheus (Grafana) / MQTT (Home Assistant) exporter for Growatt solar inverters

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published