alphaess
This Python library uses the Alpha ESS Open API to retrieve data on your Alpha ESS inverter, photovoltaic panels, and battery if you have one. This library is principally intended for use by my Home Assistant integration [https://github.com/CharlesGillanders/homeassistant-alphaESS]
How to use
1. Sign up for an open API account
Register at https://open.alphaess.com/ for a (free) account to get your Developer ID (AppID) and Developer Secret (AppSecret).
Once registered, add your battery/inverter to the developer account via the web UI.
Note
To be good internet citizens, it is advised that your polling frequency for any AlphaCloud endpoints are 10 seconds at a minimum.
API documentation
The developer portal requires registration to read, so the documentation is mirrored here — transcribed from the portal and verified endpoint by endpoint against the live API:
- docs/API.md — all 19 endpoints. For each one: what you send, what comes back (with every field, its type and its unit), a real captured response, and the matching library method.
- docs/RETURN_CODES.md — the complete return code table (both pages of the portal's paginated list), grouped by cause, plus codes the portal does not publish.
Four things the official documentation gets wrong are corrected in docs/API.md.
Methods
There are public methods in this module that duplicate the AlphaESS OpenAPI and provide wrappers for all 19 documented endpoints:
All of the above are documented at https://open.alphaess.com/developmentManagement/apiList (Registration required)
Convenience methods
- getdata(get_power=False, get_ev=False, self_delay=0, get_timecharge=False) - Attempts to get statistical energy data for use in Home Assistant for all registered Alpha ESS systems - will return None if there are issues retrieving data from the Alpha ESS API.
- authenticate - Attempts to use https://openapi.alphaess.com/api/getEssList to validate authentication to the ALpha ESS API - will return True or False.
- setbatterycharge (serial, enabled, dp1start, dp1end, dp2start, dp2end, chargecutoffsoc) Parameters:
chargecutoffsoc(float) % to stop charging from the grid atenabled(bool) True to charge from the grid, False do notdp1start(datetime.time) The start time of charging period 1 (the minutes must be one of :00, :15, :30, :45)dp1end(datetime.time) The end time of charging period 1 (the minutes must be one of :00, :15, :30, :45)dp2start(datetime.time) The start time of charging period 2 (the minutes must be one of :00, :15, :30, :45)dp2end(datetime.time) The end time of charging period 2 (the minutes must be one of :00, :15, :30, :45)serial(str) The serial number of the battery/inverter.
- setTimeChargeBySn (sysSn, executeCycleType, chargeTimeList, dischargeTimeList, gridChargeCycle=None, ctrDisCycle=None)
The periodic (weekly) scheduling API. Unlike setbatterycharge/setbatterydischarge it supports up to six periods per day, per-weekday selection, and a power setpoint per period. Not every system is entitled to it — systems without the feature return code 6017 (No operation permissions).
Parameters:
sysSn(str) The serial number of the battery/inverter.executeCycleType(int) 0 - daily, 1 - weeklychargeTimeList/dischargeTimeList(list of dict) Each period is{"beginTime": "HH:mm", "endTime": "HH:mm", "chargeLimit": 10-100}, plus optionalweeks(a list of 1-7 for Monday-Sunday, required when weekly) andchargePower. Maximum 6 periods per day / 28 per week; charge and discharge periods must not overlap.gridChargeCycle(int) 0 - periodic charging disabled, 1 - enabledctrDisCycle(int) 0 - periodic discharging disabled, 1 - enabled
await client.setTimeChargeBySn(
serial, 1,
chargeTimeList=[{"beginTime": "01:00", "endTime": "05:00", "weeks": [1, 2, 3, 4, 5], "chargeLimit": 90}],
dischargeTimeList=[{"beginTime": "17:00", "endTime": "21:00", "weeks": [1, 2, 3, 4, 5], "chargeLimit": 20}],
gridChargeCycle=1, ctrDisCycle=1,
)
- setbatterydischarge (serial, enabled, dp1start, dp1end, dp2start, dp2end, dischargecutoffsoc) Parameters:
dischargecutoffsoc(float) % to stop discharging from the battery atenabled(bool) True to discharge from the battery, False do notdp1start(datetime.time) The start time of charging period 1 (the minutes must be one of :00, :15, :30, :45)dp1end(datetime.time) The end time of charging period 1 (the minutes must be one of :00, :15, :30, :45)dp2start(datetime.time) The start time of charging period 2 (the minutes must be one of :00, :15, :30, :45)dp2end(datetime.time) The end time of charging period 2 (the minutes must be one of :00, :15, :30, :45)serial(str) The serial number of the battery/inverter.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file alphaessopenapi-0.0.20.tar.gz.
File metadata
- Download URL: alphaessopenapi-0.0.20.tar.gz
- Upload date:
- Size: 13.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73d4c1c4270bb73a4ae68aed256d061c164105cf664b9faecbd35a28f1dd5c5c
|
|
| MD5 |
ee51edf136716da01cfe8f62ba3e067d
|
|
| BLAKE2b-256 |
ce4dbd208821056bdd07062e5faafd24c0561a917b5441f1d3a3294c39bc1bee
|
Provenance
The following attestation bundles were made for alphaessopenapi-0.0.20.tar.gz:
Publisher:
publish.yml on CharlesGillanders/alphaess-openAPI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
alphaessopenapi-0.0.20.tar.gz -
Subject digest:
73d4c1c4270bb73a4ae68aed256d061c164105cf664b9faecbd35a28f1dd5c5c - Sigstore transparency entry: 2383654100
- Sigstore integration time:
-
Permalink:
CharlesGillanders/alphaess-openAPI@418b3b40b0573556f41145d58d084827275773eb -
Branch / Tag:
refs/tags/0.0.20 - Owner: https://github.com/CharlesGillanders
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@418b3b40b0573556f41145d58d084827275773eb -
Trigger Event:
release
-
Statement type:
File details
Details for the file alphaessopenapi-0.0.20-py3-none-any.whl.
File metadata
- Download URL: alphaessopenapi-0.0.20-py3-none-any.whl
- Upload date:
- Size: 13.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24dd162b2ff10a01a7896e9da272be842151ebfc496f5bf01e7fdd8c14d9461b
|
|
| MD5 |
6f551be1d2e3833f287cfbd041db0ba0
|
|
| BLAKE2b-256 |
1683571577e9c21de9ab5d1525399500fddbc0cdec54f6fbfb6a2811896e81cd
|
Provenance
The following attestation bundles were made for alphaessopenapi-0.0.20-py3-none-any.whl:
Publisher:
publish.yml on CharlesGillanders/alphaess-openAPI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
alphaessopenapi-0.0.20-py3-none-any.whl -
Subject digest:
24dd162b2ff10a01a7896e9da272be842151ebfc496f5bf01e7fdd8c14d9461b - Sigstore transparency entry: 2383654574
- Sigstore integration time:
-
Permalink:
CharlesGillanders/alphaess-openAPI@418b3b40b0573556f41145d58d084827275773eb -
Branch / Tag:
refs/tags/0.0.20 - Owner: https://github.com/CharlesGillanders
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@418b3b40b0573556f41145d58d084827275773eb -
Trigger Event:
release
-
Statement type: