MG Motor Mg5 Electric Car Integration

Yes, they are all the same settings as for the legacy version.

And it looks like that was the problem. I do not know how, but the MQTT broker password was changed in the legacy SAIC addon settings. Which would explain why it stopped working.

Thanks for pointing me in that direction. I’m back online:

I’m having problems with the Lock: Lock action for the Doors Lock being unreliable.

I first force a refresh.
Then I have a sensor which provides the time in seconds since the last vehicle state time.
I wait for this to drop below 10 secs.
And then carry out the Lock action.

Sometimes this works sometimes it doesn’t.
Anybody got any suggestions to make this reliable?
Thanks.

I’ve found this in the logs:

2025-05-17 14:06:34,612 [  INFO  ] Setting refresh mode to force due to MQTT direct set refresh mode command execution - vehicle
2025-05-17 14:06:35,479 [  INFO  ] Setting refresh mode to periodic due to restoring of previous refresh mode after a FORCE execution - vehicle
2025-05-17 14:06:42,301 [  INFO  ] Running job "Check for new messages (trigger: interval[0:01:00], next run at: 2025-05-17 14:07:42 BST)" (scheduled at 2025-05-17 14:06:42.299197+01:00) - apscheduler.executors.default
2025-05-17 14:06:42,440 [  INFO  ] Job "Check for new messages (trigger: interval[0:01:00], next run at: 2025-05-17 14:07:42 BST)" executed successfully - apscheduler.executors.default
2025-05-17 14:06:42,570 [ ERROR  ] return code: 4, message: The remote control instruction failed, please try again later. - handlers.vehicle
Traceback (most recent call last):
  File "/usr/src/app/handlers/vehicle.py", line 317, in handle_mqtt_command
    await self.saic_api.lock_vehicle(self.vin_info.vin)
  File "/usr/local/lib/python3.12/site-packages/saic_ismart_client_ng/api/vehicle/locks/__init__.py", line 13, in lock_vehicle
    return await self.control_vehicle_locks(vin, should_lock=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/saic_ismart_client_ng/api/vehicle/locks/__init__.py", line 45, in control_vehicle_locks
    return await self.send_vehicle_control_command(command, vin)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/saic_ismart_client_ng/api/vehicle/__init__.py", line 27, in send_vehicle_control_command
    return await self.execute_api_call_with_event_id(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/saic_ismart_client_ng/api/base.py", line 139, in execute_api_call_with_event_id
    return await execute_api_call_with_event_id_inner(event_id='0')
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 189, in async_wrapped
    return await copy(fn, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 111, in __call__
    do = await self.iter(retry_state=retry_state)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 153, in iter
    result = await action(retry_state)
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/tenacity/_utils.py", line 99, in inner
    return call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/tenacity/__init__.py", line 418, in exc_check
    raise retry_exc.reraise()
          ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/tenacity/__init__.py", line 185, in reraise
    raise self.last_attempt.result()
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 114, in __call__
    result = await fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/saic_ismart_client_ng/api/base.py", line 130, in execute_api_call_with_event_id_inner
    return await self.__execute_api_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/saic_ismart_client_ng/api/base.py", line 107, in __execute_api_call
    return await self.__deserialize(req, response, out_type, allow_null_body)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/saic_ismart_client_ng/api/base.py", line 200, in __deserialize
    raise se
  File "/usr/local/lib/python3.12/site-packages/saic_ismart_client_ng/api/base.py", line 174, in __deserialize
    raise SaicApiRetryException(
saic_ismart_client_ng.exceptions.SaicApiRetryException: return code: 4, message: The remote control instruction failed, please try again later., event_id: 1153753927

(Which is above my pay grade!)

Anyone know if it’s possible to add a second car with this integration?

(This might help someone with the same problem.)
Our car had been left stationary for 2 weeks while we were away on holiday.
On return I tried to check the car’s data with this integration and it failed.
I tried all kinds of resets and nothing worked.
So I installed the MG iSmart app on my phone and logged into the car.
Initially it reported some strange errors but eventually settled down.
I then restarted this integration and everything came back to life :slightly_smiling_face:

Hey there -

Did you ever resolve this? Having the exact same message here…

So, in 2025, what is the best home assistant card for our MG vehicle ? :slightly_smiling_face: