Skip to content

Sigenergy cloud support#3963

Open
springfall2008 wants to merge 19 commits into
mainfrom
feat/sigenergy_cloud
Open

Sigenergy cloud support#3963
springfall2008 wants to merge 19 commits into
mainfrom
feat/sigenergy_cloud

Conversation

@springfall2008
Copy link
Copy Markdown
Owner

No description provided.

@springfall2008 springfall2008 marked this pull request as ready for review May 25, 2026 18:42
Copilot AI review requested due to automatic review settings May 25, 2026 18:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Sigenergy (Sigenstor) cloud integration to Predbat, including REST polling for telemetry, MQTT-based command/control, and a dedicated unit test suite, plus related configuration and component registration updates.

Changes:

  • Introduces SigenergyAPI component (REST + MQTT) and registers it in the component system.
  • Adds comprehensive Sigenergy integration tests and wires them into the custom unit test runner.
  • Extends web apps.yaml UI redaction rules to include PEM-based config keys.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
apps/predbat/web.py Expands the UI redaction filter to also hide _pem config fields.
apps/predbat/unit_test.py Registers Sigenergy test runner in the unit-test registry.
apps/predbat/tests/test_sigenergy.py New unit tests for Sigenergy REST, MQTT, controls, and helper logic.
apps/predbat/sigenergy.py New Sigenergy Cloud API component implementation (REST polling + MQTT commands + HA entity publishing).
apps/predbat/config.py Adds SIGCLOUD inverter type definition and Sigenergy-specific config keys.
apps/predbat/components.py Registers the new sigenergy component and maps apps.yaml config to component args.

Comment thread apps/predbat/web.py
Comment on lines +3381 to 3382
if ("_key" in arg) or ("_password" in arg) or ("_secret" in arg) or ("_pem" in arg):
value = '<span title = "{}"> (hidden)</span>'.format(value)
Comment on lines +353 to +358
"args": {
"system_id": {"required": True, "config": "sigenergy_system_id"},
"app_key": {"required": True, "config": "sigenergy_app_key"},
"app_secret": {"required": True, "config": "sigenergy_app_secret"},
"base_url": {"required": False, "config": "sigenergy_base_url", "default": "https://openapi-eu.sigencloud.com"},
"mqtt_host": {"required": False, "config": "sigenergy_mqtt_host"},
Comment thread apps/predbat/config.py
"has_charge_enable_time": True,
"has_discharge_enable_time": True,
"has_target_soc": True,
"has_reserve_soc": False,
Comment thread apps/predbat/config.py
"sigenergy_app_secret": {"type": "string", "empty": False},
"sigenergy_base_url": {"type": "string", "empty": False},
"sigenergy_mqtt_host": {"type": "string", "empty": False},
"sigenergy_system_id": {"type": "string", "empty": False},
Comment thread apps/predbat/sigenergy.py
SIGENERGY_CODE_STATION_NOT_FOUND = 1106
SIGENERGY_CODE_AIO_INVERTER_ONLY = 1107
SIGENERGY_CODE_STATION_INFO_NOT_FOUND = 1108
SIGENERGY_CODE_RPC_FAIL = 1109
Comment thread apps/predbat/sigenergy.py
Comment on lines +165 to +167
# Time options for schedule selects (HH:MM, one per minute)
_BASE_TIME = datetime.strptime("00:00", "%H:%M")
SIGENERGY_OPTIONS_TIME = [(_BASE_TIME + timedelta(seconds=m * 60)).strftime("%H:%M") for m in range(0, 24 * 60)]
Comment thread apps/predbat/sigenergy.py
"friendly_name": "Sigenergy {} PV Today".format(system_name),
"unit_of_measurement": "kWh",
"device_class": "energy",
"state_class": "total_increasing",
Comment thread apps/predbat/sigenergy.py
field_type = "number"
field_units = "%"

ha_name = "{}.{}_{}_{}".format(field_type, self.prefix, "sigenergy", item_name.replace("sigenergy_{}_".format(slug), slug + "_", 1))
Comment thread apps/predbat/sigenergy.py
Comment on lines +737 to +741
# Some implementations return an empty data field on success — treat None as success
# if the HTTP call didn't raise (the _request wrapper returns None for both API errors
# and non-zero code responses, but we can't distinguish here without more context).
self.log("SigenergyAPI: set_operating_mode({}) returned None — assuming success".format(mode_int))
return True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants