{"id":19164910,"url":"https://github.com/bobotig/python-wks-com","last_synced_at":"2025-05-07T12:21:47.888Z","repository":{"id":213505459,"uuid":"728861808","full_name":"BoboTiG/python-wks-com","owner":"BoboTiG","description":"Communicate with your inverter (WKS ECO Circle).","archived":false,"fork":false,"pushed_at":"2025-05-05T03:44:24.000Z","size":112,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-05T04:32:01.354Z","etag":null,"topics":["eco","inverter","pyserial","python310","python311","python312","python313","rs232","serial","wks"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/wks-com/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BoboTiG.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["BoboTiG"]}},"created_at":"2023-12-07T21:25:10.000Z","updated_at":"2025-05-05T03:44:26.000Z","dependencies_parsed_at":"2023-12-21T12:46:02.833Z","dependency_job_id":"6aed6c50-4bec-4795-a52e-4e8038f92247","html_url":"https://github.com/BoboTiG/python-wks-com","commit_stats":null,"previous_names":["bobotig/python-wks-com"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BoboTiG%2Fpython-wks-com","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BoboTiG%2Fpython-wks-com/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BoboTiG%2Fpython-wks-com/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BoboTiG%2Fpython-wks-com/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BoboTiG","download_url":"https://codeload.github.com/BoboTiG/python-wks-com/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252874208,"owners_count":21817780,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eco","inverter","pyserial","python310","python311","python312","python313","rs232","serial","wks"],"created_at":"2024-11-09T09:25:41.045Z","updated_at":"2025-05-07T12:21:47.864Z","avatar_url":"https://github.com/BoboTiG.png","language":"Python","funding_links":["https://github.com/sponsors/BoboTiG","https://www.patreon.com/mschoentgen"],"categories":[],"sub_categories":[],"readme":"# Python Inverter COM\n\n[![PyPI Version](https://img.shields.io/pypi/v/wks-com.svg)](https://pypi.python.org/pypi/wks-com)\n[![PyPI Status](https://img.shields.io/pypi/status/wks-com.svg)](https://pypi.python.org/pypi/wks-com)\n[![PyPI Python Versions](https://img.shields.io/pypi/pyversions/wks-com.svg)](https://pypi.python.org/pypi/wks-com)\n[![Tests](https://github.com/BoboTiG/python-wks-com/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/BoboTiG/python-wks-com/actions/workflows/tests.yml)\n[![Github License](https://img.shields.io/github/license/BoboTiG/python-wks-com.svg)](https://github.com/BoboTiG/python-wks-com/blob/main/LICENSE)\n\n\u003e [!TIP]\n\u003e Become **my boss** to help me work on this awesome software, and make the world better:\n\u003e \n\u003e [![Patreon](https://img.shields.io/badge/Patreon-F96854?style=for-the-badge\u0026logo=patreon\u0026logoColor=white)](https://www.patreon.com/mschoentgen)\n\nPython module to communicate with WKS EKO Circle inverters.\n\n## Installation\n\n```bash\n$ python -m pip install -U wks-com\n```\n\n## Module\n\nYou can use the module directly from your code:\n\n```python\nfrom wks_com import constants\nfrom wks_com.inverter import Inverter\n\n\n# Init the inverter (default port is /dev/ttyUSB0, several optional keyword-arguments are available)\n# Example: inverter = Inverter(\"/dev/ttyAMA0\", timeout=5.0)\ninverter = Inverter()\n\n# Send a command to the inverter\nresponse = inverter.send(\"QID\")\n\n# The same command via an alias\nresponse = inverter.send(\"serial-no\")\n\n# The same command using a constant\nresponse = inverter.send(constants.CMD_SERIAL_NO)\n```\n\n## Program\n\nThe module comes with the `wks-read` program.\nYou can use it to send commands to inverters, and see what data you can get from.\n\nThe usage is as follows:\n\n```bash\n$ wks-read [--port SERIAL_PORT] [--debug] COMMAND_OR_ALIAS [COMMAND_OR_ALIAS...]\n```\n\nAs an example, here is how to retrieve the inverter serial number:\n\n```bash\n$ wks-read QID\n\"96332309100452\"\n\n# The same command via an alias\n$ wks-read serial-no\n\"96332309100452\"\n```\n\nWhen enabling debug logs, it will likely show:\n\n```log\n$ wks-read --debug serial-no\nDEBUG:wks_com.inverter:/dev/ttyUSB0 \u003e SEND 'QIDÖê\\r'\nDEBUG:wks_com.inverter:/dev/ttyUSB0 \u003e WRITTEN 6 chars (OK)\nDEBUG:wks_com.inverter:/dev/ttyUSB0 \u003c RAW b'(96332309100452?\\xf3\\r'\nDEBUG:wks_com.inverter:/dev/ttyUSB0 \u003c DECODED '96332309100452'\n\"96332309100452\"\n```\n\nThe default port is `/dev/ttyUSB0`, you can change that:\n\n```log\n$ wks-read --port /dev/ttyAMA0 serial-no\n\"96332309100452\"\n```\n\n## Commands and Aliases\n\nYou can send any commands as defined in the official documentation, and even unknown commands.\n\nThere are also aliases you could use:\n\n- `daily-load` for the `QLD` command (it will automatically fill the date using the current time);\n- `daily-pv` for the `QED` command (it will automatically fill the date using the current time);\n- `metrics` for the `QPGS0` command;\n- `monthly-load` for the `QLM` command (it will automatically fill the date using the current time);\n- `monthly-pv` for the `QEM` command (it will automatically fill the date using the current time);\n- `ratings` for the `QPIRI` command;\n- `serial-no` for the `QID` command;\n- `status` for the `QPIGS` command;\n- `time` for the `QT` command;\n- `total-load` for the `QLT` command;\n- `total-pv` for the `QET` command;\n- `warnings` for the `QPIWS` command;\n- `yearly-load` for the `QLY` command (it will automatically fill the date using the current time);\n- `yearly-pv` for the `QEY` command (it will automatically fill the date using the current time);\n\nWhen the inverter does not understand a command, it will respond with `NAK`.\n\n## Development\n\nSet up a virtual environment:\n\n```bash\n$ python -m venv venv\n$ . venv/bin/activate\n```\n\nInstall, or update, dependencies:\n\n```bash\n$ python -m pip install -U pip\n$ python -m pip install -e '.[dev]'\n```\n\nRun tests:\n\n```bash\n$ python -Wd -m pytest --doctest-modules src\n```\n\nRun linters, and quality checkers:\n\n```bash\n$ ./checks.sh\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbobotig%2Fpython-wks-com","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbobotig%2Fpython-wks-com","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbobotig%2Fpython-wks-com/lists"}