MG / SAIC - Custom Integration

It seems to need some work. It would be great if you could get it operational :+1:

@Angus_M I don’t have the car yet so can’t answer that.
It would be great if you can give the PR a try and report back?

Ok lemme try that (although I’m a technical noob nowadays lol). Will report back what happens.

1 Like

hiyah - i need some help to understand what to do. Can you provide any guidance. I'm a GIT noob. I found the #174. Now what do I do?

@Angus_M , sure. So in theory, all you should need to do is:

  1. In HA, remove the MG integration from Services and Settings.
  2. Go to HACS
  3. Find MG in the list and remove the integration
  4. Then, click the 3 dots at top right
  5. Choose Custom Repositories
  6. Paste the following into the box: GitHub - ghislaingaillot/mg-saic-ha at fix/service-lifecycle-refreshes Ā· GitHub
  7. Select the type as Integration
  8. Search for MG SAIC.
  9. You will probably see 2 options for the integration
  10. Install the option from the alternative repository (the one that says 2months ago under Activity column)
  11. Reboot HA
  12. Try and add the integration

ok trying it now...

Can't authenticate. My account is based in Thailand and there is no option for that in the integration. I'd assumed it would be "Rest of World" but it still doesn't work. I tried all the other "Region" options also just in case, but none of them works for me. I am logged out of the mobile phone app.

Thanks for trying.

Just one thought, you aren’t trying to log in with the same account as you use on the mobile app are you?

Hi yes, I’m trying to use the same login credentials. Is it not correct? I did see posts indicating it’s possible to create an additional account but I didn’t do that.

That may be the issue. You need to setup and additional account to use only by Home Assistant.

I don’t know the full precise workflow (my new MG is due in a week to 2 weeks), however from previous car integrations the process has been similar -

  • sign out of the mobile app with the master account
  • Create a new HA account with different email address to your master account
  • Sign back in with master account
  • share account to newly created HA account
  • Sign back out of master account
  • Sign in with HA account
  • Accept any terms and conditions and accept the invite from master account
  • Ensure you can send commands to the car with the HA account
  • When you are happy it works, sign out of HA account and back in with master account
  • Sign into Home Assistant with the new HA account

I think this is only needed because it’s not possible to be logged into 2 accounts at the same time (eg. the app and the api/integration). I’d logged out of the app already so I don’t think it makes any difference in terms of authentication by the HA integration.

Of course it’s possible to be logged in to 2 accounts at the same time. Every other car manufacturer requires this as well otherwise it logs out your phone.
My current Mazda requires its own HA account otherwise it logs my phone app out.
My previous Mercedes did the same.
Even the GitHub repo, right near the top under Important Notes says:

  • Using this integration causes the MG/SAIC mobile app to shut down if the same account is used, as per API requirements.
  • To avoid issues, make sure to setup a Secondary Account on iSmart App.

And the final reason is if you have a partner/child etc that you share the car with - they need their own account to be able to control the car remotely

Got you PM and sent you a reply.

I will be more than happy to see this kept going and alive, so whoever wants to take over will be most welcome.

2 Likes

If it works then sure I’ll go through the bother of registering another account.

1 Like

I already stated above I was logged out of the mobile phone app so that wasn’t the issue. I don’t allow anyone else access so no need for another account on that basis. If we can get the integration working reliably and I need to be in the app at the same time then I’ll setup another account. Right now I can test with the mobile app closed no problem but the integration won’t even authenticate for me.

@Angus_M well I got my new car today (MGS6):

I have everything working in HA using the PR version of the code (I am waiting to take over the GitHub still and this gives me time to test out the PR).

Like I said before, log out of your iSmart account, create a new account with a different email address, approve the email that MG send you, sign back in to iSmart with your main account, add a secondary account using the previous step email (remembering to set no expiry date).
Then install the PR HACS update, reboot HA, add the integration and use your new secondary account email address and password:

2 Likes

Just an FYI for everyone, I have updated the integration to use the latest version of the API. There is also a beta release with a PR that was submitted recently. All available in HACS

Doesn't authenticate using my Thailand mobile number which works in the app. Note in Thailand they provide a specific MG app for the country. Not sure why. There is no "Thailand" option in the country list in the integration and the "Rest of the world" option also doesn't work. Is there a way to add Thailand for authentication?

If they provide a specific app then it must be different uri and maybe authentication. Strange.

I know India also isn’t working either. Seems like the underlying API is primarily working for Europe and Australia. I am still digging into the code base and underlying code base. But changes for India and Thailand would need to come through from the underlying api.

I have released new version of the integration and also yesterday published a new beta with some big changes. It is working well so far and I will probably prompt the beta to main over the weekend