Skip to content

Set Charging current failed on my MGS5 #467

Open

Description

@dagobertch

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

  1. townsmcp commented on Sep 26, 2026

    @townsmcp

    Try the https://github.com/townsmcp/mg-saic-ha integration. You can change the charge current with the integration

  2. nanomad commented on Oct 17, 2026

    @nanomad
    Contributor

    Thanks for the report. return code: 4, The remote control instruction failed is 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:

    1. Whether the SAIC app or the in-car infotainment can change the charge current limit on your car, and which values they offer.
    2. Whether the car was plugged in and awake (not in deep sleep) when you tried.
    3. The raw request and response. Set PUBLISH_RAW_API_DATA_ENABLED=true and try again. The messages are published under .../_internal/api/vehicle/charging/setting/request and .../response. Please remove your VIN and tokens before posting.
    4. The gateway log at LOG_LEVEL=DEBUG from 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.

  3. added
    help wanted
    on Oct 17, 2026
  4. nanomad commented on Nov 22, 2026

    @nanomad
    Contributor

    @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 try drivetrain/chargeCurrentLimit/set again on the beta build and report back.

    If it still fails, please send:

    1. The raw request and response. Set PUBLISH_RAW_API_DATA_ENABLED=true. They are published under .../_internal/api/vehicle/charging/setting/request and .../response. Remove your VIN and tokens first.
    2. The gateway log at LOG_LEVEL=DEBUG from the failing attempt.
    3. Whether the car was plugged in and awake.

    The MG app has no charge current setting for the S5. The car may not support this command at all.

  5. nanomad commented on Nov 22, 2026

    @nanomad
    Contributor

    @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.

    1. Set PUBLISH_RAW_API_DATA_ENABLED=true on the gateway and restart it. The gateway then publishes every raw SAIC request and response to MQTT.
    2. Subscribe to the raw data topics. Replace <prefix> with your MQTT topic prefix:
      mosquitto_sub -h <broker> -v -t '<prefix>/_internal/api/#'
      
      You can also use MQTT Explorer or the HA MQTT 'Listen to a topic' page with the same topic.
    3. Wait for the next poll, or wake the car. Find the message whose topic ends in /response and whose body contains bmsOnBdChrgTrgtSOCDspCmd. It is the charging management response, and the topic name contains charging.
    4. Post the value of bmsOnBdChrgTrgtSOCDspCmd. Missing, null and 0 all matter, so say which one you see.
    5. Try drivetrain/chargeCurrentLimit/set again. Post the messages ending in /vehicle/charging/setting/request and /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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions