MG Motor Mg5 Electric Car Integration

All resolved now, back from the South Pole. Must have been a temporary glitch at their end.

I’m not sure about the heated seats or steering I’m afraid. My variant doesn’t have those features so I can’t test them.
I’m in Australia, so I have to use the “legacy” gateway. There might be some variance with the gateway for other regions. I haven’t experienced the strange glitches reported above like Troon did.

mileageOfTheDay workaround
I’m running the “legacy” MQTT Gateway version as I’m in AU and we haven’t moved to the new API yet.
On a few occasions now I’ve noticed the ‘mileageOfTheDay’ reset for no apparent reason.
Normally the value resets in the morning when we take our first journey of the day. That in itself is problematic - if your polling mode is ‘off’ and you don’t drive for a few days, your history stats will continue report the last known mileage of the day, which of course is incorrect.
Sharing my workaround for others that care about mileageOfTheDay (plus weekly and monthly figures too). This relies on ‘utility_meter’ sensors in HA and tracks against the odometer.
sensor.mg4_distance_total is my mqtt sensor linked to the saic/email@address/vehicles/VIN/drivetrain/mileage topic

utility_meter:
  mg4_u_distance_day:
    source: sensor.mg4_distance_total
    cycle: daily
  mg4_u_distance_week:
    source: sensor.mg4_distance_total
    cycle: weekly
  mg4_u_distance_month:
    source: sensor.mg4_distance_total
    cycle: monthly

Here’s an example from today - purple is my utility meter sensor, blue is the mqtt ‘mileageOfTheDay’ sensor.

2 Likes

This helped me get connected in no time. Thank you.

Is anyone successfully using the ABRP part of the integration ?

I have the abrp_user_token populated but am not seeing battery level updated in the app.

Yes, make sure you’ve got it in the correct format.

It’s got to look like VIN_NUMBER=ABRP_USER_TOKEN
eg: LSJW123456789123456789=98765432-1234-4321-77

1 Like

Thankyou !! I NEVER would have worked that out.

For anyone else interested, a user token can be generated in the ABRP app

For Android users:
Settings → Plan Settings
Select your car
Select Live Data
Under In-Car Live Data, swipe left
Press Link under Generic
Copy your user token and paste it in the correct format as described by Leon above into the box labelled abrp_user_token

abrp_api_key can be left blank

You will know it’s working when you see the blue battery icon next to your vehicle’s SOC on the planning screen

It can take a few minutes after starting your trip so be patient.

1 Like

Yeah, it’s an odd design. Took me a few goes trial and error to get it.

Hey, Could some one please explain to me what it is this ABRP setting. ?
What features / options do I get out of setting this up :slight_smile: ?

Thanks

It will update the SOC and hence efficiency in the app rather than it working on predetermined figures.

Sorry if I ask out of ignorance. When I am driving the SOC values is updated already. I think I am still missing the use case. :man_shrugging:

It’s updated already using a set value for efficiency and starting SOC.

This will use real world values from your driving.

Overall it will give you a more accurate range based on your driving style.

Now I got it. Thanks. :blush: Will play around with that.

1 Like

Basically, it will update ABRP with your cars live data. So it can better plan routes by already knowing the efficiency data and battery level.

It’s also a lot cleaner than using a dongle plugged into the car to do the same thing.

1 Like

I have this add-on set up.
It logs in and is clearly pulling information correctly so I must have the settings right.

The problem is, when I start the add-on, it logs me out of the app on my phone. A quick bit of googling and it seems that this is a limitation from MG. Even if you use the same account on 2 phones, only one can ever be logged in at once.

How are people using this if logging in on the phone logs out HA every time?

I don’t use the MG app, just the HA dashboard. It’s set up to do everything I need.

As above, I have a page in home assistant where I can do all the things I need to to with the car, saving me from having to log back in to the app.

If needed, I can allow or restrict access to this page to other HA users.

I’m awful at dashboard creation/design, has anybody created a HA dashboard for the MG cars they’d be willing to share ?

This is what I created, car is new lease, dashboard is still evolving. Also I’m trying to have same/similar as I have for my Polestar.

But, the info from the MG is not updating as I had hoped. I use some of the battery/charging info to control my EVSE. But the data is stale, the car was charging the moment I took this screenshot (the MG app does update).

1 Like

Hi Dave,
Is this still working for you since the API changes last year? Did you have any complications before it started working? For example, i have heard that a too complex password for the iSmart account could be an issue.
Cheers
Nick