Sigen
Unofficial package for reading and writing data to and from Sigenergy inverters via cloud APIs.
Version 3.0.0 - Updated to support v3 app APIs for modes and smart loads.
Installation
pip install sigen
Usage
from sigen import Sigen
# username and password you use in the mySigen app.
# Region is Europe (eu) / Asia-Pacific (apac) /
# Middle East & Africa (eu) / Chinese Mainland (cn) / Unitest States (us)
sigen = Sigen(username="your_username", password="your_password", region="eu")
# Initialize the Sigen instance
await sigen.async_initialize()
# Read data
print(await sigen.fetch_station_info())
print(await sigen.get_energy_flow())
print(await sigen.get_operational_mode())
# Set default modes
print(await sigen.set_operational_mode_sigen_ai_mode())
print(await sigen.set_operational_mode_maximum_self_powered())
print(await sigen.set_operational_mode_tou())
print(await sigen.set_operational_mode_fully_fed_to_grid())
# Set custom modes (if available)
print(await sigen.set_operational_mode_summer_50kwh())
# Get and control smart loads
smart_loads = await sigen.get_smart_loads()
for load in smart_loads:
print(f"Smart Load: {load['name']} - Power: {load['valueWithUnit']}")
# Control smart loads (using path value)
print(await sigen.set_smart_load_state(1, 1)) # Turn on smart load with path 1
print(await sigen.set_smart_load_state(1, 0)) # Turn off smart load with path 1
# Or use convenient dynamic methods (generated from available smart loads)
print(await sigen.enable_smart_load_immersion()) # Turn on
print(await sigen.disable_smart_load_immersion()) # Turn off
Full example:
import logging
import os
import asyncio
from sigen import Sigen
logging.basicConfig(level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
async def main():
# Read username and password from environment variables
username = os.getenv('SIGEN_USERNAME')
password = os.getenv('SIGEN_PASSWORD')
if not username or not password:
logging.error("Environment variables SIGEN_USERNAME and SIGEN_PASSWORD must be set")
return
sigen = Sigen(username=username, password=password)
# Initialize the Sigen instance
await sigen.async_initialize()
# Fetch and log station info
logger.info("Fetching station info...")
station_info = await sigen.fetch_station_info()
logger.info("Station Info:")
logger.info(f"Station ID: {station_info['stationId']}")
logger.info(f"Has PV: {station_info['hasPv']}")
logger.info(f"Has EV: {station_info['hasEv']}")
logger.info(f"On Grid: {station_info['onGrid']}")
logger.info(f"PV Capacity: {station_info['pvCapacity']} kW")
logger.info(f"Battery Capacity: {station_info['batteryCapacity']} kWh")
# Fetch and log energy flow info
logger.info("\nFetching energy flow info...")
energy_flow = await sigen.get_energy_flow()
logger.info("Energy Flow Info:")
logger.info(f"PV Day Energy: {energy_flow['pvDayNrg']} kWh")
logger.info(f"PV Power: {energy_flow['pvPower']} kW")
logger.info(f"Buy/Sell Power: {energy_flow['buySellPower']} kW")
logger.info(f"EV Power: {energy_flow['evPower']} kW")
logger.info(f"AC Power: {energy_flow['acPower']} kW")
logger.info(f"Load Power: {energy_flow['loadPower']} kW")
logger.info(f"Battery Power: {energy_flow['batteryPower']} kW")
logger.info(f"Battery SOC: {energy_flow['batterySoc']}%")
# Fetch and log current operational mode
logger.info("\nFetching current operational mode...")
current_mode = await sigen.get_operational_mode()
logger.info(f"Current Operational Mode: {current_mode}")
# Change operational mode
# For default modes - using dynamic methods
# logger.info("\nSetting operational mode to 'Fully Fed to Grid'...")
# response = await sigen.set_operational_mode_fully_fed_to_grid()
# logger.info(f"Response: {response}")
# For default modes - using direct method
# logger.info("\nSetting operational mode to TOU (value=2)...")
# response = await sigen.set_operational_mode(2, -1) # -1 for default modes
# logger.info(f"Response: {response}")
# For custom modes - using dynamic methods
# logger.info("\nSetting operational mode to 'Summer 40kWh'...")
# response = await sigen.set_operational_mode_summer_40kwh()
# logger.info(f"Response: {response}")
# For custom modes - using direct method with profile ID
# logger.info("\nSetting operational mode to custom profile ID 4326...")
# response = await sigen.set_operational_mode(9, 4326) # 9 for custom modes with profile ID
# logger.info(f"Response: {response}")
# logger.info(f"Response: {response}")
# logger.info("\nFetching current operational mode...")
# current_mode = await sigen.get_operational_mode()
# logger.info(f"Current Operational Mode: {current_mode}")
if __name__ == "__main__":
asyncio.run(main())
Example output including the new features:
2025-06-25 18:25:16 INFO Fetching station info...
2025-06-25 18:25:16 INFO Station ID: 20240523012345
2025-06-25 18:25:16 INFO Has PV: True
2025-06-25 18:25:16 INFO Has EV: False
2025-06-25 18:25:16 INFO Has AC Charger: True
2025-06-25 18:25:16 INFO On Grid: True
2025-06-25 18:25:16 INFO PV Capacity: 10.3 kW
2025-06-25 18:25:16 INFO Battery Capacity: 8.06 kWh
2025-06-25 18:25:17 INFO Fetching all available operational modes...
2025-06-25 18:25:17 INFO Default Working Modes:
2025-06-25 18:25:17 INFO - Sigen AI Mode (value: 1)
2025-06-25 18:25:17 INFO - Maximum Self-Powered (value: 0)
2025-06-25 18:25:17 INFO - TOU (value: 2)
2025-06-25 18:25:17 INFO - Fully Fed to Grid (value: 5)
2025-06-25 18:25:17 INFO - Remote EMS Mode (value: 7)
2025-06-25 18:25:17 INFO Custom Energy Profile Items:
2025-06-25 18:25:17 INFO - Summer 50kWh (profileId: 3126, value: 9)
2025-06-25 18:25:17 INFO - Storm Ready (profileId: 3939, value: 9)
2025-06-25 18:25:17 INFO - Summer 40kWh (profileId: 4326, value: 9)
2025-06-25 18:25:17 INFO - Summer 30kWh (profileId: 4328, value: 9)
2025-06-25 18:25:17 INFO Current Operational Mode: TOU
2025-06-25 18:25:19 INFO --------- Smart Loads Functionality ---------
2025-06-25 18:25:19 INFO Fetching smart loads...
2025-06-25 18:25:19 INFO Found 1 smart loads:
2025-06-25 18:25:19 INFO - Name: Immersion
2025-06-25 18:25:19 INFO Path: 1
2025-06-25 18:25:19 INFO Power: 0.00 kW
2025-06-25 18:25:19 INFO Current state: ON
2025-06-25 18:25:19 INFO Enable method: sigen.enable_smart_load_immersion()
2025-06-25 18:25:19 INFO Disable method: sigen.disable_smart_load_immersion()
Metadata
Release files for sigen 3.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sigen-3.0.3.tar.gz | 13.3 kB | Without provenance | Details for sigen-3.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sigen-3.0.3-py3-none-any.whl | Python 3 | none | any | Details for sigen-3.0.3-py3-none-any.whl |
Total release size: 24.4 kB
Release files / sigen-3.0.3.tar.gz
| Download URL | sigen-3.0.3.tar.gz |
|---|---|
| Size | 13.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b746127a0681f2b1997706cd9ccbeb1c43ebd9453b54af5b0626ed0d80774851
|
|
BLAKE2b-256 checksum How to use checksums |
37dd692f5cef4a828181fb884a970e4efcd2ecd1073c502380cb1a9f7f0bd83d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / sigen-3.0.3-py3-none-any.whl
| Download URL | sigen-3.0.3-py3-none-any.whl |
|---|---|
| Size | 11.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f614fd89a94679509bb0bca285214088fbccaf19eb803135e70b2b3c0fda23fd
|
|
BLAKE2b-256 checksum How to use checksums |
02bbd60e27ca80997bc9362be0e7f5e40c1fa87edf391da3020f64e069750e59
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Security for sigen 3.0.3
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.