Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-solarfrontier-0.1.1.tar.gz (6.4 kB view hashes)

Uploaded Source

Built Distribution

python_solarfrontier-0.1.1-py3-none-any.whl (8.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page