MG / SAIC - Custom Integration

Hey, thanks for your work on this, much appreciated.
I’m new to the EV world and a beginner in HA so excuse the dumb questions ;).
I’m looking to try this out as it means I can give the wife access via HA which I can’t do via the iSmart app :frowning:
Before I leap in can you just confirm that the user changeable entities, such as “Charging Target SOC” are changeable within this integration?
I’m using Intelligent Octopus Go with a Zappi charger here and not yet ready to trust either 100% so need (want) to change that between 80 and 100% periodically.

Hi there,

Glad to be of help.

There are already some services implemented but changing Target SoC is not one of them. That’s something still missing to be done. You can check on the Target SOC, but not changing it.

I am trying to have that done in the upcoming days, whenever I get some time to do it and prepare a new release.

Just FYI, I got news from MG saying that they will be releasing a feature to share the vehicle with other accounts. I was told that in “some weeks” it would be on, but a month went by already, so some weeks may mean a lot of time.

Cheers

1 Like

Thanks for that. Great to know you have it on the to do list :+1:. I guess I can live with leaving it at 100% and control the level on the octopus app.
I won’t hold my breath waiting for MG to move forwards on this.

Cool job, i cant get it working properly, it has 38 entities and looks fine, but it only updates every 2 day or so, i even had it changing from 2200 to 0800, low amps, but no updates yet. What am I doing wrong? I have tried downloading it as instructed

Hi,

it seems that the API is quite often sending generic responses that are being discarded to not affect the sensors. That is happening to me as well.

I will have to take a look and see how can I address that. It also seems that some sensors are trying to constantly override the defined update interval, which I also need to look into and fix. Let me see if next week I get sometime to check on that.

Will keep you all posted.

Just installed this (quite challenging!)
Many of the states are OK.
But I’ve currently got the car charging and…

Charging Status: Not Charging
Charging current: 0A
Charging Voltage: 0 V
Charging Gun State: Unplugged

:thinking:

Hi,

It may change when the integration updates and receives new data. Also keep in mind that it is dependant on the API sending the right data, which sometimes does not happen.

Try to reload the integration, to force a refresh, and see if the status changes.

Cheers

Hi

I just released a new version of the integration:

@cliver this already includes the Set Target SOC service.

@Terkel this should address the issue with the update intervals.

Cheers

Buy Me A Coffee

1 Like

This looks great, anyway to set to Miles instead of KM?

Hi,

Thabks for the feedback.

That’s something on my to-do list. I wanted to try to sort something out before start messing with that.

I will try to get imperial units on a next release.

Cheers

Thanks, also would be nice to have the LV battery status like other integrations and perhaps if it can be logged in with the shared key owner so you don’t need to logout main account?

Hi,

There’s a battery level sensor already present. It shall be called sensor.brand_model_battery_voltage

See below:

Well, the accessories battery (12v) is automatically charged, yes, but when the vehicle is working or charging. If the vehicle is turned off, the 12v battery level can go very low and you may not be able to start the car. That’s why we need to limit the calls to the vehicle.

Cheers

Hello again download the new version, and tried to set up an automation, to charge car. I ran it and got

Im new to this, do i need to put in the VIN for my car ?
Where and how? Please.

Hi,

For that you have to use the VIN of the car on the service/action. Bear in mind that you may have more then one car on the same HA instance, so you need to specify the VIN.

Your automation “Action” should look something like this:

Hope it helps

Hi, everyone.

So I just released a new update to this integration. More info here:

What’s new

  • Revise service/actions mechanics to trigger data update after action calls.
  • Add new platforms to the integration
  • New Switch entities:
    • AC On/Off
    • Heated Seats
    • Charging Start/Stop
  • New Button entities
    • Open Tailgate
    • Start Front Defrost
    • Start Rear Window Heat
    • Tigger Alarm
  • New Lock entity
    • Lock entity for lock/unlock doors
  • New Climate entity
    • AC Control Climate entity
      • Temperature
      • Fan Speed
  • New Slider entity
    • Target SOC
  • Revise API methods to identify some vehicle info and show sensors/actions accordingly.
    (limited to some areas only, as API is not fully reliable on data provided)

Cheers

Buy Me A Coffee

Hi everyone,

Latest updates to the integration on release 0.4.4

WHAT’S NEW SINCE 0.4.1

0.4.4

  • Refactor setup to avoid generic responses from blocking integration startup
  • Revise Generic Response verification method
  • Revise Charging Gun State sensor mechanics for BEV and PHEV only.
  • Additional Debug Logging for Generic Responses

0.4.3

  • Revise Generic Response verification method to discard responses with SOC over 100%

0.4.2

  • Revise Vehicle Type mechanics. Avoid overriding user selection from configuration process
  • Revise SOC sensor data retrieval. Now main data will be obtained from Charging Data and fallback on Basis Status.
  • Revise sensors available for BEV, PHEV and HEV.
  • Refactor data updates on initial setup and update intervals
  • Refactor data calculations for Charging Current and Charging Voltage sensors
  • Add Charging Power (kW) sensor
  • Adjust climate entity issues. Actionable mode COOL/OFF only, correcting the raised error from HA.
  • New Actions and Switch entities:
    • Battery Heating
  • Revise translation files for Config Flow, since some labels were missing.
  • Adjust charging status messages from API.
  • Bump saic-ismart-client-ng to 0.5.2

Cheers

Buy Me A Coffee

I set this up yesterday with my MG4. The integration is installed and it connected to my car once when I added the integration but then it never updates. Any ideas? I have changed the update interval to see if that helps but still nothing. When I try any of the switches nothing works.

Hi @rt45433

It might be an issue of MG not sending valid data and only sending generic data, which is discarded.

Although, did you launch your phone App after doing the integration? If you did, the token gets revoked and the integration is not able to get any valid data afterwards. You need to reload it.

I logged out of the MG app on my phone prior to installing in HA and have not logged back since. I have also tried to reload and delete the integration and reinstall but it does the same thing. It shows the entities connected just once then that’s it’s but the whole time I have not been able to control any of the functions. I installed the integration a couple of months ago and it worked fine so maybe it’s since it’s been updated?

So it might be something with MG, probably. Check the logs (activate Debug logs, see here how to; Login failed · Issue #3 · ad-ha/mg-saic-ha · GitHub)

Sometimes MG fails to send valid data, and it might be the case. In my production instance I’m not having issues, aside from some regular generic responses, which sometimes go on for a couple of days.