MG / SAIC - Custom Integration

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.