Communicate with your inverter (WKS EKO Circle).
Project description
Python Inverter COM
Python module to communicate with WKS EKO Circle inverters.
Installation
$ python -m pip install -U wks-com
Module
You can use the module directly from your code:
from wks_com import constants
from wks_com.inverter import Inverter
# Init the inverter (default port is /dev/ttyUSB0, several optional keyword-arguments are available)
# Example: inverter = Inverter("/dev/ttyAMA0", timeout=5.0)
inverter = Inverter()
# Send a command to the inverter
response = inverter.send("QID")
# The same command via an alias
response = inverter.send("serial-no")
# The same command using a constant
response = inverter.send(constants.CMD_SERIAL_NO)
Program
The module comes with the wks-read program.
You can use it to send commands to inverters, and see what data you can get from.
The usage is as follows:
$ wks-read [--port SERIAL_PORT] [--debug] COMMAND_OR_ALIAS [COMMAND_OR_ALIAS...]
As an example, here is how to retrieve the inverter serial number:
$ wks-read QID
"96332309100452"
# The same command via an alias
$ wks-read serial-no
"96332309100452"
When enabling debug logs, it will likely show:
$ wks-read --debug serial-no
DEBUG:wks_com.inverter:/dev/ttyUSB0 > SEND 'QIDÖê\r'
DEBUG:wks_com.inverter:/dev/ttyUSB0 > WRITTEN 6 chars (OK)
DEBUG:wks_com.inverter:/dev/ttyUSB0 < RAW b'(96332309100452?\xf3\r'
DEBUG:wks_com.inverter:/dev/ttyUSB0 < DECODED '96332309100452'
"96332309100452"
The default port is /dev/ttyUSB0, you can change that:
$ wks-read --port /dev/ttyAMA0 serial-no
"96332309100452"
Commands and Aliases
You can send any commands as defined in the official documentation, and even unknown commands.
There are also aliases you could use:
daily-loadfor theQLDcommand (it will automatically fill the date using the current time);daily-pvfor theQEDcommand (it will automatically fill the date using the current time);metricsfor theQPGS0command;monthly-loadfor theQLMcommand (it will automatically fill the date using the current time);monthly-pvfor theQEMcommand (it will automatically fill the date using the current time);ratingsfor theQPIRIcommand;serial-nofor theQIDcommand;statusfor theQPIGScommand;timefor theQTcommand;total-loadfor theQLTcommand;total-pvfor theQETcommand;warningsfor theQPIWScommand;yearly-loadfor theQLYcommand (it will automatically fill the date using the current time);yearly-pvfor theQEYcommand (it will automatically fill the date using the current time);
When the inverter does not understand a command, it will respond with NAK.
Development
Set up a virtual environment:
$ python -m venv venv
$ . venv/bin/activate
Install, or update, dependencies:
$ python -m pip install -U pip
$ python -m pip install -e '.[dev]'
Run tests:
$ python -Wd -m pytest --doctest-modules src
Run linters, and quality checkers:
$ ./checks.sh
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wks_com-1.2.1.tar.gz.
File metadata
- Download URL: wks_com-1.2.1.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34739d0d42745c2683f16a4edc067c1ca0cdaa687bc1345586c87bfa1be87725
|
|
| MD5 |
ec2499d0b75bad302698d0259476da5e
|
|
| BLAKE2b-256 |
dfbcfbfaabb3622837bc8c9a4f11cbcc219405d5ae5f5c4d4386d677632a2632
|
Provenance
The following attestation bundles were made for wks_com-1.2.1.tar.gz:
Publisher:
release.yml on BoboTiG/python-wks-com
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wks_com-1.2.1.tar.gz -
Subject digest:
34739d0d42745c2683f16a4edc067c1ca0cdaa687bc1345586c87bfa1be87725 - Sigstore transparency entry: 146132423
- Sigstore integration time:
-
Permalink:
BoboTiG/python-wks-com@f92d2a97ff7e3a4468cff5b3f0d80020e64dd0de -
Branch / Tag:
refs/tags/v1.2.1 - Owner: https://github.com/BoboTiG
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f92d2a97ff7e3a4468cff5b3f0d80020e64dd0de -
Trigger Event:
push
-
Statement type:
File details
Details for the file wks_com-1.2.1-py3-none-any.whl.
File metadata
- Download URL: wks_com-1.2.1-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b4f19e8e390196baaacfcd7d552aa9abb8ff75fddb1c460bd919499a29e275c
|
|
| MD5 |
4027045e2a716c6ddfec8570a3461572
|
|
| BLAKE2b-256 |
f01ecf25c0ff24b722a4c0e6c3ff61c7c0716ea9f6b62a11d5a3210da4d31790
|
Provenance
The following attestation bundles were made for wks_com-1.2.1-py3-none-any.whl:
Publisher:
release.yml on BoboTiG/python-wks-com
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wks_com-1.2.1-py3-none-any.whl -
Subject digest:
7b4f19e8e390196baaacfcd7d552aa9abb8ff75fddb1c460bd919499a29e275c - Sigstore transparency entry: 146132425
- Sigstore integration time:
-
Permalink:
BoboTiG/python-wks-com@f92d2a97ff7e3a4468cff5b3f0d80020e64dd0de -
Branch / Tag:
refs/tags/v1.2.1 - Owner: https://github.com/BoboTiG
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f92d2a97ff7e3a4468cff5b3f0d80020e64dd0de -
Trigger Event:
push
-
Statement type: