diff --git a/packages/modules/devices/alpha_ess/alpha_ess/device.py b/packages/modules/devices/alpha_ess/alpha_ess/device.py index 693a2edc12..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") + 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,