Skip to main content

Solax inverter API client

Project description

Solax

Build Status PyPI - Downloads

Read energy usage data from the real-time API on Solax solar inverters.

  • Real time power, current and voltage
  • Grid power information
  • Battery level
  • Temperature and inverter health
  • Daily/Total energy summaries

Usage

pip install solax

Then from within your project:

import solax
import asyncio

async def work():
    r = await solax.real_time_api('10.0.0.1')
    return await r.get_data()

loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
data = loop.run_until_complete(work())
print(data)

This will try all the inverter classes in turn until it finds the first one that works with your installation. You can see the list of inverter implementation classes in the entry points configured in setup.py.

If you want to bypass the inverter discovery code and use a specific inverter class, you can invoke discover specifying directly the class. In this example, the X1 Hybrid Gen4 implementation is used:

from importlib.metadata import entry_points
import solax
import asyncio

INVERTERS_ENTRY_POINTS = {
   ep.name: ep.load() for ep in entry_points(group="solax.inverter")
}

async def work():
    inverter = await solax.discover("10.0.0.1", 80, "xxxxx", inverters=[INVERTERS_ENTRY_POINTS.get("x1_hybrid_gen4")], return_when=asyncio.FIRST_COMPLETED)
    return await inverter.get_data()

loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
data = loop.run_until_complete(work())
print(data)

Confirmed Supported Inverters

These inverters have been tested and confirmed to be working. If your inverter is not listed below, this library may still work- please create an issue so we can add your inverter to the list 😊.

  • SK-TL5000E
  • X1 Hybrid Gen4

You can get the list of supported inverters by looking up the solax.inverter entry points:

for ep in entry_points(group="solax.inverter"):
    print(ep)

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

solax-3.1.1.tar.gz (29.3 kB view details)

Uploaded Source

Built Distribution

solax-3.1.1-py3-none-any.whl (28.0 kB view details)

Uploaded Python 3

File details

Details for the file solax-3.1.1.tar.gz.

File metadata

  • Download URL: solax-3.1.1.tar.gz
  • Upload date:
  • Size: 29.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for solax-3.1.1.tar.gz
Algorithm Hash digest
SHA256 3a0437db45010c28505cf14c7ae943c7c34a36f6a3af7f7db6ea009ac2048458
MD5 452af170df9602935d7c323ac4620c75
BLAKE2b-256 5eddae30e97aa0d19de807305b4db585fd5157d7eb26c3554ff9826fccc41f48

See more details on using hashes here.

File details

Details for the file solax-3.1.1-py3-none-any.whl.

File metadata

  • Download URL: solax-3.1.1-py3-none-any.whl
  • Upload date:
  • Size: 28.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for solax-3.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d2275b386b46a0147cf43710ce6eeefd3da292794fca85c45ea8c7872c77863d
MD5 7e49bfd5c037a87279589fb21962a6f6
BLAKE2b-256 3a43b5351fa2c3a9b00436d6bb2ee1cc3e32882abbb0f445784457855aad62c0

See more details on using hashes here.

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