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 |
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file SMA-SunnyBoy-0.0.5.tar.gz.
File metadata
- Download URL: SMA-SunnyBoy-0.0.5.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0b6cd456c305f599459219b2f55c3b3373541992debeb49c9981f4fbe12b64a
|
|
| MD5 |
977c006dbe6ac99bae1143e01c6b1e9f
|
|
| BLAKE2b-256 |
e40b88877806743e0cb82d1617d7d8ca0a90e4a648312f86aed2fa03e90bc87f
|