Skip to content

A command line tool to query the GOODWE SEMS APIs and SEMS Solar API.

License

Notifications You must be signed in to change notification settings

AaronSaikovski/gogoodwe

Repository files navigation

GoGoodwe v3.0.1

A command line tool to query the GOODWE SEMS Solar Inverter APIs - written in 100% Go.

Build Status Licence

Software Requirements:

Installation:

The toolchain is driven by using Taskfile and all commands are managed via the file Taskfile.yml

The list of commands is as follows:

* build:             Builds the project in preparation for debug.
* clean:             Removes the old builds and any debug information from the source tree.
* deps:              Fetches any external dependencies and updates.
* destroy:           Destroy Azure resources for testing.
* docs:              Updates the swagger docs - For APIs.
* generate:          update binary build version using gogenerate.
* goreleaser:        Builds a cross platform release using goreleaser.
* lint:              Lint, format and tidy code.
* release:           Builds the project in preparation for (local)release.
* run:               Builds and runs the program on the target platform.
* seccheck:          Code vulnerability scanner check.
* staticcheck:       Runs static code analyzer staticcheck.
* test:              Executes unit tests.
* version:           Get the Go version.
* vet:               Vet examines Go source code and reports suspicious constructs.
* watch:             Use air server for hot reloading.

Execute using the taskfile utility:

task <command_from_above_list>

To get started type,

  • task deps - to fetch all dependencies and update all dependencies.
  • task build - to build debug version for your target environment architecture.
  • task release - Builds a release version for your target environment architecture - outputs to /bin folder.

Usage

Determine the Station ID from the GOODWE site as follows. Open the Sems Portal. The Plant Status will reveal the Station ID in the URL. Example:

https://www.semsportal.com/powerstation/powerstatussnmin/11112222-aaaa-bbbb-cccc-ddddeeeeeffff

Then the Station ID is 11112222-aaaa-bbbb-cccc-ddddeeeeeffff.

From the command line the usage is pretty simple:

The Report Type corresponds to the type of API call and Report that is generated:

  • (0)-Detail - Fully detailed report.
  • (1)-Summary - Summary Data report (reduced information).
  • (2)-Point - Inverter All points data.
  • (3)-Plant - Plant Detail By Powerstation Id.
  • (4)-PlantChart - Plant Chart data for use in Charts and Graphs.
  • (5)-PowerFlow - Powerflow Summary data
##Note the use of single quotes ''
./gogoodwe  --account '<user@email.com>' \
            --pwd '<password>' \
            --powerstationid '<powerstation id>' \
            --reporttype '<report type (Optional)>'

# Or
./gogoodwe  -a '<user@email.com>' \
            -p '<password>' \
            -i '<powerstation id>' \
             -r '<report type> (Optional)>'

To get the help on using the command line tool, type:

./gogoodwe --help

# Or
./gogoodwe -h

Contributions

Please feel free to lodge an issue or pull request on GitHub.

Thanks

Disclaimer

GOODWE access is based on the undocumented API used by mobile apps. This could break at any time.

Known Issues

  • The Powerchart report is returning no/blank values - investigating.