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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for solax-3.2.0.tar.gz
Algorithm Hash digest
SHA256 f3a3827256930303ddbc6a9858f4dd393c1c5416a276eb4972a145b151f200b5
MD5 b74f0c45c752954da4530f54e89c6bc1
BLAKE2b-256 2b3b96300b68e00d3382f4498af650a657be843e3802f0be80f2a6fbe67e8f69

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for solax-3.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 35d913cce9921f8abb96155dbf6e4238a2b23219b5d47713afc9bd15a4e80074
MD5 d0bd9d5621d1ae1dd2780fe55a715fd2
BLAKE2b-256 b99a92016e017f24c6ee062375dc5d9faf67b24b33755eee1041d73a66cd4fd1

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