Library to communicate with Solar Frotier inverters
Project description
Solar Frontier Inverter API
Python Library to retrieve data from "Solar Frontier" inverters on LAN. Able to get measurements, yield data, system info.
Installation
Available on PyPi
pip install python-solarfrontier
Compatibility
Confirmed to work with:
- SF-WR-5503x
Example
Initiate the API instance with host. Authentication not supported.
import asyncio
from python_solarfrontier.api import SolarFrontierAPI
from python_solarfrontier.utils import UnitConverter
async def main():
host = '192.168.0.101' # IP address of the inverter
api = SolarFrontierAPI(host)
# Test if we can connect with the host
test = await api.test_connection()
print(f"Test connection: {test}")
# Get system information
system_info = await api.get_system_info()
print(f"System information: {system_info}")
# Get measurement data
measurements = await api.get_measurements()
print(f"Measurement data: {measurements}")
# Get the yield of the current day
yield_day = await api.get_yield_day()
print(f"Yield of the current day: {yield_day}")
# Get the yield of the current month
yield_month = await api.get_yield_month()
print(f"Yield of the current month: {yield_month}")
# Get the yield of the current year
yield_year = await api.get_yield_year()
print(f"Yield of the current year: {yield_year}")
#Get total yield
yield_total = await api.get_yield_total()
print(f"Total yield: {yield_total}")
# Close the session
await api.close()
# Get measurement values and units
unit_converter = UnitConverter()
total_yield_value, total_yield_unit = unit_converter.parse_measurement(yield_total)
print(f"Total yield value: {total_yield_value}, unit: {total_yield_unit}")
# Run the async main function
asyncio.run(main())
Contribution
Feel free to contribute with PR to dev
brach.
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
File details
Details for the file python-solarfrontier-0.1.1.tar.gz
.
File metadata
- Download URL: python-solarfrontier-0.1.1.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 127d5e4ddeb11d7c656ee7903cafd21685e1d3a21b5e27c9df12bee953348ccb |
|
MD5 | 4d383265a23f07906adab742c6e4c760 |
|
BLAKE2b-256 | b7261370ce3bc9a700eaf421e357f803725fa4fd2fc68bf6a540e3a6acec7df7 |
File details
Details for the file python_solarfrontier-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: python_solarfrontier-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f1c6980bc8a1a55e9d84c2d7e841e1bfc5b9d7f540af1356830b14f652aede9 |
|
MD5 | 2fd30e08e0253076c3dcfe678c7ad56a |
|
BLAKE2b-256 | 4c1e290b74c652546a6efc0c4e4bc59a5b5e70b3d4b14bda9f8e9c522201e489 |