Skip to content

Commit

Permalink
Change Docker image to run MQTT by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronjbrown committed Jan 22, 2022
1 parent 61bb2c0 commit ac8d882
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
CMD [ "growatt_mqtt.py" ]
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit ac8d882

Please sign in to comment.