MG / SAIC - Custom Integration

Hi,

It should work fine, as long as you do not have special characters.

Just to help troubleshooting…

  • Does it fails for both email and phone?
  • Are you selecting the correct sever?
  • Are you able to login at the same time on the app?
  • What do the logs for the integration say? You must be getting an error description on the logs.

Cheers

Both email and phone are failing, I did select the eu server (netherlands), app is working just fine now. Just checked the logging and it has the same error as the MQTT was saying.
Failed to authenticate or fetch vehicle data: return code: 403, message: {“code”:403,“message”:“Illegal AppSendDate!”}

found this post: MG iSMART issue (illegal AppSendDate, solved) | MG EVs electric cars community forum

so it seems my HA time is not correct… but when I check it seems fine

Thank you for the work you do on this integration :slight_smile:

I do have a question, is it possible to make a button that simply turns on the AC for preheating or cooling the car in the mornings? In essence duplicating the one that is in the MG app?

Ive managed to set most things up on my dash board, just cant seem to find a way to do this.

Many thanks
Andy

Hi,

Thanks for the comments.

Yes, I had that button before and replaced it with the climate entity. You can set cool or heat and the temperature.

For winter, you can just press the front defrost switch and it will heat the car to 22C.

Hope this helps.

Cheers

1 Like

That does the job perfectly thank you.

I have a slight issues this morning in that the integration is fialing to initialize… I notice that the mg app is failing to connect too so could be an MG thing… when you reload the integration does it try to make a connection and thats why it could be failing to initialize?

I think it was that as its just suddenly came back on :slight_smile:

Great. Glad it is working back again.

Anyhow, yes, if the app does not work, the integration will also do not work. This shares DE same API as the app, so…

1 Like

Exactly the same issue for me too. App works well, HA fails to authenticate.

Logger: custom_components.mg_saic
Source: custom_components/mg_saic/config_flow.py:228
integration: MG SAIC Integration (documentation, issues)
First occurred: 09:59:07 (1 occurrences)
Last logged: 09:59:07

Error fetching vehicle data: return code: 500, message: API call POST /oauth/token failed unexpectedly
Logger: custom_components.mg_saic
Source: custom_components/mg_saic/config_flow.py:101
integration: MG SAIC Integration (documentation, issues)
First occurred: 09:59:07 (1 occurrences)
Last logged: 09:59:07

Failed to authenticate or fetch vehicle data: return code: 500, message: API call POST /oauth/token failed unexpectedly

Hello, does this issue still exists ?
I have the same issue i think
I see in my log
2025-03-18 16:47:41,557 [ ERROR ] Could not login to the SAIC API due to an error - root

I see, service is unavailable right now

I’m just getting the same error

2025-03-31 12:41:36.746 DEBUG (MainThread) [custom_components.mg_saic] Logging in with base URL: https://gateway-mg-eu.soimt.com/api.app/v1/ for region: EU
2025-03-31 12:41:44.334 ERROR (MainThread) [custom_components.mg_saic] Failed to log in to MG SAIC API: return code: 500, message: API call POST /oauth/token failed unexpectedly
2025-03-31 12:41:44.334 ERROR (MainThread) [custom_components.mg_saic] Failed to set up MG SAIC integration: return code: 500, message: API call POST /oauth/token failed unexpectedly

and, if accessing SAIC’s gateway at https://gateway-mg-eu.soimt.com/api.app/v1/ I get:

{
code: 6,
message: "The service is not available,please try again later."
}

Since this has been working nicely until now, I suppose it’s going to be a temporary thing.

Update:
This has been solved without any further modification. I guess something was wrong on SAIC’s side. That said, accessing https://gateway-mg-eu.soimt.com/api.app/v1/ still returns the same error even though the logging is successful.

1 Like

I’m having a little bit of trouble with this and my MG ZS EV (2023). Specifically the climate control. I am able to set it to “cool” and the car will start cooling (this is pre-cooling while the car is off and locked), however the home assistant climate component never updates and reverts back to “off”. I can then not turn off climate control again to get the car to go back to idle.

If it matters I’m in Australia, and most of the other features do seem to work, though sometimes with a bit of delay.

Hi,

It seems like the issue is on the response from the car and API after deploying the AC. Can you share your logs with the activation and response from API afterwards?

The RemoteClimate response shall be either 2 or 3, for Fan or Cool, if the car replies a different value the integration will show as Off… so the best thing is to look into the Debug logs first.

Cheers

Hey

All new to both HA and this integration.
I’m getting this error “Failed to set up MG SAIC integration: return code: 500, message: API call POST /oauth/token failed unexpectedly”

I see others have had the same issue, but i don’t seam til find a clear solution.
Any recommendation?

Anything i can have forgotten?

Sorry I forgot to keep tabs on this forum, I’ll have to figure out how to get the debug logs and get back to you. I might just make it into a github issue.

Hi Everyone,

Just to give you all an heads-up in advance, in case someone wants to take over this project.

I will be replacing my MG Marvel in the upcoming weeks, so I will not be making any progress or developments on the integration. I am sorry for you all, but I will not have a way to test any changes and therefore it makes no sense to handle this.

If someone is interested in taking over, you are move than welcome to PM me and express your interest.

Cheers

It’s going to be way beyond my skills, but I just wanted to say thank you for all the efforts you put into this - it’s made my car and smart integrations so much more valuable to me (and my family!)

Hopefully someone is able to at least maintain the great work that has gone into this into the future…

Hey,

all new to this project, but thanks for the effort.
I don’t have the setup for DEV but i can test on our MG ZS EV so if I that can be my contribution, i’m here :slight_smile: