Exporter for prometheus to export metrics from GoodWe Inverter
This exporter should be working on GoodWe ET, EH, BT, BH, ES, EM, BP, DT, MS, and D-NS families of inverters. It may work on other inverters as well, as long as they listen on UDP port 8899 and respond to one of supported communication protocols. The inverters communicate via UDP protocol, by default running on port 8899. They use a native 'AA55' protocol and (some models) ModBus protocol. ET inverters support both protocols, some inverters may not support both of them.
(If you can't communicate with the inverter despite your model is listed above, it is possible you have old ARM firmware version. You should ask manufacturer support to upgrade your ARM firmware (not just inverter firmware) to be able to communicate with the inveter via UDP.)
more info about the python goodwe library: https://github.com/marcelblijleven/goodwe
- Configured inverter:
Inverter must be connected to a 2.4GHz wifi network (if you have a wifi module)
If not, you can configure it following:
1.1 Connect to a wifi network calledSolar-Wifi
. The default login isadmin
and passwordadmin
note: default password is sometimes12345678
1.2 Open your browser and go to http://10.10.100.253 or http://10.10.100.254
1.3 enteradmin
as username, andadmin
as password
1.4 ClickStart setup
, and select router's SSID (must be a 2.4GHz network) and it's password
1.5 clickcomplete
to finish the setup process
- Installed python (tested with python 3.8, 3.9, 3.10):
for Ubuntu:
sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get install python3.8 python3.8-dev python3.8-distutils python3.8-venv
for RHEL/CentOS:
yum install python3.8
check:
python3.8 --version
- installed required modules for python:
python -m pip install asyncio prometheus_client goodwe
note: the inverter must be on the same network
To get the IP adress of the inverter, run:
python scripts/inverter_scan.py
you will see something like:
Located inverter at IP: 192.168.2.35, mac: 289C6E05xxxx, name: Solar-WiFi222W0782
Edit the file scripts/get-inverter-data.py
and on the line #7 add the IP address of the inverter
then run it with:
python scripts/get-inverter-data.py
and you should get all the data your inverter is exposing
check that you have:
- installed python
- installed goodwe modules (see Pre-requisites )
To test, start the exporter with minimal configuration:
python src/exporter.py --port <desired port> --interval <interval (s)> --inverter <inverterIP>
ie.
python src/exporter.py --port 8787 --interval 30 --inverter 192.168.2.35
(for more settings, see Supported parameters)
now you can call it via curl (from another terminal) to see, if it exports some metrics: (run in a new tab)
curl http://127.0.0.1:8787
to show help, just run the script with a --help
parameter:
python src/exporter.py --help
if everything is OK, you can set up the script as a service:
For Ubuntu:
check that you have:
- installed python (need for the script to get the IP adress)(see Pre-requisites)
- Installed docker compose (Docker compose installation)
To build the image, just go to the root folder (where the Dockerfile is) and run:
docker build -t goodwe-exporter:1.4.5 .
-
edit the docker-compose.yml file and put there the correct inverter IP. (other values are optional)
- To get the IP address, see section "How to get the IP Address of the inverter"
-
from command line run:
docker compose up -d
- get IP address of the container
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' goodwe-exporter
- check via curl to see,if exporter works metrics. use the IP address from step 3.
curl http://<IP>:8787
--inverter <inverterIP>
- [required] IP address of the inverter. To get the IP Address, see section How to get the inverter IP address.
--port <desired port>
- [optional][default: 8787] port, on which the exporter should expose the metrics
--interval <seconds>
- [optional][default: 30] interval between scrapings (in seconds).
--energy-price <value>
- [optional][default: 0] energy price per kwh (in eur). If '--scrape-spot-price' is set to true, '--energy-price' value is ignored
--PVpower <value>
- [optional][default: 5670] maximum power in Watts of your PV you can generate (ie. 5670 = 5.67 KW)
--scrape-spot-price <bool>
- [optional][default: False] True/False, if the exporter should scrape spot price from https://www.ote-cr.cz. If it's set to 'True', exporter will set the scraped spot price as the energy price (--energy-price is ignored)
--spot-scrape-interval <minutes>
- [optional][default: 30] (in minutes) scrape interval of spot prices. If you set it too low, ote-cr.cz will block your requests