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.2.1.tar.gz (31.3 kB view details)

Uploaded Source

Built Distribution

solax-3.2.1-py3-none-any.whl (30.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: solax-3.2.1.tar.gz
  • Upload date:
  • Size: 31.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for solax-3.2.1.tar.gz
Algorithm Hash digest
SHA256 79e00b23b1af85197c390692aafd48dbaacc6814f1176e30e1043351c9d5db2b
MD5 d2d0bb4369c153502b5a63f85010bf1b
BLAKE2b-256 c1f5c2c22a5f3a5d595bba811a286c1e2e5143630ca5eb1f3237bf5ff174aaab

See more details on using hashes here.

Provenance

The following attestation bundles were made for solax-3.2.1.tar.gz:

Publisher: publish.yml on squishykid/solax

Attestations:

File details

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

File metadata

  • Download URL: solax-3.2.1-py3-none-any.whl
  • Upload date:
  • Size: 30.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for solax-3.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aa8ed934eb60472efd9acd08053d3602b4179b4ee5032351709e3a3296d217c9
MD5 f1341b9675b861668b01aec1356ab4a7
BLAKE2b-256 f3af22eb47ac9acaed5be4aa3b35860e375f2ee838095e266d20f4645f7a772c

See more details on using hashes here.

Provenance

The following attestation bundles were made for solax-3.2.1-py3-none-any.whl:

Publisher: publish.yml on squishykid/solax

Attestations:

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