Welcome to SMA API!
This is a simple data retrieving for SMA SunnyBoy.
See:
Comptability
Tested on SunnyBoy 5.0 (1.3.17.R)
Installation
pip install SMA-SunnyBoy
Simple usage
from sma_sunnyboy import *
client = WebConnect("192.168.0.10", Right.USER, "password")
client.auth()
pow_current = client.get_value(Key.pow_current)
client.logout()
Initialize
Start by import and instantiate the module using WebConnect
from sma_sunnyboy import *
client = WebConnect("192.168.0.10", Right.USER, "password")
Authenticate
Initialize the module using auth()
(return: Boolean)
client.auth()
You can check if you are still authenticated using check_connection()
(return: Boolean)
client.check_connection()
Logout
You have to call logout before exiting the program
(return: Boolean)
client.logout()
Get all instant values
Using get_all_keys() you can obtains all SMA value in JSON format
(return: JSON)
data = client.get_all_keys()
print(data)
Get Value
You can retrieve an instant value using get_value()
Pass in argument the wanted key from Key.key_name
(return: String)
value = client.get_value(Key.power_total)
print(value)
You can use preset keys from the list bellow:
| Tag | ID | Unit |
|---|---|---|
| power_current | 6100_40263F00 | W |
| power_total | 6400_00260100 | W |
| server_ip | 6180_104A9A00 | |
| server_dns | 6180_104A9D00 | |
| server_netmask | 6180_104A9B00 | |
| server_gatewy | 6180_104A9C00 | |
| power_ab | 6380_40251E00 | |
| power_b | 6380_40451F00 | |
| voltage_ab | 6380_40451F00 | |
| tide_ab | 6380_40452100 | |
| power_amp_ | 6100_40465300 | A |
| productivity_total | 6400_00260100 | |
| service_time | 6400_00462E00 | s |
| injection_time | 6400_00462F00 | s |
| ethernet_status | 6180_084A9600 | status |
| ethernet_counter_status | 6180_084AAA00 | status |
| wlan_strength | 6100_004AB600 | |
| wlan_ip | 6180_104AB700 | |
| wlan_netmask | 6180_104AB800 | |
| wlan_gateway | 6180_104AB900 | |
| wlan_dns | 6180_104ABA00 | |
| wlan_status | 6180_084ABC00 | status |
| wlan_scan_status | 6180_084ABB00 | |
| device_state | 6180_084B1E00 | W |
| device_warning | 6100_00411F00 | W |
| device_error | 6100_00412000 | W |
Metadata
Release files for SMA-SunnyBoy 0.0.5
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 |
|---|---|---|---|---|
| SMA-SunnyBoy-0.0.5.tar.gz | 5.3 kB | Without provenance | Details for SMA-SunnyBoy-0.0.5.tar.gz |
Release files / SMA-SunnyBoy-0.0.5.tar.gz
| Download URL | SMA-SunnyBoy-0.0.5.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a0b6cd456c305f599459219b2f55c3b3373541992debeb49c9981f4fbe12b64a
|
|
BLAKE2b-256 checksum How to use checksums |
e40b88877806743e0cb82d1617d7d8ca0a90e4a648312f86aed2fa03e90bc87f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
|
Security for SMA-SunnyBoy 0.0.5
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.