https://github.com/squishykid/solax
🌞 Solax Inverter API Wrapper
https://github.com/squishykid/solax
home-automation iot photovoltaic raspberry-pi solar solax
Last synced: about 2 months ago
JSON representation
🌞 Solax Inverter API Wrapper
- Host: GitHub
- URL: https://github.com/squishykid/solax
- Owner: squishykid
- License: mit
- Created: 2019-04-09T04:14:24.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2025-02-26T11:05:12.000Z (4 months ago)
- Last Synced: 2025-05-11T22:04:47.256Z (about 2 months ago)
- Topics: home-automation, iot, photovoltaic, raspberry-pi, solar, solax
- Language: Python
- Homepage:
- Size: 228 KB
- Stars: 115
- Watchers: 13
- Forks: 66
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- open-sustainable-technology - solax - Read energy usage data from the real-time API on Solax solar inverters. (Renewable Energy / Photovoltaics and Solar Energy)
README
# Solax
[](https://github.com/squishykid/solax/actions)
[](https://pypi.org/project/solax)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 asyncioasync 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](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 asyncioINVERTERS_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 Gen4You 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)
```