Skip to main content

aiosaj

PyPI Python tests License: MIT

Async Python library to read live data from SAJ solar inverters, over either their Ethernet (LAN) interface or their WiFi module. It was written for Home Assistant but works in any asyncio application.

aiosaj continues the work of fredericvl/pysaj.

Installation

pip install aiosaj

Requires Python 3.9 or newer.

Usage

import asyncio

from aiosaj import SAJ, Sensors


async def main():
    # WiFi module: wifi=True, with the module's web login (admin/admin by default).
    # Ethernet: SAJ("192.168.1.100") - no login needed.
    saj = SAJ("192.168.1.100", wifi=True, username="admin", password="admin")
    sensors = Sensors(wifi=True)

    if await saj.read(sensors):
        for sensor in sensors:
            if sensor.enabled:
                print(sensor.name, sensor.value, sensor.unit)
    else:
        print("Inverter not reachable (it switches off when there is no sunlight)")


asyncio.run(main())
  • read() returns True when new values were read, and False when the inverter cannot be reached. SAJ inverters run on solar power, so this is normal at night.
  • sensors["total_yield"] looks up a single sensor by name.
  • sensor.enabled is True for every sensor your inverter actually reports. Sensors for channels your inverter does not have, such as a third PV string, stay disabled.
  • saj.serialnumber holds the inverter's serial number after the first read, if the inverter's firmware provides it.

Use Sensors(wifi=True) together with SAJ(..., wifi=True), and Sensors() with an Ethernet connection.

Sensors

Both interfaces

Sensor Unit Description
current_power W Power being delivered right now
today_yield kWh Energy produced today
total_yield kWh Energy produced over the inverter's lifetime
today_time h Hours in operation today
total_time h Hours in operation over the inverter's lifetime
total_co2_reduced kg Lifetime CO₂ saving, as calculated by the inverter
temperature °C Inverter temperature
state Run state: Normal, Waiting, Not connected, Error or Upgrading

Ethernet only

Sensor Unit Description
today_max_current W Highest power output reached today

WiFi only

Sensor Unit Description
pv1_voltage, pv2_voltage, pv3_voltage V Voltage of each PV input
pv1_current, pv2_current, pv3_current A Current of each PV input
pv1_string1_current … pv3_string4_current A Current of each string on each PV input
grid_frequency Hz Grid frequency
line1_voltage, line2_voltage, line3_voltage V Grid voltage per phase
line1_current, line2_current, line3_current A Grid current per phase
bus_voltage V Internal DC bus voltage

Older WiFi module firmware only reports the sensors that both interfaces have.

How values behave

  • Values are only updated while the inverter's state is Normal. While it is starting up, waiting or in error, live values such as power and voltage become None, and the energy and time counters keep their last value.
  • total_yield, total_time and total_co2_reduced never go down, and today_yield and today_time only go back to zero when a new day starts. This keeps energy statistics, such as Home Assistant's Energy dashboard, free of false spikes.
  • A reading that is out of range or clearly wrong is skipped, and the sensor keeps its previous value.

Credits

aiosaj builds on pysaj by @fredericvl, which was in turn based on the pysma library by @kellerza.

License

MIT, see LICENSE.

Metadata

Release files for aiosaj 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aiosaj 0.2.2
File Size Uploaded Provenance
aiosaj-0.2.2.tar.gz 21.3 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for aiosaj 0.2.2
File Interpreter ABI Platform
aiosaj-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 34.2 kB

Release files / aiosaj-0.2.2.tar.gz

Download URL aiosaj-0.2.2.tar.gz
Size 21.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1dc034ac76d6d0311ccfb91ce8c647bc95f3573cf248e1dd55c19ede5e688abf
BLAKE2b-256 checksum
How to use checksums
c08967586c8efdd616124ba40fdf5d91f1f3dbad9e8a0d2479ac6697a6d0c3b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / aiosaj-0.2.2-py3-none-any.whl

Download URL aiosaj-0.2.2-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1eec76423dfb5111487848bf1bd6fffca433fdf334504faa3d7f2783b65107b5
BLAKE2b-256 checksum
How to use checksums
aadcb233704a64931d99420d9b94fa6b54e78aa2631627e268d7c6e92a93f03c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Security for aiosaj 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aiosaj-0.2.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page