MG / SAIC - Custom Integration

Hello,

logo

BuyMeCoffee

I just published a new integration for MG / SAIC vehicles.

See details here:

This integration has been developed from scratch incorporating async methods, UI configuration and adding API sensors. This should also be multi-vehicle compatible, since you may add as many vehicles as linked to your MG/SAIC account.

Here is a sample of data obtained from a MG Marvel R:

Bear in mind that by using this Custom Integration your mobile phone app will logout. By the moment, seems impossible to have more that one device connected to the SAIC API. Also, if you login on the mobile phone, the integration will stop working, will be disconnected and will not retrieve any updated data.

The login procedure to the API has been implemented based on the work already done in this repo: GitHub - SAIC-iSmart-API/saic-python-client-ng. Special thanks to their developers and contributors.

You can comment here on any questions or doubts. For technical issues and improvements, please post on Github.

Cheers

2 Likes

Reserved space for updates

SENSORS AVAILABLE

The MG/SAIC Custom Integration provides the following sensors and binary sensors:

SENSORS

General

  • Brand
  • Model
  • Model Year
  • Mileage
  • Fuel Level
  • Fuel Range
  • EV SOC
  • Electric Range
  • Battery Voltage
  • HVAC Status
  • Interior Temperature
  • Exterior Temperature

Tyre Pressure

  • Front Left Tyre Pressure
  • Front Right Tyre Pressure
  • Rear Left Tyre Pressure
  • Rear Right Tyre Pressure

Charging Data

  • Charging Status
  • Charging Voltage
  • Charging Current
  • Charging Power
  • Estimated Range After Charging
  • Charging Target SOC
  • Charging Duration
  • Remaining Charging Time
  • Added Electric Range
  • Power Usage Since Last Charge
  • Mileage Since Last Charge

BINARY SENSORS

Doors

  • Driver Door
  • Passenger Door
  • Rear Left Door
  • Rear Right Door
  • Bonnet Status
  • Boot Status

Windows

  • Driver Window
  • Passenger Window
  • Rear Left Window
  • Rear Right Window
  • Sun Roof Status

Others

  • Lock Status
  • Charging Gun Status

ACTIONS

  • Lock Vehicle
  • Unlock Vehicle
  • Start AC
  • Stop AC
  • Set Target SOC
  • Open Tailgate
  • Tigger Find My Car Alarm
  • Start Charging (sometimes this service fails)
  • Stop Charging
  • Defrost Rear Window
  • Defrost Windshield
  • Control Heated Seats

SWITCHES

  • AC On/Off
  • Heated Seats
  • Charging Start/Stop

BUTTONS

  • Open Tailgate
  • Start Front Defrost
  • Start Rear Window Heat
  • Tigger Alarm

LOCK

  • Lock entity for lock/unlock doors

CLIMATE

  • AC Control Climate entity
    • Temperature
    • Fan Speed

SLIDERS

  • Target SOC

Version History

0.4.1

  • 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)

0.3.0

  • Refactor usage of DataCoordinator to address issues with Update Intervals. Hopefully closes #10
  • Refactor code to address issues with No entity id specified
  • Refactor State of Charge sensor to try to retrieve data from ChargingData if StatusData is not available. Hope it closes #8
  • Add new Set Target SOC service.
  • Revise Debug logs generation to avoid duplicated entries

0.2.1

  • Revised vehicle type identification mechanics and conditions
  • Added new step to config_flow to allow users to select the correct vehicle type if the integration fails to do so based on API data
  • Added configuration options to the integration to manually change the update intervals.
  • Revised translations

0.2.0

  • Revised mechanics for connection with API and data retrieval
  • Services testing and adjusting to API requirements
  • Renamed and revised sensor data and info
  • Revise units for sensors and adapting all sensors to SensorDeviceClass from Home Assistant
  • Revise Unique ID generation for all sensors
  • Revise Login method to avoid blocking calls during startup
  • Improve detection and discard of “Generic Responses” during API setup and updates
  • Improve vehicle type detection on integration setup.

0.1.0

  • Refactor code to work with data coordinator
  • Revised mechanics for connection with API and data retrieval
  • Update saic-python-client-ng requirements to version 0.2.3
  • Added new sensors for charging data
  • Renamed and revised sensor data and info
  • Revise config_flow to allow login with phone and email
  • Initial implementation of services (some services still not available, but are implemented as a proof of concept). Feedback on this will be helpful
  • Change update interval to 5 minutes once charging is detected
  • Refactor API responses and values as needed. Charging sensors only display data if Charging is Active, otherwise 0 will be displayed
  • Fuel Level, Fuel Range, EV State of Charge and Electric Range are vehicle dependent. Add logic to determine the vehicle type and show sensors accordingly.

0.0.2

  • Revised mechanics for connection with API
  • Added new sensors (Brand, Model and MY)
  • Rename sensors based on Brand and Model
  • Rename sensors to have them grouped by type (windows, doors, tyres…)
  • Revise config_flow (login with phone still not working and unavailable)
  • Initial trialing for charging details

0.0.1

  • Initial release

Thank you all

Thanks for creating this!
I’ve got an MG 3 Hybrid+ (Self-Charging Hybrid, not a plug-in) and while the integration successfully found it and added it, I have 0 entities available within it?
In the App I have all the standard stuff. Fuel Tank, Range, HVAC, Lock/Unlock.
Is there any way I can help to get this up and running? I’d love to have this all integrated into HA.

Thanks.

Hi @LDShadowLord,

Thanks for trying it out and for the feedback. I have a Marvel R and I am getting the data for the vehicle, but maybe the data set is not the same.

My suggestion is that you add the following to configuration.yaml:

logger:
  default: warning
  logs:
    custom_components.mg_saic: debug

Restart HA and check the logs to see the response from the server. Send me that log and I will try to work it out.

It should look something like this:

DEBUG (MainThread) [custom_components.mg_saic] Vehicle Status: VehicleStatusResp(basicVehicleStatus=BasicVehicleStatus(batteryVoltage=125, bonnetStatus=0, bootStatus=0, canBusActive=1, clstrDspdFuelLvlSgmt=0, currentJourneyId=3531, currentJourneyDistance=30, dippedBeamStatus=0, driverDoor=0, driverWindow=0, engineStatus=0, extendedData1=65, extendedData2=0, exteriorTemperature=26, frontLeftSeatHeatLevel=0, frontLeftTyrePressure=69, frontRightSeatHeatLevel=0, frontRightTyrePressure=73, fuelLevelPrc=0, fuelRange=2420, fuelRangeElec=2420, handBrake=0, interiorTemperature=27, lastKeySeen=23YYY, lockStatus=1, mainBeamStatus=0, mileage=347300, passengerDoor=0, passengerWindow=0, powerMode=0, rearLeftDoor=0, rearLeftTyrePressure=66, rearLeftWindow=0, rearRightDoor=0, rearRightTyrePressure=74, rearRightWindow=0, remoteClimateStatus=0, rmtHtdRrWndSt=0, sideLightStatus=0, steeringHeatLevel=None, steeringWheelHeatFailureReason=None, sunroofStatus=0, timeOfLastCANBUSActivity=None, vehElecRngDsp=0, vehicleAlarmStatus=2, wheelTyreMonitorStatus=0), extendedVehicleStatus=ExtendedVehicleStatus(alertDataSum=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), gpsPosition=GpsPosition(gpsStatus=2, timeStamp=1722784825, wayPoint=GpsPosition.WayPoint(hdop=14, heading=0, position=GpsPosition.WayPoint.Position(altitude=737, latitude=40XXXXXX, longitude=-3XXXXXX), satellites=4, speed=0)), statusTime=1722784825)

On the new version that I am working we will have new sensors, like Brand, Model and getting that added to the sensors’ name. I’ve also renamed some sensors and got them sorted in a different way.

I’m still trying to figure out the charging side (status and info), although that doesn’t concern you, considering that you have a HEV.

Cheers

Adding to the above, these are the sensors that I currently have working on the new version:

Hoping to be able to release it soon. Just trying to sort out the login with phone issues and check if I am able to get the charging details added.

Whenever I get more logs for different types of vehicles (BEV/PHEV/HEV) I can sort some sensors to be shown or hidden depending on the type of vehicle and response from the server. As I can only check on a BEV right now, everything is being shown even if not applicable (like fuel level and fuel range).

Of course! This is what my logs look like:

{'basicVehicleStatus': BasicVehicleStatus(
	batteryVoltage=124, 
	bonnetStatus=0, 
	bootStatus=0, 
	canBusActive=1, 
	clstrDspdFuelLvlSgmt=7, 
	currentJourneyId=243, 
	currentJourneyDistance=170, 
	dippedBeamStatus=0, 
	driverDoor=0, 
	driverWindow=0, 
	engineStatus=0, 
	extendedData1=77, 
	extendedData2=None, 
	exteriorTemperature=-128, 
	frontLeftSeatHeatLevel=0, 
	frontLeftTyrePressure=70, 
	frontRightSeatHeatLevel=0, 
	frontRightTyrePressure=60, 
	fuelLevelPrc=76, 
	fuelRange=6430, 
	fuelRangeElec=None, 
	handBrake=1, 
	interiorTemperature=26, 
	lastKeySeen=0, 
	lockStatus=1, 
	mainBeamStatus=0, 
	mileage=21670, 
	passengerDoor=0, 
	passengerWindow=0, 
	powerMode=0, 
	rearLeftDoor=0, 
	rearLeftTyrePressure=69, 
	rearLeftWindow=0, 
	rearRightDoor=0, 
	rearRightTyrePressure=71, 
	rearRightWindow=0, 
	remoteClimateStatus=0, 
	rmtHtdRrWndSt=0, 
	sideLightStatus=0, 
	steeringHeatLevel=None, 
	steeringWheelHeatFailureReason=None, 
	sunroofStatus=1, 
	timeOfLastCANBUSActivity=None, 
	vehElecRngDsp=0, 
	vehicleAlarmStatus=2, 
	wheelTyreMonitorStatus=0), 
'extendedVehicleStatus': ExtendedVehicleStatus(
	alertDataSum=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), 
	'gpsPosition': GpsPosition(
		gpsStatus=2, 
		timeStamp=1722877788, 
		wayPoint=GpsPosition.WayPoint(
			hdop=7, 
			heading=0, 
			position=GpsPosition.WayPoint.Position(
				altitude=168, 
				latitude=5100000, 
				longitude=-3400000), 
			satellites=8, 
			speed=0)), 
'statusTime': 1722877788}

I’ve formatted it to read (More for my own benefit, as I wanted to see what was available.)

Every time I reload the integration I get a different number of entities, which is quite funny. I think it’s because the app/API is so unreliable that it trying to get everything is constantly failing. After another restart, my logs have dozens of “Error connecting to MG SAIC API: No entity id specified for entity MG SAIC .”

May be worth some fairly comprehensive error handling? Put everything in it, at least as null, and let it update as it grabs it.

But I am seeing some details coming through, it’s looking great!

EDIT: I’m super curious to know if the “EV Percentage” is actually reporting the state of the battery in the car (1.82Kwh) or if it’s just reporting a slightly different variation of the fuel percentage.

I also just noticed that it says that my Sun roof is open. My car doesn’t have a Sun Roof.

Thanks a lot @LDShadowLord

This is great and will be really helpful. I’ve already solved some of the issues that you are encountering now, so maybe what I will do is to get the new version on Github and you may get the updated version. The logs will also include a vehicle info log. From there, I will also be able to know which sensors should apply to your car (or mine as well, since there should be differences, i.e. if on vehicle info it says that there’s no sunroof, we may get rid of the sensor for your case and leave it active when sunroof is present).

On this version you may also find some errors, I expect, but should be a little bit better than the initial release.

In the meanwhile, I will work with the logs that you’ve sent me.

Cheers

New version release: 0.0.2

@LDShadowLord, if you may share afterwards you debug log with this new version, please let me know.

Looking into the log you sent above, seems like some sensors are returning some “generic” responses, like the exteriorTemperature=-128. I’ve already added some mechanics to discard those kind of responses and leave only logic responses (at least the ones I found).

I’ve updated it, and this is the log it’s popping out:

Vehicle Info: [VinInfo(bindTime=1717321709000, brandName='MG', colorName='FLARE RED', isActivate=False, isCurrentVehicle=True, isSubaccount=False, modelName='MG3', modelYear='2023', name=None, series='ZP22 UK', vin='LSJXXXXXXXXXXXXXXX', subAccountList=[], vehicleModelConfiguration=[VehicleModelConfiguration(itemCode='J17', itemName='Tire', itemValue='1'), VehicleModelConfiguration(itemCode='Q00', itemName='Airbag', itemValue='1'), VehicleModelConfiguration(itemCode='Q01', itemName='FAirbag', itemValue='1'), VehicleModelConfiguration(itemCode='Q09', itemName='AirbagS', itemValue='1'), VehicleModelConfiguration(itemCode='S35', itemName='Sunroof', itemValue='0'), VehicleModelConfiguration(itemCode='S61', itemName='Remote control', itemValue='1'), VehicleModelConfiguration(itemCode='T11', itemName='AC', itemValue='1'), VehicleModelConfiguration(itemCode='EPS', itemName='EPS', itemValue='1'), VehicleModelConfiguration(itemCode='SA64', itemName='SA64', itemValue='0111110000000000001000000100101000000010100000000000000000000110'), VehicleModelConfiguration(itemCode='BONNUT', itemName='BONNUT', itemValue='0'), VehicleModelConfiguration(itemCode='DOOR', itemName='DOOR', itemValue='1111'), VehicleModelConfiguration(itemCode='BOOT', itemName='BOOT', itemValue='1'), VehicleModelConfiguration(itemCode='ENGINE', itemName='ENGINE', itemValue='1'), VehicleModelConfiguration(itemCode='EV', itemName='EV', itemValue='0'), VehicleModelConfiguration(itemCode='HeatedSeat', itemName='HeatedSeat', itemValue='2'), VehicleModelConfiguration(itemCode='KEYPOS', itemName='KEYPOS', itemValue='1'), VehicleModelConfiguration(itemCode='ENERGY', itemName='ENERGY', itemValue='1'), VehicleModelConfiguration(itemCode='BATTERY', itemName='BATTERY', itemValue='1'), VehicleModelConfiguration(itemCode='INTEMP', itemName='INTEMP', itemValue='1'), VehicleModelConfiguration(itemCode='EXTEMP', itemName='EXTEMP', itemValue='0'), VehicleModelConfiguration(itemCode='WINDOW', itemName='WINDOW', itemValue='1000'), VehicleModelConfiguration(itemCode='LRD', itemName='LRD', itemValue='1'), VehicleModelConfiguration(itemCode='BTKEY', itemName='BTKEY', itemValue='0'), VehicleModelConfiguration(itemCode='BType', itemName='Battery', itemValue='0'), VehicleModelConfiguration(itemCode='SBH', itemName='SBH', itemValue='0'), VehicleModelConfiguration(itemCode='BHI', itemName='BHI', itemValue='0'), VehicleModelConfiguration(itemCode='ROV', itemName='ROV', itemValue='25857')])]

The model year is wrong, I have a 2024.
Additionally, i’ve had to pause the integration, because i’m getting low battery warnings on the car because the systems are getting hammered. I think the constant polling is keeping the 12V system awake and it’s just chomping through the battery.
Also, because the API takes so long to respond, on first startup it kept HASS from fully starting up for several minutes while it tried to wait for a response.

Thanks a lot, I will have a look into it and check.

There are some configuration elements that report wrongly. Mine, for example, as sunroof but the configuration returns it as if it was not present, but that’s an issue on MG/SAIC end, not the API itself.

About the update interval, I’ve it configured to update every 120 minutes, but seems like al binary_sensors (doors, windows and so on), by their type, try to update more often. I will check a way to force the update intervals to be matched on those.

I noticed that on my test system, but as I’m not fully running it the whole time, did not face the 12v draining issue. Let me see if, somehow, I can handle it.

I’ve already addressed part of that yesterday night on the night-build. Although, for me, on my testing, it takes no longer than 20 to 30 seconds.

Cheers,

Hi all,

After some days of going back and forth with the API and the whole code, I believe that I am able to bring a new version of this integration.

The issues with Charging Data, Config Flow in UI and Update Intervals are sorted and solved. All data is now managed directly from the Data Coordinator and the updates shall be managed from a single point. At least, from my testing, seems like it, so any feedback will be appreciated.

You may now test this new version, either installing it from scratch or updating from HACS.

More info here on this release:

It is highly recommendable that, after upgrading to version 0.1.0, if you have a previous installation, you remove the integration and add it again
This will be helpful to avoid duplicated sensors, since most of them have a new Unique ID on HA.

Below is a sample of the sensors implemented so far:


You can comment here on any questions or doubts. For technical issues and improvements, please post on Github.

BuyMeCoffee

Thank you all

Hi!,

I’ve tested your Integration as a custom_component.
I have a ZS EV Luxury Long Range Mk2. Most things work right away, some strangeness however, as can be expected.

Some sensitive data replaced with xxx

cat  /data/homeassistant/home-assistant.log | grep mg_saic
2024-09-04 15:34:51.771 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration mg_saic which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-09-04 15:35:34.478 DEBUG (MainThread) [custom_components.mg_saic] Logging in with region-based endpoint for region: EU
2024-09-04 15:35:35.911 DEBUG (MainThread) [custom_components.mg_saic] Login successful, initializing vehicle APIs.
2024-09-04 15:35:49.714 DEBUG (MainThread) [custom_components.mg_saic] Fetched data successfully
2024-09-04 15:35:49.715 DEBUG (MainThread) [custom_components.mg_saic] Vehicle Type: BEV
2024-09-04 15:35:49.715 DEBUG (MainThread) [custom_components.mg_saic] Vehicle Info: [VinInfo(bindTime=xxx, brandName='MG', colorName='BLACK PEARL', isActivate=False, isCurrentVehicle=True, isSubaccount=False, modelName='ZS EV', modelYear='2021', name=None, series='ZS EV S', vin='xxx', subAccountList=[], vehicleModelConfiguration=[VehicleModelConfiguration(itemCode='J17', itemName='Tire', itemValue='1'), VehicleModelConfiguration(itemCode='Q00', itemName='Airbag', itemValue='1'), VehicleModelConfiguration(itemCode='Q01', itemName='FAirbag', itemValue='0'), VehicleModelConfiguration(itemCode='Q09', itemName='AirbagS', itemValue='0'), VehicleModelConfiguration(itemCode='S35', itemName='Sunroof', itemValue='3'), VehicleModelConfiguration(itemCode='S61', itemName='Remote control', itemValue='1'), VehicleModelConfiguration(itemCode='T11', itemName='AC', itemValue='1'), VehicleModelConfiguration(itemCode='EPS', itemName='EPS', itemValue='1'), VehicleModelConfiguration(itemCode='SA64', itemName='SA64', itemValue='0111110000000000001000000100101000000010100000000000000000000110'), VehicleModelConfiguration(itemCode='BONNUT', itemName='BONNUT', itemValue='1'), VehicleModelConfiguration(itemCode='DOOR', itemName='DOOR', itemValue='1111'), VehicleModelConfiguration(itemCode='BOOT', itemName='BOOT', itemValue='1'), VehicleModelConfiguration(itemCode='ENGINE', itemName='ENGINE', itemValue='1'), VehicleModelConfiguration(itemCode='EV', itemName='EV', itemValue='0'), VehicleModelConfiguration(itemCode='HeatedSeat', itemName='HeatedSeat', itemValue='0'), VehicleModelConfiguration(itemCode='KEYPOS', itemName='KEYPOS', itemValue='1'), VehicleModelConfiguration(itemCode='ENERGY', itemName='ENERGY', itemValue='1'), VehicleModelConfiguration(itemCode='BATTERY', itemName='BATTERY', itemValue='1'), VehicleModelConfiguration(itemCode='INTEMP', itemName='INTEMP', itemValue='1'), VehicleModelConfiguration(itemCode='EXTEMP', itemName='EXTEMP', itemValue='1'), VehicleModelConfiguration(itemCode='WINDOW', itemName='WINDOW', itemValue='0000'), VehicleModelConfiguration(itemCode='LRD', itemName='LRD', itemValue='0'), VehicleModelConfiguration(itemCode='BTKEY', itemName='BTKEY', itemValue='1'), VehicleModelConfiguration(itemCode='BType', itemName='Battery', itemValue='1'), VehicleModelConfiguration(itemCode='SBH', itemName='SBH', itemValue='1'), VehicleModelConfiguration(itemCode='BHI', itemName='BHI', itemValue='0'), VehicleModelConfiguration(itemCode='ROV', itemName='ROV', itemValue='25857')])]
2024-09-04 15:35:49.716 DEBUG (MainThread) [custom_components.mg_saic] Vehicle Status: VehicleStatusResp(basicVehicleStatus=BasicVehicleStatus(batteryVoltage=133, bonnetStatus=0, bootStatus=0, canBusActive=1, clstrDspdFuelLvlSgmt=0, currentJourneyId=2430, currentJourneyDistance=30, dippedBeamStatus=0, driverDoor=0, driverWindow=0, engineStatus=0, extendedData1=60, extendedData2=0, exteriorTemperature=22, frontLeftSeatHeatLevel=0, frontLeftTyrePressure=70, frontRightSeatHeatLevel=0, frontRightTyrePressure=69, fuelLevelPrc=0, fuelRange=0, fuelRangeElec=0, handBrake=0, interiorTemperature=-128, lastKeySeen=23907, lockStatus=1, mainBeamStatus=0, mileage=206180, passengerDoor=0, passengerWindow=0, powerMode=0, rearLeftDoor=0, rearLeftTyrePressure=68, rearLeftWindow=0, rearRightDoor=0, rearRightTyrePressure=68, rearRightWindow=0, remoteClimateStatus=0, rmtHtdRrWndSt=0, sideLightStatus=0, steeringHeatLevel=None, steeringWheelHeatFailureReason=None, sunroofStatus=1, timeOfLastCANBUSActivity=None, vehElecRngDsp=0, vehicleAlarmStatus=2, wheelTyreMonitorStatus=0), extendedVehicleStatus=ExtendedVehicleStatus(alertDataSum=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), gpsPosition=GpsPosition(gpsStatus=2, timeStamp=1725456939, wayPoint=GpsPosition.WayPoint(hdop=6, heading=0, position=GpsPosition.WayPoint.Position(altitude=-7, latitude=xxx, longitude=xxx), satellites=10, speed=0)), statusTime=1725456939)
2024-09-04 15:35:49.725 DEBUG (MainThread) [custom_components.mg_saic] Vehicle Charging Data: ChrgMgmtDataResp(chrgMgmtData=ChrgMgmtData(bmsAdpPubChrgSttnDspCmd=2, bmsAltngChrgCrntDspCmd=0, bmsChrgCtrlDspCmd=2, bmsChrgOtptCrntReq=1023, bmsChrgOtptCrntReqV=None, bmsChrgSpRsn=0, bmsChrgSts=0, bmsDsChrgSpRsn=None, bmsEstdElecRng=453, bmsOnBdChrgTrgtSOCDspCmd=7, bmsPackCrnt=20000, bmsPackCrntV=None, bmsPackSOCDsp=604, bmsPackVol=1460, bmsPTCHeatReqDspCmd=0, bmsPTCHeatResp=None, bmsPTCHeatSpRsn=0, bmsReserCtrlDspCmd=2, bmsReserSpHourDspCmd=6, bmsReserSpMintueDspCmd=0, bmsReserStHourDspCmd=22, bmsReserStMintueDspCmd=0, ccuEleccLckCtrlDspCmd=None, ccuOffBdChrgrPlugOn=None, ccuOnbdChrgrPlugOn=None, chrgngAddedElecRng=None, chrgngAddedElecRngV=None, chrgngDoorOpenCnd=None, chrgngDoorPosSts=None, chrgngRmnngTime=1023, chrgngRmnngTimeV=1, chrgngSpdngTime=None, chrgngSpdngTimeV=None, clstrElecRngToEPT=260, disChrgngRmnngTime=None, disChrgngRmnngTimeV=None, imcuChrgngEstdElecRng=None, imcuChrgngEstdElecRngV=None, imcuDschrgngEstdElecRng=None, imcuDschrgngEstdElecRngV=None, imcuVehElecRng=None, imcuVehElecRngV=None, onBdChrgrAltrCrntInptCrnt=None, onBdChrgrAltrCrntInptVol=None), rvsChargeStatus=RvsChargeStatus(chargingDuration=0, chargingElectricityPhase=None, chargingGunState=0, chargingPileID=None, chargingPileSupplier=None, chargingType=1, endTime=1725434536, extendedData1=None, extendedData2=None, extendedData3=None, extendedData4=None, fotaLowestVoltage=None, fuelRangeElec=2600, lastChargeEndingPower=560, mileage=206180, mileageOfDay=780, mileageSinceLastCharge=780, powerUsageOfDay=431, powerUsageSinceLastCharge=123, realtimePower=438, startTime=0, staticEnergyConsumption=None, totalBatteryCapacity=725, workingCurrent=20000, workingVoltage=1460))
2024-09-04 15:35:49.734 DEBUG (MainThread) [custom_components.mg_saic] Finished fetching MG SAIC data update coordinator data in 13.822 seconds (success: True)
2024-09-04 15:35:49.880 ERROR (MainThread) [custom_components.mg_saic] Error updating sensor Battery Voltage: No entity id specified for entity MG ZS EV Battery Voltage
2024-09-04 15:35:49.883 ERROR (MainThread) [custom_components.mg_saic] Error updating sensor Interior Temperature: No entity id specified for entity MG ZS EV Interior Temperature
2024-09-04 15:35:49.885 ERROR (MainThread) [custom_components.mg_saic] Error updating sensor Exterior Temperature: No entity id specified for entity MG ZS EV Exterior Temperature
2024-09-04 15:35:49.889 ERROR (MainThread) [custom_components.mg_saic] Error updating sensor Tyre Pressure Front Left: No entity id specified for entity MG ZS EV Tyre Pressure Front Left
2024-09-04 15:35:49.892 ERROR (MainThread) [custom_components.mg_saic] Error updating sensor Tyre Pressure Front Right: No entity id specified for entity MG ZS EV Tyre Pressure Front Right
2024-09-04 15:35:49.894 ERROR (MainThread) [custom_components.mg_saic] Error updating sensor Tyre Pressure Rear Left: No entity id specified for entity MG ZS EV Tyre Pressure Rear Left
2024-09-04 15:35:49.897 ERROR (MainThread) [custom_components.mg_saic] Error updating sensor Tyre Pressure Rear Right: No entity id specified for entity MG ZS EV Tyre Pressure Rear Right
2024-09-04 15:35:49.901 ERROR (MainThread) [custom_components.mg_saic] Error updating sensor Mileage: No entity id specified for entity MG ZS EV Mileage
2024-09-04 15:35:49.903 ERROR (MainThread) [custom_components.mg_saic] Error updating vehicle detail sensor Model Year: No entity id specified for entity MG ZS EV Model Year
2024-09-04 15:35:49.906 ERROR (MainThread) [custom_components.mg_saic] Error updating vehicle detail sensor Brand: No entity id specified for entity MG ZS EV Brand
2024-09-04 15:35:49.908 ERROR (MainThread) [custom_components.mg_saic] Error updating vehicle detail sensor Model: No entity id specified for entity MG ZS EV Model
2024-09-04 15:35:49.912 ERROR (MainThread) [custom_components.mg_saic] Error updating sensor Electric Range: No entity id specified for entity MG ZS EV Electric Range
2024-09-04 15:35:49.915 ERROR (MainThread) [custom_components.mg_saic] Error updating sensor State of Charge: No entity id specified for entity MG ZS EV State of Charge
2024-09-04 15:35:49.920 WARNING (MainThread) [custom_components.mg_saic] Field bmsPackVol returned None in charging data.
2024-09-04 15:35:49.922 ERROR (MainThread) [custom_components.mg_saic] Error updating charging sensor Charging Voltage: No entity id specified for entity MG ZS EV Charging Voltage
2024-09-04 15:35:49.925 WARNING (MainThread) [custom_components.mg_saic] Field bmsPackCrnt returned None in charging data.
2024-09-04 15:35:49.926 ERROR (MainThread) [custom_components.mg_saic] Error updating charging sensor Charging Current: No entity id specified for entity MG ZS EV Charging Current
2024-09-04 15:35:49.929 ERROR (MainThread) [custom_components.mg_saic] Error updating charging sensor Charging Power: No entity id specified for entity MG ZS EV Charging Power
2024-09-04 15:35:49.931 ERROR (MainThread) [custom_components.mg_saic] Error updating charging sensor Estimated Range After Charging: No entity id specified for entity MG ZS EV Estimated Range After Charging
2024-09-04 15:35:49.935 WARNING (MainThread) [custom_components.mg_saic] Field bmsChrgOtptCrntReq returned None in charging data.
2024-09-04 15:35:49.936 ERROR (MainThread) [custom_components.mg_saic] Error updating charging sensor Charging Current Limit: No entity id specified for entity MG ZS EV Charging Current Limit
2024-09-04 15:35:49.939 ERROR (MainThread) [custom_components.mg_saic] Error updating charging sensor Charging Target SOC: No entity id specified for entity MG ZS EV Charging Target SOC
2024-09-04 15:35:49.941 ERROR (MainThread) [custom_components.mg_saic] Error updating charging sensor Charging Duration: No entity id specified for entity MG ZS EV Charging Duration
2024-09-04 15:35:49.943 WARNING (MainThread) [custom_components.mg_saic] Field chrgngRmnngTime returned None in charging data.
2024-09-04 15:35:49.943 ERROR (MainThread) [custom_components.mg_saic] Error updating charging sensor Remaining Charging Time: No entity id specified for entity MG ZS EV Remaining Charging Time
2024-09-04 15:35:49.946 WARNING (MainThread) [custom_components.mg_saic] Field chrgngAddedElecRng returned None in charging data.
2024-09-04 15:35:49.947 ERROR (MainThread) [custom_components.mg_saic] Error updating charging sensor Added Electric Range: No entity id specified for entity MG ZS EV Added Electric Range
2024-09-04 15:35:49.949 ERROR (MainThread) [custom_components.mg_saic] Error updating charging sensor Power Usage Since Last Charge: No entity id specified for entity MG ZS EV Power Usage Since Last Charge
2024-09-04 15:35:49.951 ERROR (MainThread) [custom_components.mg_saic] Error updating charging sensor Mileage Since Last Charge: No entity id specified for entity MG ZS EV Mileage Since Last Charge
2024-09-04 15:35:49.953 ERROR (MainThread) [custom_components.mg_saic] Error updating charging sensor Charging Status: No entity id specified for entity MG ZS EV Charging Status
2024-09-04 15:35:49.958 ERROR (MainThread) [custom_components.mg_saic] Error updating binary sensor Door Front Left: No entity id specified for entity MG ZS EV Door Front Left
2024-09-04 15:35:49.959 ERROR (MainThread) [custom_components.mg_saic] Error updating binary sensor Window Front Left: No entity id specified for entity MG ZS EV Window Front Left
2024-09-04 15:35:49.961 ERROR (MainThread) [custom_components.mg_saic] Error updating binary sensor Door Front Right: No entity id specified for entity MG ZS EV Door Front Right
2024-09-04 15:35:49.964 ERROR (MainThread) [custom_components.mg_saic] Error updating binary sensor Window Front Right: No entity id specified for entity MG ZS EV Window Front Right
2024-09-04 15:35:49.966 ERROR (MainThread) [custom_components.mg_saic] Error updating binary sensor Door Rear Left: No entity id specified for entity MG ZS EV Door Rear Left
2024-09-04 15:35:49.968 ERROR (MainThread) [custom_components.mg_saic] Error updating binary sensor Window Rear Left: No entity id specified for entity MG ZS EV Window Rear Left
2024-09-04 15:35:49.970 ERROR (MainThread) [custom_components.mg_saic] Error updating binary sensor Door Rear Right: No entity id specified for entity MG ZS EV Door Rear Right
2024-09-04 15:35:49.971 ERROR (MainThread) [custom_components.mg_saic] Error updating binary sensor Window Rear Right: No entity id specified for entity MG ZS EV Window Rear Right
2024-09-04 15:35:49.973 ERROR (MainThread) [custom_components.mg_saic] Error updating binary sensor Sun Roof Status: No entity id specified for entity MG ZS EV Sun Roof Status
2024-09-04 15:35:49.976 ERROR (MainThread) [custom_components.mg_saic] Error updating binary sensor Bonnet Status: No entity id specified for entity MG ZS EV Bonnet Status
2024-09-04 15:35:49.978 ERROR (MainThread) [custom_components.mg_saic] Error updating binary sensor Boot Status: No entity id specified for entity MG ZS EV Boot Status
2024-09-04 15:35:49.981 ERROR (MainThread) [custom_components.mg_saic] Error updating binary sensor Lock Status: No entity id specified for entity MG ZS EV Lock Status
2024-09-04 15:35:49.983 ERROR (MainThread) [custom_components.mg_saic] Error updating binary sensor HVAC Status: No entity id specified for entity MG ZS EV HVAC Status
2024-09-04 15:35:49.985 ERROR (MainThread) [custom_components.mg_saic] Error updating charging binary sensor Charging Gun State: No entity id specified for entity MG ZS EV Charging Gun State
2024-09-04 15:35:49.997 DEBUG (MainThread) [custom_components.mg_saic] Updated GPS location to xxx, xxx
2024-09-04 15:35:49.998 ERROR (MainThread) [custom_components.mg_saic] Error updating GPS location: No entity id specified for entity MG ZS EV GPS Location
2024-09-04 15:35:50.014 INFO (MainThread) [custom_components.mg_saic] Services registered for MG SAIC integration.
2024-09-04 15:35:50.014 INFO (MainThread) [custom_components.mg_saic] MG SAIC integration setup completed successfully.
2024-09-04 15:36:19.941 WARNING (MainThread) [custom_components.mg_saic] Field bmsPackVol returned None in charging data.
2024-09-04 15:36:19.957 WARNING (MainThread) [custom_components.mg_saic] Field bmsPackCrnt returned None in charging data.
2024-09-04 15:36:19.961 WARNING (MainThread) [custom_components.mg_saic] Field bmsChrgOtptCrntReq returned None in charging data.
2024-09-04 15:36:19.972 WARNING (MainThread) [custom_components.mg_saic] Field chrgngRmnngTime returned None in charging data.
2024-09-04 15:36:19.978 WARNING (MainThread) [custom_components.mg_saic] Field chrgngAddedElecRng returned None in charging data.```

Hi @drag0nsden

Thanks for the feedback. Some of the strange data that you are getting are coming directly form the MG API, not related to this integration. However, I will try to add more exceptions (like interior temperature -128Âş), whenever I get a new version out.

I’ve been out for some weeks, but as soon as I can get back to this, I will add some more functionalities, make sure that the services are up and running and rectify some of those. I will also parse your debug log results and see if there are any further changes to be made.

The errors related to No entity id specified... are quite odd, although I also got those, but all sensors have a unique ID assign, so I will have to dig deep on those.

Keep in touch for further updates.

Cheers

Hello everyone,

Just released an update for the integration:

On this version I got all services working and some adjustments to the whole mechanics of the integration, along with code improvements.

You may check the changelog on the link above.

Let me know if there is any issue or suggestion for improvements.

Cheers

Hello everyone,

So based on some feedback, the integration (caused by bad data provided by MG/SAIC) was not able to always identify the vehicle type (BEV, PHEV, HEV or ICE). I revised the mechanics and took the opportunity to make some other changes.

Here is the latest version:

Cheers

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.