From ac8d88257c146750e4a2703ec0bf05538e991dda Mon Sep 17 00:00:00 2001 From: Aaron Brown Date: Sat, 22 Jan 2022 12:44:32 +1000 Subject: [PATCH] Change Docker image to run MQTT by default. --- Dockerfile | 2 +- README.md | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9d4c085..7608744 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,4 +7,4 @@ RUN pip install --no-cache-dir -r requirements.txt . WORKDIR /opt/PyGrowatt/scripts ENTRYPOINT [ "python" ] -CMD [ "growatt_pvoutput.py", "--config", "/opt/PyGrowatt/scripts/config.ini" ] \ No newline at end of file +CMD [ "growatt_mqtt.py" ] \ No newline at end of file diff --git a/README.md b/README.md index 9f474e4..a7c0976 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Build a [Docker](https://www.docker.com/) container: ```bash docker build -t pygrowatt . ``` -By default, the container runs the example ```growatt_pvoutput.py``` script. +By default, the container runs the example ```growatt_mqtt.py``` script. ### Kubernetes Deployment _(optional)_ At least in minikube, a pod will start with GMT time by default. To enable easy toggling for local time the TZ environment variable was added to the deployment template and can be updated with the [tz database time zone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for your locale. By default, it is set to Etc/GMT for compatability. @@ -64,12 +64,19 @@ cp scripts/Growatt.lua ~/.config/wireshark/plugins ``` ## Usage +Configure the computer running this script with a staic IP and the ShineWifi-X module to communicate with that IP address, then run one of the following example scripts or create your own! +### MQTT Example Script +To use the example MQTT script you will need to enter your MQTT `ServerIP` and `ServerPort` in the configuration file, then execute the script: +```bash +cd scripts +python growatt_mqtt.py +``` +### PVOutput Example Script To use the example PVOutput script you will need to enter your `Apikey` and `SystemId` in the configuration file, then execute the script: ```bash cd scripts -python growatt_pvoutput.py --config config.ini +python growatt_pvoutput.py ``` -Finally, you need to configure the ShineWifi-X module to communicate with the computer running this script. You will also need to configure the computer running this script with a static IP address. ## Contributing Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.