sciurius / Growatt-WiFi-Tools

Tools for the Growatt WiFi module.
24 stars 7 forks source link

This is a set of tools to play with the Growatt WiFi data collection module.

  1. Install Perl if neccessary, add module Data::Hexify .

NOTE: You may need to adjust paths to scripts and files, depending on your installation.

  1. Start either the proxy server, or the standalone server.

2a. Start proxy server:

perl growatt_server.pl --debug --remote

make sure it keeps running!

There are some systemd/growattproxy* files to deploy the proxy server using systemd.

The proxy server will intercept all communication between the WiFi module and the Growatt server, and copy the energy data packages to local disk.

2b. Start standalone server:

perl growatt_server.pl --debug

make sure it keeps running!

There are some systemd/growattserver* files to deploy the server using systemd.

The standalone server is like the proxy server, but does not use the Growatt server. It just copies the energy data packages to local disk.

2c. For systemd, install the supplied growatt.socket and growatt@.service files into /etc/systemd/system . Adjust growatt*@.service to reflect the actual location of the simple server script, and the location where the data should be collected.

Start the service (as super user), e.g. for the standalone server:

systemctl start growattserver.socket

If you're satisfied, you can remove the "--debug" option in growattserver@.service to reduce the log messages. And do not forget to enable growattserver.socket using systemctl so it will be activated automatically upon reboot.

When deployed using systemd, a logfile will be created in the server directory. The name of the logfile is derived from the current date, e.g., 20150702.log.

  1. In the Growatt WiFi module, set the server to the system running the proxy or standalone server. A reboot of the module is neccessary.

    NOTICE: Currently there's a hard-wired fix in the proxy server to misinform the Growatt server that it is sending data to "server.growatt.com". Likewise, if an instruction arrives from the server to change the server address, this is changed to the actual address.

    I hope to remove this 'fix' when Growatt finally switches their servers to another location.

    The standalone server doesn't have nor need this 'fix' code.

  2. In the directory where the proxy server is running small data files will be created:

    20150702163939.dat 20150702164451.dat ...and so on...

    You can read these with

    perl growatt_data.pl 20150702163939.dat

    This script assumes your version of the Growatt WiFi module is 2.0.0.0 or higher. If you have a 1.0.0.0 module, pass the --version=1 command line option to the script.

  3. If you have a collection of data files, for example the data for one day, you can generate a chart using

    perl growatt_data.pl --day --csv 20150702*.dat > current.csv gnuplot growatt_data.plot

    This will produce a PNG image:

    current.png - power production, accumulative, total and per PV

    Also note that the format of the csv file generated is now the same as an export from the spreadsheet data that can be downloaded from the Growatt site.

  4. If you have a series of current.csv data files, for example the data for one month, you can generate a chart using

    perl growatt_daily.pl 2015/07/*/current.csv > daily.csv gnuplot growatt_daily.plot

    This will produce a PNG image:

    daily.png - power production per day

WARNING: Use at your own risk.

Feedback welcome.