MG Motor Mg5 Electric Car Integration

Further update here.

Looking at peoples dashbaords it looks like im missing a lot of data?

  • Odometer readings?

Also how would i schedule my heating to come on in the morning - ive looked in automations and i cant see an option there?

Thanks
Andy

I don’t have a need for that so not tested it but I just created this quick automation using the UI automation editor as an example:

1 Like

Thanks i started with this yesterday then decided i would do a fresh install on the whole system haha.

Will get back to this today.

Thanks
Andy

It’s worth the effort, don’t give up :slight_smile:
I have examples of the MQTT topics (as I don’t use MQTT discovery) in this post: MG Motor Mg5 Electric Car Integration - #190 by PeatyPete

If you want to peek around at the topics, a tool like https://mqtt-explorer.com/ is a great way to connect to your MQTT server and explore the various topics.
It will give you a better understanding of what’s happening under the covers.

1 Like

Thanks Pete

So far so good it all seems to be working :slight_smile:

Im sure theres more ill want to do (and break) while im learning

thanks
Andy

Hi All,
Over just the last few days my entities have become unavailable and I see the following in the logs:

saic-mqtt-gateway  | 2024-11-30 21:30:07,630 [ ERROR  ] handle_vehicle loop failed during SAIC API call - __main__
saic-mqtt-gateway  | Traceback (most recent call last):
saic-mqtt-gateway  |   File "/usr/src/app/./mqtt_gateway.py", line 96, in handle_vehicle
saic-mqtt-gateway  |     vehicle_status = await self.update_vehicle_status()
saic-mqtt-gateway  |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
saic-mqtt-gateway  |   File "/usr/src/app/./mqtt_gateway.py", line 145, in update_vehicle_status
saic-mqtt-gateway  |     vehicle_status_response = await self.saic_api.get_vehicle_status(self.vin_info.vin)
saic-mqtt-gateway  |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
saic-mqtt-gateway  |   File "/usr/local/lib/python3.12/site-packages/saic_ismart_client_ng/api/vehicle/__init__.py", line 15, in get_vehicle_status
saic-mqtt-gateway  |     return await self.execute_api_call_with_event_id(
saic-mqtt-gateway  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
saic-mqtt-gateway  |   File "/usr/local/lib/python3.12/site-packages/saic_ismart_client_ng/api/base.py", line 124, in execute_api_call_with_event_id
saic-mqtt-gateway  |     return await execute_api_call_with_event_id_inner(event_id='0')
saic-mqtt-gateway  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
saic-mqtt-gateway  |   File "/usr/local/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 189, in async_wrapped
saic-mqtt-gateway  |     return await copy(fn, *args, **kwargs)
saic-mqtt-gateway  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
saic-mqtt-gateway  |   File "/usr/local/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 111, in __call__
saic-mqtt-gateway  |     do = await self.iter(retry_state=retry_state)
saic-mqtt-gateway  |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
saic-mqtt-gateway  |   File "/usr/local/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 153, in iter
saic-mqtt-gateway  |     result = await action(retry_state)
saic-mqtt-gateway  |              ^^^^^^^^^^^^^^^^^^^^^^^^^
saic-mqtt-gateway  |   File "/usr/local/lib/python3.12/site-packages/tenacity/_utils.py", line 99, in inner
saic-mqtt-gateway  |     return call(*args, **kwargs)
saic-mqtt-gateway  |            ^^^^^^^^^^^^^^^^^^^^^
saic-mqtt-gateway  |   File "/usr/local/lib/python3.12/site-packages/tenacity/__init__.py", line 418, in exc_check
saic-mqtt-gateway  |     raise retry_exc.reraise()
saic-mqtt-gateway  |           ^^^^^^^^^^^^^^^^^^^
saic-mqtt-gateway  |   File "/usr/local/lib/python3.12/site-packages/tenacity/__init__.py", line 185, in reraise
saic-mqtt-gateway  |     raise self.last_attempt.result()
saic-mqtt-gateway  |           ^^^^^^^^^^^^^^^^^^^^^^^^^^
saic-mqtt-gateway  |   File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 449, in result
saic-mqtt-gateway  |     return self.__get_result()
saic-mqtt-gateway  |            ^^^^^^^^^^^^^^^^^^^
saic-mqtt-gateway  |   File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
saic-mqtt-gateway  |     raise self._exception
saic-mqtt-gateway  |   File "/usr/local/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 114, in __call__
saic-mqtt-gateway  |     result = await fn(*args, **kwargs)
saic-mqtt-gateway  |              ^^^^^^^^^^^^^^^^^^^^^^^^^
saic-mqtt-gateway  |   File "/usr/local/lib/python3.12/site-packages/saic_ismart_client_ng/api/base.py", line 115, in execute_api_call_with_event_id_inner
saic-mqtt-gateway  |     return await self.execute_api_call(
saic-mqtt-gateway  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
saic-mqtt-gateway  |   File "/usr/local/lib/python3.12/site-packages/saic_ismart_client_ng/api/base.py", line 92, in execute_api_call
saic-mqtt-gateway  |     return await self.deserialize(req, response, out_type)
saic-mqtt-gateway  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
saic-mqtt-gateway  |   File "/usr/local/lib/python3.12/site-packages/saic_ismart_client_ng/api/base.py", line 185, in deserialize
saic-mqtt-gateway  |     raise se
saic-mqtt-gateway  |   File "/usr/local/lib/python3.12/site-packages/saic_ismart_client_ng/api/base.py", line 154, in deserialize
saic-mqtt-gateway  |     raise SaicApiRetryException(error_message, event_id=event_id, return_code=return_code)
saic-mqtt-gateway  | saic_ismart_client_ng.exceptions.SaicApiRetryException: return code: 4, message: The remote control instruction failed, please try again later., event_id: 375970862

Sometimes a restart seems to fix it, but not always, is anyone else seeing this?

I’ve seen similar errors in both the legacy as well as new versions of the add-in when my vehicle has no reception (eg is in an underground carpark).
Is your car in a location where it’s unlikely to have cellular service?

It should have had reception, but in any case, it seems to be working fine again now so I guess it was a transient thing!