MG Motor Mg5 Electric Car Integration

I’ve just updated my separate container from old to latest with no issues and no adjustments needed. Appears to work as before at first glance.

Does anyone have a working MQTT climate configuration they would like to share?
I’ve gone around in circles trying to get this part working. When I attempt to turn the air on HA reports the HVAC_MODE “on” as not being valid.
I tried using power_command_topic instead of mode_command_topic without success too.
Here’s my configuration if someone has any tips. Thanks!

mqtt:
  climate:
    - name: mg4_climate_control
      mode_command_topic: "saic/[email protected]/vehicles/LSJxxx/climate/remoteClimateState/set"
      mode_state_topic: "saic/[email protected]/vehicles/LSJxxx/climate/remoteClimateState"
      mode_state_template: "{{ value }}"
      temperature_command_topic: "saic/[email protected]/vehicles/LSJxxx/climate/remoteTemperature/set"
      current_temperature_topic: "saic/[email protected]/vehicles/LSJxxx/climate/interiorTemperature"
      current_temperature_template: "{{ value }}"
      min_temp: 20
      max_temp: 28
      modes:
        - "on"
        - "off"

Seems overly complicated.

mqtt:
  switch:
    - name: "MG4 remote climate"
      unique_id: 1d200c71-7e7e-4afd-94d2-e38933731bcf
      command_topic: "saic/ADDRESS/vehicles/VIN/climate/remoteClimateState/set"
      payload_on: "on"
      payload_off: "off"
      state_topic: "saic/ADDRESS/vehicles/VIN/climate/remoteClimateState"
      state_on: "on"
      state_off: "off"

The gateway also does auto-discovery: I have a climate entity auto-created, currently playing the usual 87°C game:

Yes they stay the same, since they both set them up by VIN.
I’ve got both installed at the moment with the new one stopped and there’s no problem with that.

1 Like

Thanks. I deliberately wanted an MQTT climate entity rather than a switch entity so that the domain (climate) is correct. I couldn’t find any other way to change the domain type of an entity.
The other reason for not using the auto-created entities is so I can apply templates, limits and personalisations to the values.
Ironic you mention the 87°C game… it was one of the things I wanted to template out.

I ended up getting my MQTT climate: entry to work.
Not convinced it’s the best or most elegant way, but it achieved the exact result I was looking for.
Still need to refine the if/else statements to better handle unknown/other conditions, but at least the concept and commands are proven.

mqtt:
  climate:
    - name: mg4_climate_control
      current_temperature_topic: "saic/[email protected]/vehicles/LSJxxx/climate/interiorTemperature"
      current_temperature_template: "{{ '' if value == '87' else value }}"
      mode_command_topic: "saic/[email protected]/vehicles/LSJxxx/climate/remoteClimateState/set"
      mode_command_template: "{{ 'off' if value == 'off' else 'on' }}" 
      mode_state_topic: "saic/[email protected]/vehicles/LSJxxx/climate/remoteClimateState"
      mode_state_template: "{{ 'off' if value == 'off' else 'auto' }}" 
      temperature_command_topic: "saic/[email protected]/vehicles/LSJxxx/climate/remoteTemperature/set"
      temperature_command_template: "{{ value |int }}"
      min_temp: 20
      max_temp: 28
      initial: 24
      precision: 1.0
      modes:
        - "auto"
        - "off"

87° no longer gets logged in the history or status, it just returns ‘unknown’.

The new python updated version 5.x works great for me. But I have now seen af few times that I get the message from the iOS app that the user is locked in another place. I didn’t have that with the legacy api.
I used the mail in Home assistant and the phone number in the app. Perhaps now with the new API it’s a problem to use it both places despite of the mail / phone distinction.

Hi, I have integrated the vehicle according to the instructions of user bkluivingh. Thank you very much. Everything was successful.

But I have a problem that I can’t set the cabin heating temperature or the fan intensity, and moreover it shows 87°C??? It is only Off or Auto. How can I please set the cabin heating temperature? Thank you

All of this is normal. The 87°C is an MG glitch: the iSmart app will also show that, unless they’ve filtered it out in the latest versions. “Auto” is effectively the same as “On”, but the car will handle switching itself off after 10 mins or when up to temperature.

I don’t think you can adjust the target temperature that has been set in the car, but a) I could be wrong and b) it doesn’t really matter as you’re only using it to pre-heat / defrost.

Do you know why the vehicle heater cannot be switched on? Every time it turns off, see video…
https://youtu.be/jqRTVSK37EM

My working remote climate switch:

mqtt:
  switch:
    - name: "MG4 remote climate"
      unique_id: 1d200c71-7e7e-4afd-94d2-e38933731bcf
      command_topic: "saic/MY_EMAIL/vehicles/MY_VIN/climate/remoteClimateState/set"
      payload_on: "on"
      payload_off: "off"
      state_topic: "saic/MY_EMAIL//vehicles/MY_VIN/climate/remoteClimateState"
      state_on: "on"
      state_off: "off"

I’m sorry, I’m a beginner in this area. Where should I put your code? Thank you for your advice

If you don’t have any other MQTT entities defined in configuration.yaml, it can go straight in there. You’ll need to replace the MY_EMAIL and MY_VIN, and you can give it a different unique_id if you want.

I have added the MG iSmart login email and vehicle VIN. I restarted Home Assistant, but the new sensor also won’t turn on and shuts down just like the original one from the SAIC MQTT Gateway integration (Python)

It will do that, then will switch itself on again when it gets confirmation from the car that the climate is switched on. Are you being patient enough?

Does your remote climate work from the app?

It works via the MG Smart app. The integration doesn’t start, even though I wait. It’s a pity. I was hoping to install the integration, but unfortunately the commands don’t work.

hi, sorry for not responding sooner. I happen to see your question.
You need to enter your app login details

Can you please describe exactly what to insert and where to put it to make the cabin heater work? I’m a beginner so sorry for these questions. Thank you very much for your help.

I used a template from user PeatyPete
Peter, filled in my vehicle VIN and login email for the iSmart MG and pasted it into configuration.yaml

It is already showing the temperature setting, but when I turn on the A/C it doesn’t start and is still showing as OFF.

Why is it that by default only something works and the air conditioning doesn’t? For example, the seat heating is functional. And the heated steering wheel is nowhere to be found…
clima

As of this morning, most of the entities from the integration seem to have gone “full scale”, with only SoC, GoM and charge target being as I’d expect. Car is not charging, on fire or sitting on balloon tyres:

EDIT: MG iSmart app reports the same data, so it’s SAIC’s servers. Not sure where my car is though:

image

1 Like

Also guessing your not currently on an Antarctic expedition with those coordinates.

:rofl: :joy:

1 Like

Strange, My Marvel R does not have this issue you’re seeing. My values look regular just did a force update. Still good.
I’m on the new API using the EU url.