Repository navigation
Description
I tried to Set the charging current at my MGS5, but it failed:
Command drivetrain/chargeCurrentLimit/set failed: return code: 4, message: The remote control instruction failed, please try again later. - handlers.vehicle_command Traceback (most recent call last): File "/usr/src/app/handlers/vehicle_command.py", line 140, in __execute_mqtt_command_handler execution_result = await handler.handle(payload, retained=retained) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/app/handlers/command/base.py", line 188, in handle return await self.handle_typed_payload(converted_payload) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/app/handlers/command/drivetrain/drivetrain_chargecurrent_limit.py", line 39, in handle_typed_payload await self.saic_api.set_target_battery_soc( ...<3 lines>... ) File "/usr/src/app/.venv/lib/python3.14/site-packages/saic_ismart_client_ng/api/vehicle_charging/__init__.py", line 245, in set_target_battery_soc return await self.send_vehicle_charging_settings(vin, body) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/app/.venv/lib/python3.14/site-packages/saic_ismart_client_ng/api/vehicle_charging/__init__.py", line 220, in send_vehicle_charging_settings return await self.execute_api_call_with_event_id( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ "POST", "/vehicle/charging/setting", body=body, out_type=ChargingSettingResp ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/usr/src/app/.venv/lib/python3.14/site-packages/saic_ismart_client_ng/api/base.py", line 221, in execute_api_call_with_event_id result = await self.__execute_api_call_with_event_id( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...<7 lines>... ) ^ File "/usr/src/app/.venv/lib/python3.14/site-packages/saic_ismart_client_ng/api/base.py", line 284, in __execute_api_call_with_event_id return await execute_api_call_with_event_id_inner(event_id="0") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/app/.venv/lib/python3.14/site-packages/tenacity/asyncio/__init__.py", line 193, in async_wrapped return await copy(fn, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/app/.venv/lib/python3.14/site-packages/tenacity/asyncio/__init__.py", line 112, in __call__ do = await self.iter(retry_state=retry_state) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/app/.venv/lib/python3.14/site-packages/tenacity/asyncio/__init__.py", line 157, in iter result = await action(retry_state) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/app/.venv/lib/python3.14/site-packages/tenacity/_utils.py", line 111, in inner return call(*args, **kwargs) File "/usr/src/app/.venv/lib/python3.14/site-packages/tenacity/__init__.py", line 413, in exc_check raise retry_exc.reraise() ~~~~~~~~~~~~~~~~~^^ File "/usr/src/app/.venv/lib/python3.14/site-packages/tenacity/__init__.py", line 184, in reraise raise self.last_attempt.result() ~~~~~~~~~~~~~~~~~~~~~~~~^^ File "/usr/local/lib/python3.14/concurrent/futures/_base.py", line 443, in result return self.__get_result() ~~~~~~~~~~~~~~~~~^^ File "/usr/local/lib/python3.14/concurrent/futures/_base.py", line 395, in __get_result raise self._exception File "/usr/src/app/.venv/lib/python3.14/site-packages/tenacity/asyncio/__init__.py", line 116, in __call__ result = await fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/app/.venv/lib/python3.14/site-packages/saic_ismart_client_ng/api/base.py", line 275, in execute_api_call_with_event_id_inner return await self.__execute_api_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...<6 lines>... ) ^ File "/usr/src/app/.venv/lib/python3.14/site-packages/saic_ismart_client_ng/api/base.py", line 205, in __execute_api_call raise e File "/usr/src/app/.venv/lib/python3.14/site-packages/saic_ismart_client_ng/api/base.py", line 203, in __execute_api_call return await self.__deserialize(req, response, out_type, allow_null_body) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/app/.venv/lib/python3.14/site-packages/saic_ismart_client_ng/api/base.py", line 355, in __deserialize � raise se File "/usr/src/app/.venv/lib/python3.14/site-packages/saic_ismart_client_ng/api/base.py", line 330, in __deserialize raise SaicApiRetryException( ...<3 lines>... ) saic_ismart_client_ng.exceptions.SaicApiRetryException: return code: 4, message: The remote control instruction failed, please try again later., event_id: 1375137431
Any ideas? In the MG App there is no way to change the current, so maybe it is Not supported for the S5?
Activity
townsmcp commentedon Sep 26, 2026
Try the https://github.com/townsmcp/mg-saic-ha integration. You can change the charge current with the integration
nanomad commentedon Oct 17, 2026
Thanks for the report.
return code: 4, The remote control instruction failedis an error returned by the SAIC server. The gateway sent the request, and the server or the car refused it. That can depend on the model, and the MG S5 may handle this setting differently from the cars we have data for.To narrow it down, please send:
PUBLISH_RAW_API_DATA_ENABLED=trueand try again. The messages are published under.../_internal/api/vehicle/charging/setting/requestand.../response. Please remove your VIN and tokens before posting.LOG_LEVEL=DEBUGfrom the failing attempt.The request also sends a target SoC along with the current limit. If your S5 does not support target SoC, that value may be what the car rejects, but I can not confirm that without the raw data.
nanomad commentedon Nov 22, 2026
@dagobertch PR #537 may fix this. It stops the gateway from sending a target SoC when the car does not support one (LFP battery). We have not confirmed that your S5 falls into that group, or that the target SoC caused the error.
Can you tell us if the change fixes it? Once the PR is merged into
develop, please trydrivetrain/chargeCurrentLimit/setagain on the beta build and report back.If it still fails, please send:
PUBLISH_RAW_API_DATA_ENABLED=true. They are published under.../_internal/api/vehicle/charging/setting/requestand.../response. Remove your VIN and tokens first.LOG_LEVEL=DEBUGfrom the failing attempt.The MG app has no charge current setting for the S5. The car may not support this command at all.
nanomad commentedon Nov 22, 2026
@dagobertch To check if the target SoC is the cause, we need one value from the car's charge status. Here is how to get it.
PUBLISH_RAW_API_DATA_ENABLED=trueon the gateway and restart it. The gateway then publishes every raw SAIC request and response to MQTT.<prefix>with your MQTT topic prefix:/responseand whosebodycontainsbmsOnBdChrgTrgtSOCDspCmd. It is the charging management response, and the topic name containscharging.bmsOnBdChrgTrgtSOCDspCmd. Missing,nulland0all matter, so say which one you see.drivetrain/chargeCurrentLimit/setagain. Post the messages ending in/vehicle/charging/setting/requestand/vehicle/charging/setting/response.The gateway hides your VIN in these messages. Check the text for tokens or your account name before posting. Remove anything personal.