Read Sungrow inverter data from websocket
This library is used to read real time data from Sungrow inverters with the WiNet module that expose the websocket interface.
Known supported inverters:
SH8.0RT (SH6.0RT and SH10.0RT likely too)
To check if your inverter is supported, simply try it out!
Installation
Installation is straight forward:
pip install sungrow-websocket
Command line interface
The command line interface is quite simple:
sungrow-websocket <host>
<host> is the hostname or IP address of the inverter. Check your home router for the inverter (maybe registers as espressif).
You will then get a table with the live data:
+---------------------------------------+-----------+
| Item | Value |
+---------------------------------------+-----------+
| Device Status | Standby |
| Bus Voltage | 16.0 V |
| Internal Air Temperature | 28.6 ℃ |
| Array Insulation Resistance | 997 kΩ |
| Daily Self-consumption Rate | 23.8 % |
| ... | ... |
API
Using the library is easy:
>>> from sungrow_websocket import SungrowWebsocket
>>> host = "your-ip-or-hostname"
>>> sg = SungrowWebsocket(host)
>>> data = sg.get_data()
data is a dict of identifiers mapping to InverterItem entries:
>>> from pprint import pprint
>>> pprint(data)
{'air_tem_inside_machine': InverterItem(name='I18N_COMMON_AIR_TEM_INSIDE_MACHINE', desc='Internal Air Temperature', value='28.5', unit='℃'),
'bus_voltage': InverterItem(name='I18N_COMMON_BUS_VOLTAGE', desc='Bus Voltage', value='16.0', unit='V'),
The name entry is the internal name of the item, while desc is the clear description. This is loaded according to the locale (en_US by default) and can be set as parameter to the class:
>>> from sungrow_websocket import SungrowWebsocket
>>> host = "your-ip-or-hostname"
>>> sg = SungrowWebsocket(host, locale="zh_CN")
>>> data = sg.get_data()
>>> from pprint import pprint
>>> pprint(data)
{'air_tem_inside_machine': InverterItem(name='I18N_COMMON_AIR_TEM_INSIDE_MACHINE', desc='机内空气温度', value='28.5', unit='℃'),
'bus_voltage': InverterItem(name='I18N_COMMON_BUS_VOLTAGE', desc='母线电压', value='16.0', unit='V'),
If your locale is not supported, it will fall back to en_US.
Metadata
Release files for sungrow-websocket 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sungrow-websocket-0.2.2.tar.gz | 5.1 kB | Without provenance | Details for sungrow-websocket-0.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sungrow_websocket-0.2.2-py3-none-any.whl | Python 3 | none | any | Details for sungrow_websocket-0.2.2-py3-none-any.whl |
Total release size: 10.6 kB
Release files / sungrow-websocket-0.2.2.tar.gz
| Download URL | sungrow-websocket-0.2.2.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
036c30efa18335511c4838565b2a36b6d991579231882dabb1f630e78824468f
|
|
BLAKE2b-256 checksum How to use checksums |
8c94f8a1c8e4e0e8ecc56bfc8d2c8c06c914742ca300c675207810dcdbcec756
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.6
|
Release files / sungrow_websocket-0.2.2-py3-none-any.whl
| Download URL | sungrow_websocket-0.2.2-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
90e4a6c51695cd8b8054b9a3c15f7e1ac833bc78c558c2d721f0b372b4f1eae1
|
|
BLAKE2b-256 checksum How to use checksums |
615c4f9900a7a228cae697152bfd285b36626f7aed3ca90d8970caeb48116e55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.6
|
Security for sungrow-websocket 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.