Control Sigenergy battery via Sigen Cloud
Project description
sig-cloud-control
A Python library and CLI for controlling Sigenergy (Sigen Cloud) solar and battery systems.
[⚠️ CAUTION] Non-Affiliation
- Not Official: This project is not affiliated with, authorised by, or endorsed by Sigenergy. Use of this tool is at your own risk.
- Warranty Warning: Using this tool may violate your Sigenergy Terms of Service and could potentially void your hardware warranty. The author is not responsible for any loss of warranty or damage to equipment.
- Reverse Engineering: This tool was developed for the purpose of interoperability between Sigenergy batteries and third-party automation systems.
Compatibility
The following Sigen Cloud regional data centres are supported:
| Region | Value | API Base URL |
|---|---|---|
| Australia / New Zealand | aus |
api-aus.sigencloud.com |
| Asia-Pacific (rest) | apac |
api-apac.sigencloud.com |
| Europe | eu |
api-eu.sigencloud.com |
| China | cn |
api-cn.sigencloud.com |
| United States | us |
api-us.sigencloud.com |
Operations
charge: Force charge the battery from the grid for a specified duration.discharge: Force discharge the battery for a specified duration.hold: Hold the battery at its current state of charge for a specified duration.self-consumption: Enable self-consumption mode for a specified duration. The battery prioritises consuming solar generation.cancel: Immediately return the battery to its configured default mode (which may be self-consumption, VPP control, or another mode set by your installer).
self-consumptionvscancel: Useself-consumptionto explicitly activate solar-first behaviour for a set period. Usecancelto immediately hand control back to the battery's configured default, whatever that may be.
Installation
From PyPI (Recommended)
pip install sig-cloud-control
# or using uv
uv tool install sig-cloud-control
From Source (Development)
This project uses uv for dependency management.
# Clone the repository
git clone https://github.com/lawther/sig-cloud-control.git
cd sig-cloud-control
# Install dependencies
uv sync
Configuration
Interactive Setup (Recommended for local use)
sig-cloud-control setup
This prompts for your credentials, encrypts your password, and saves a config file to the platform default location:
- macOS/Linux:
~/.config/sig-cloud-control/config.toml - Windows:
%LOCALAPPDATA%\sig-cloud-control\sig-cloud-control\config.toml
Config File Discovery
When no --config flag is provided, the tool searches for a config file in this order:
./config.tomlin the current directory (for project-local use)- The platform default location above
Environment Variables (Recommended for Docker/CI)
Environment variables take precedence over the configuration file:
SIGEN_USERNAME: Your Sigen Cloud email address.SIGEN_PASSWORD_ENCODED: Your encrypted password (generate withsig-cloud-control setup).SIGEN_PASSWORD: Your plaintext password (convenient for CI secrets).SIGEN_STATION_ID: Your Station ID (optional).SIGEN_REGION: Your regional data centre (e.g.aus,eu,us). See Compatibility for all values.
Config File Format
username = "example@example.com"
# Use the encrypted password (generated by `sig-cloud-control setup`):
password_encoded = "..."
# OR use a plaintext password:
# password = "your_plaintext_password"
# region is required. Supported values: aus, apac, eu, cn, us
region = "aus"
# station_id is optional and will be fetched automatically if omitted.
# Find it in the Sigen app under Settings -> System Settings -> About.
# station_id = 12345
CLI Usage
# Setup credentials interactively (saves to platform default config location)
sig-cloud-control setup
# Charge battery for 60 minutes at 2.5 kW (charge rate limit)
sig-cloud-control charge 60 --power 2.5
# Discharge battery for 30 minutes at maximum rate
sig-cloud-control discharge 30
# Hold battery at current state of charge for 60 minutes
sig-cloud-control hold 60
# Enable self-consumption mode for 30 minutes
sig-cloud-control self-consumption 30
# Return battery to its default mode immediately
sig-cloud-control cancel
# Use a specific config file
sig-cloud-control charge 60 --config /path/to/config.toml
# Enable verbose logging for debugging
sig-cloud-control charge 60 --verbose
Options
| Option | Description |
|---|---|
--power |
Charge/discharge rate limit in kW (supported by charge and discharge only) |
--config |
Path to the TOML configuration file |
--verbose, -v |
Enable verbose debug logging to stderr |
API Usage
You can use sig-cloud-control as a library in your own asynchronous Python applications. The public API is exposed at the root level:
import asyncio
from sig_cloud_control import SigCloudClient, Config, Region
async def main():
config = Config(
username="user@example.com",
password="my_secret_password",
region=Region.AUS,
)
# Use as an async context manager — handles cleanup automatically
async with SigCloudClient(config) as client:
await client.login()
await client.charge_battery(duration_min=60, power_kw=5.0)
print("Charge command issued successfully.")
if __name__ == "__main__":
asyncio.run(main())
Token Cache
By default, SigCloudClient caches authentication tokens at the platform cache directory (e.g. ~/.cache/sig-cloud-control/token-cache.json on Linux). To disable caching, pass cache_path=None:
client = SigCloudClient(config, cache_path=None)
Error Handling
All errors are subclasses of SigCloudError. Import the specific types for finer-grained handling:
from sig_cloud_control import AuthenticationError, StationError, APIError, SigCloudError
async with SigCloudClient(config) as client:
try:
await client.login()
except AuthenticationError:
print("Bad credentials — check username/password.")
except StationError:
print("Could not resolve station ID.")
except APIError:
print("Unexpected API response.")
except SigCloudError:
print("Other Sigen Cloud error.")
| Exception | When raised |
|---|---|
AuthenticationError |
Login failed (bad credentials or token error) |
StationError |
Station ID could not be resolved or is unknown |
APIError |
Sigen API returned an unexpected or unparseable response |
SigCloudError |
Base class; also raised for pre-condition failures (e.g. invalid duration) |
Development
This project uses just to manage development tasks. The Justfile is the Single Source Of Truth (SSOT) for all pre-commit checks and development workflows. No additional linting or testing logic should be added anywhere else (e.g. CI configs).
Help
just
Running Pre-commit Checks (Lint + Test)
just precommit
Running Tests
just test
Linting and Formatting
just lint
License
Apache 2.0
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
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 sig_cloud_control-0.3.2.tar.gz.
File metadata
- Download URL: sig_cloud_control-0.3.2.tar.gz
- Upload date:
- Size: 59.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c795d55839a2972e04bb78b5dc4dabdaf988c537d4fb68c27cc71912b4e4e53
|
|
| MD5 |
c457f2d21e17abb6966da6326c94a99d
|
|
| BLAKE2b-256 |
6b7d49881f69ee7fb275113f4698d3450a55930208d8bfe3f1109c0eb6017831
|
Provenance
The following attestation bundles were made for sig_cloud_control-0.3.2.tar.gz:
Publisher:
release.yml on lawther/sig-cloud-control
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sig_cloud_control-0.3.2.tar.gz -
Subject digest:
5c795d55839a2972e04bb78b5dc4dabdaf988c537d4fb68c27cc71912b4e4e53 - Sigstore transparency entry: 1409719148
- Sigstore integration time:
-
Permalink:
lawther/sig-cloud-control@964ee15a5b6e2d66ea6803c6d812bac79c898ee8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/lawther
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@964ee15a5b6e2d66ea6803c6d812bac79c898ee8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file sig_cloud_control-0.3.2-py3-none-any.whl.
File metadata
- Download URL: sig_cloud_control-0.3.2-py3-none-any.whl
- Upload date:
- Size: 22.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85b56e8e916630698515ad3e0b6488109bb505e81ccb7dbcbb28bef18070bdd5
|
|
| MD5 |
e007b80f92be42f10a997215e779ad95
|
|
| BLAKE2b-256 |
16206487c600885532b069b9bb86a733c4401c316132db8802934712c1dab270
|
Provenance
The following attestation bundles were made for sig_cloud_control-0.3.2-py3-none-any.whl:
Publisher:
release.yml on lawther/sig-cloud-control
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sig_cloud_control-0.3.2-py3-none-any.whl -
Subject digest:
85b56e8e916630698515ad3e0b6488109bb505e81ccb7dbcbb28bef18070bdd5 - Sigstore transparency entry: 1409719163
- Sigstore integration time:
-
Permalink:
lawther/sig-cloud-control@964ee15a5b6e2d66ea6803c6d812bac79c898ee8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/lawther
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@964ee15a5b6e2d66ea6803c6d812bac79c898ee8 -
Trigger Event:
push
-
Statement type: