From bdb02c73544f288d60213c616f5ca785f5ee8667 Mon Sep 17 00:00:00 2001 From: ndrsnhs Date: Fri, 24 Oct 2025 12:56:56 +0200 Subject: [PATCH 1/2] add ip_address --- packages/modules/devices/alpha_ess/alpha_ess/device.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/modules/devices/alpha_ess/alpha_ess/device.py b/packages/modules/devices/alpha_ess/alpha_ess/device.py index 693a2edc12..01e32ef823 100644 --- a/packages/modules/devices/alpha_ess/alpha_ess/device.py +++ b/packages/modules/devices/alpha_ess/alpha_ess/device.py @@ -61,7 +61,7 @@ def initializer(): device_config.configuration.ip_address, device_config.configuration.port) def error_handler(): - run_command(f"{Path(__file__).resolve().parents[4]}/modules/common/restart_protoss_admin") + run_command((f"{Path(__file__).resolve().parents[4]}/modules/common/restart_protoss_admin 192.168.193.125")) return ConfigurableDevice( device_config=device_config, From 2b7b49a75055ff982281718aaad15acb73dab12f Mon Sep 17 00:00:00 2001 From: ndrsnhs Date: Mon, 27 Oct 2025 14:32:18 +0100 Subject: [PATCH 2/2] add proper restart for different modules --- packages/modules/devices/alpha_ess/alpha_ess/device.py | 7 ++++++- packages/modules/devices/growatt/growatt/device.py | 3 ++- packages/modules/devices/huawei/huawei/device.py | 7 ++++++- packages/modules/devices/huawei/huawei_emma/device.py | 3 ++- packages/modules/devices/openwb/openwb_bat_kit/device.py | 3 ++- packages/modules/devices/openwb/openwb_evu_kit/device.py | 3 ++- packages/modules/devices/openwb/openwb_flex/device.py | 3 ++- packages/modules/devices/openwb/openwb_pv_kit/device.py | 3 ++- 8 files changed, 24 insertions(+), 8 deletions(-) diff --git a/packages/modules/devices/alpha_ess/alpha_ess/device.py b/packages/modules/devices/alpha_ess/alpha_ess/device.py index 01e32ef823..e8d5f59dc0 100644 --- a/packages/modules/devices/alpha_ess/alpha_ess/device.py +++ b/packages/modules/devices/alpha_ess/alpha_ess/device.py @@ -61,7 +61,12 @@ def initializer(): device_config.configuration.ip_address, device_config.configuration.port) def error_handler(): - run_command((f"{Path(__file__).resolve().parents[4]}/modules/common/restart_protoss_admin 192.168.193.125")) + if device_config.configuration.source == 0: + run_command([f"{Path(__file__).resolve().parents[4]}/modules/common/restart_protoss_admin", + "192.168.193.125"]) + else: + run_command([f"{Path(__file__).resolve().parents[4]}/modules/common/restart_protoss_admin", + device_config.configuration.ip_address]) return ConfigurableDevice( device_config=device_config, diff --git a/packages/modules/devices/growatt/growatt/device.py b/packages/modules/devices/growatt/growatt/device.py index 139c168b4b..bcc91b8c9b 100644 --- a/packages/modules/devices/growatt/growatt/device.py +++ b/packages/modules/devices/growatt/growatt/device.py @@ -53,7 +53,8 @@ def initializer(): client = ModbusTcpClient_(device_config.configuration.ip_address, device_config.configuration.port) def error_handler(): - run_command(f"{Path(__file__).resolve().parents[4]}/modules/common/restart_protoss_admin") + run_command([f"{Path(__file__).resolve().parents[4]}/modules/common/restart_protoss_admin", + device_config.configuration.ip_address]) return ConfigurableDevice( device_config=device_config, diff --git a/packages/modules/devices/huawei/huawei/device.py b/packages/modules/devices/huawei/huawei/device.py index 7869c6c637..b8a9f68b27 100644 --- a/packages/modules/devices/huawei/huawei/device.py +++ b/packages/modules/devices/huawei/huawei/device.py @@ -63,7 +63,12 @@ def initializer(): device_config.configuration.port) def error_handler(): - run_command(f"{Path(__file__).resolve().parents[4]}/modules/common/restart_protoss_admin") + if HuaweiType(device_config.configuration.type) == HuaweiType.Huawei_Kit: + run_command([f"{Path(__file__).resolve().parents[4]}/modules/common/restart_protoss_admin", + "192.168.193.126"]) + else: + run_command([f"{Path(__file__).resolve().parents[4]}/modules/common/restart_protoss_admin", + device_config.configuration.ip_address]) return ConfigurableDevice( device_config=device_config, diff --git a/packages/modules/devices/huawei/huawei_emma/device.py b/packages/modules/devices/huawei/huawei_emma/device.py index 3ccd4e04b1..d31699e6db 100644 --- a/packages/modules/devices/huawei/huawei_emma/device.py +++ b/packages/modules/devices/huawei/huawei_emma/device.py @@ -54,7 +54,8 @@ def initializer(): device_config.configuration.port) def error_handler(): - run_command(f"{Path(__file__).resolve().parents[4]}/modules/common/restart_protoss_admin") + run_command([f"{Path(__file__).resolve().parents[4]}/modules/common/restart_protoss_admin", + device_config.configuration.ip_address]) return ConfigurableDevice( device_config=device_config, diff --git a/packages/modules/devices/openwb/openwb_bat_kit/device.py b/packages/modules/devices/openwb/openwb_bat_kit/device.py index f1cf0f1f4f..cebed73e88 100644 --- a/packages/modules/devices/openwb/openwb_bat_kit/device.py +++ b/packages/modules/devices/openwb/openwb_bat_kit/device.py @@ -32,7 +32,8 @@ def initializer(): client = modbus.ModbusTcpClient_("192.168.193.19", 8899) def error_handler(): - run_command(f"{Path(__file__).resolve().parents[4]}/modules/common/restart_protoss_admin") + run_command([f"{Path(__file__).resolve().parents[4]}/modules/common/restart_protoss_admin", + "192.168.193.19"]) return ConfigurableDevice( device_config=device_config, diff --git a/packages/modules/devices/openwb/openwb_evu_kit/device.py b/packages/modules/devices/openwb/openwb_evu_kit/device.py index 5e99c22d33..f975a0c801 100644 --- a/packages/modules/devices/openwb/openwb_evu_kit/device.py +++ b/packages/modules/devices/openwb/openwb_evu_kit/device.py @@ -43,7 +43,8 @@ def initializer(): client = modbus.ModbusTcpClient_("192.168.193.15", 8899) def error_handler(): - run_command(f"{Path(__file__).resolve().parents[4]}/modules/common/restart_protoss_admin") + run_command([f"{Path(__file__).resolve().parents[4]}/modules/common/restart_protoss_admin", + "192.168.193.15"]) return ConfigurableDevice( device_config=device_config, diff --git a/packages/modules/devices/openwb/openwb_flex/device.py b/packages/modules/devices/openwb/openwb_flex/device.py index 351b019a14..350a6dd0df 100644 --- a/packages/modules/devices/openwb/openwb_flex/device.py +++ b/packages/modules/devices/openwb/openwb_flex/device.py @@ -50,7 +50,8 @@ def initializer(): client = ModbusTcpClient_(device_config.configuration.ip_address, device_config.configuration.port) def error_handler(): - run_command(f"{Path(__file__).resolve().parents[4]}/modules/common/restart_protoss_admin") + run_command([f"{Path(__file__).resolve().parents[4]}/modules/common/restart_protoss_admin", + device_config.configuration.ip_address]) return ConfigurableDevice( device_config=device_config, diff --git a/packages/modules/devices/openwb/openwb_pv_kit/device.py b/packages/modules/devices/openwb/openwb_pv_kit/device.py index f2cd8cf71b..6562467134 100644 --- a/packages/modules/devices/openwb/openwb_pv_kit/device.py +++ b/packages/modules/devices/openwb/openwb_pv_kit/device.py @@ -32,7 +32,8 @@ def initializer(): client = modbus.ModbusTcpClient_("192.168.193.13", 8899) def error_handler(): - run_command(f"{Path(__file__).resolve().parents[4]}/modules/common/restart_protoss_admin") + run_command([f"{Path(__file__).resolve().parents[4]}/modules/common/restart_protoss_admin", + "192.168.193.13"]) return ConfigurableDevice( device_config=device_config,