ad-ha/mg-saic-ha

[ISSUE] Plugin does not respect update interval

Closed this issue · 7 comments

x3e commented

Home Assistant Version

2024.11.3

MG/SAIC Integration Version

0.5.2

Installation Method

HACS

Did you check for existing issues?

  • Yes, I have checked for existing issues
  • No, I have not checked for existing issues

Did you enable debug logging before and are ready to post logs?

  • Yes, I have enabled debug logging
  • No, I have not enabled debug logging

Describe the Issue

Seems like the info like the SoH is updating too often. I have my update interval set to two hours (while not charging):
Screenshot_20241127-160541_Home Assistant
I have set my interval to 15 mins while charging, so I think there is a problem with charging detection.
Screenshot_20241127-163615_Home Assistant

Logs

2024-11-27 13:59:08.990 DEBUG (MainThread) [custom_components.mg_saic] Vehicle Type: BEV
2024-11-27 13:59:08.990 DEBUG (MainThread) [custom_components.mg_saic] Vehicle Info: [VinInfo(bindTime=redacted, brandName='MG', colorName='redacted', isActivate=False, isCurrentVehicle=True, isSubaccount=False, modelName='EH32 X1', modelYear='2022', name=None, series='EH32 L', vin='redacted', 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='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='0'), 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='2'), VehicleModelConfiguration(itemCode='SBH', itemName='SBH', itemValue='1'), VehicleModelConfiguration(itemCode='BHI', itemName='BHI', itemValue='1'), VehicleModelConfiguration(itemCode='ROV', itemName='ROV', itemValue='25857')])]
2024-11-27 13:59:08.990 DEBUG (MainThread) [custom_components.mg_saic] Vehicle Status: VehicleStatusResp(basicVehicleStatus=BasicVehicleStatus(batteryVoltage=126, bonnetStatus=0, bootStatus=0, canBusActive=1, clstrDspdFuelLvlSgmt=0, currentJourneyId=3736, currentJourneyDistance=40, dippedBeamStatus=0, driverDoor=0, driverWindow=0, engineStatus=0, extendedData1=66, extendedData2=0, exteriorTemperature=9, frontLeftSeatHeatLevel=0, frontLeftTyrePressure=58, frontRightSeatHeatLevel=0, frontRightTyrePressure=57, fuelLevelPrc=0, fuelRange=0, fuelRangeElec=0, handBrake=0, interiorTemperature=11, lastKeySeen=0, lockStatus=1, mainBeamStatus=0, mileage=433550, passengerDoor=0, passengerWindow=1, powerMode=0, rearLeftDoor=0, rearLeftTyrePressure=67, rearLeftWindow=1, rearRightDoor=0, rearRightTyrePressure=61, rearRightWindow=1, remoteClimateStatus=0, rmtHtdRrWndSt=0, sideLightStatus=0, steeringHeatLevel=0, steeringWheelHeatFailureReason=0, 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=0, timeStamp=0, wayPoint=GpsPosition.WayPoint(hdop=0, heading=0, position=GpsPosition.WayPoint.Position(altitude=0, latitude=0, longitude=0), satellites=0, speed=0)), statusTime=1732715944)
2024-11-27 13:59:08.991 DEBUG (MainThread) [custom_components.mg_saic] Vehicle Charging Data: ChrgMgmtDataResp(chrgMgmtData=ChrgMgmtData(bmsAdpPubChrgSttnDspCmd=0, bmsAltngChrgCrntDspCmd=4, bmsChrgCtrlDspCmd=2, bmsChrgOtptCrntReq=1023, bmsChrgOtptCrntReqV=1, bmsChrgSpRsn=0, bmsChrgSts=0, bmsDsChrgSpRsn=0, bmsEstdElecRng=2047, bmsOnBdChrgTrgtSOCDspCmd=5, bmsPackCrnt=20000, bmsPackCrntV=0, bmsPackSOCDsp=661, bmsPackVol=1379, bmsPTCHeatReqDspCmd=2, bmsPTCHeatResp=0, bmsPTCHeatSpRsn=None, bmsReserCtrlDspCmd=2, bmsReserSpHourDspCmd=6, bmsReserSpMintueDspCmd=0, bmsReserStHourDspCmd=22, bmsReserStMintueDspCmd=0, ccuEleccLckCtrlDspCmd=2, ccuOffBdChrgrPlugOn=0, ccuOnbdChrgrPlugOn=0, chrgngAddedElecRng=0, chrgngAddedElecRngV=0, chrgngDoorOpenCnd=0, chrgngDoorPosSts=0, chrgngRmnngTime=1023, chrgngRmnngTimeV=1, chrgngSpdngTime=0, chrgngSpdngTimeV=0, clstrElecRngToEPT=186, disChrgngRmnngTime=1023, disChrgngRmnngTimeV=1, imcuChrgngEstdElecRng=231, imcuChrgngEstdElecRngV=0, imcuDschrgngEstdElecRng=86, imcuDschrgngEstdElecRngV=0, imcuVehElecRng=186, imcuVehElecRngV=0, onBdChrgrAltrCrntInptCrnt=0, onBdChrgrAltrCrntInptVol=0), rvsChargeStatus=RvsChargeStatus(chargingDuration=0, chargingElectricityPhase=None, chargingGunState=0, chargingPileID=None, chargingPileSupplier=None, chargingType=1, endTime=1732428898, extendedData1=None, extendedData2=None, extendedData3=None, extendedData4=None, fotaLowestVoltage=None, fuelRangeElec=1860, lastChargeEndingPower=724, mileage=433550, mileageOfDay=150, mileageSinceLastCharge=880, powerUsageOfDay=62, powerUsageSinceLastCharge=245, realtimePower=479, startTime=1732406411, staticEnergyConsumption=None, totalBatteryCapacity=725, workingCurrent=20000, workingVoltage=1379))
2024-11-27 13:59:08.991 DEBUG (MainThread) [custom_components.mg_saic] Finished fetching MG SAIC data update coordinator data in 9.683 seconds (success: True)
2024-11-27 14:14:24.673 DEBUG (MainThread) [custom_components.mg_saic] Vehicle Type: BEV
2024-11-27 14:14:24.674 DEBUG (MainThread) [custom_components.mg_saic] Vehicle Info: [VinInfo(bindTime=redacted, brandName='MG', colorName='redacted, isActivate=False, isCurrentVehicle=True, isSubaccount=False, modelName='EH32 X1', modelYear='2022', name=None, series='EH32 L', vin='redacted', 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='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='0'), 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='2'), VehicleModelConfiguration(itemCode='SBH', itemName='SBH', itemValue='1'), VehicleModelConfiguration(itemCode='BHI', itemName='BHI', itemValue='1'), VehicleModelConfiguration(itemCode='ROV', itemName='ROV', itemValue='25857')])]
2024-11-27 14:14:24.674 DEBUG (MainThread) [custom_components.mg_saic] Vehicle Status: VehicleStatusResp(basicVehicleStatus=BasicVehicleStatus(batteryVoltage=126, bonnetStatus=0, bootStatus=0, canBusActive=1, clstrDspdFuelLvlSgmt=0, currentJourneyId=3736, currentJourneyDistance=40, dippedBeamStatus=0, driverDoor=0, driverWindow=0, engineStatus=0, extendedData1=66, extendedData2=0, exteriorTemperature=10, frontLeftSeatHeatLevel=0, frontLeftTyrePressure=58, frontRightSeatHeatLevel=0, frontRightTyrePressure=57, fuelLevelPrc=0, fuelRange=0, fuelRangeElec=0, handBrake=0, interiorTemperature=11, lastKeySeen=0, lockStatus=1, mainBeamStatus=0, mileage=433550, passengerDoor=0, passengerWindow=1, powerMode=0, rearLeftDoor=0, rearLeftTyrePressure=67, rearLeftWindow=1, rearRightDoor=0, rearRightTyrePressure=61, rearRightWindow=1, remoteClimateStatus=0, rmtHtdRrWndSt=0, sideLightStatus=0, steeringHeatLevel=0, steeringWheelHeatFailureReason=0, 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=0, timeStamp=0, wayPoint=GpsPosition.WayPoint(hdop=0, heading=0, position=GpsPosition.WayPoint.Position(altitude=0, latitude=0, longitude=0), satellites=0, speed=0)), statusTime=1732716853)
2024-11-27 14:14:24.674 DEBUG (MainThread) [custom_components.mg_saic] Vehicle Charging Data: ChrgMgmtDataResp(chrgMgmtData=ChrgMgmtData(bmsAdpPubChrgSttnDspCmd=0, bmsAltngChrgCrntDspCmd=4, bmsChrgCtrlDspCmd=2, bmsChrgOtptCrntReq=1023, bmsChrgOtptCrntReqV=1, bmsChrgSpRsn=0, bmsChrgSts=0, bmsDsChrgSpRsn=0, bmsEstdElecRng=224, bmsOnBdChrgTrgtSOCDspCmd=5, bmsPackCrnt=20000, bmsPackCrntV=0, bmsPackSOCDsp=661, bmsPackVol=1379, bmsPTCHeatReqDspCmd=2, bmsPTCHeatResp=0, bmsPTCHeatSpRsn=None, bmsReserCtrlDspCmd=2, bmsReserSpHourDspCmd=6, bmsReserSpMintueDspCmd=0, bmsReserStHourDspCmd=22, bmsReserStMintueDspCmd=0, ccuEleccLckCtrlDspCmd=2, ccuOffBdChrgrPlugOn=0, ccuOnbdChrgrPlugOn=0, chrgngAddedElecRng=0, chrgngAddedElecRngV=0, chrgngDoorOpenCnd=0, chrgngDoorPosSts=0, chrgngRmnngTime=1023, chrgngRmnngTimeV=1, chrgngSpdngTime=0, chrgngSpdngTimeV=0, clstrElecRngToEPT=186, disChrgngRmnngTime=1023, disChrgngRmnngTimeV=1, imcuChrgngEstdElecRng=231, imcuChrgngEstdElecRngV=0, imcuDschrgngEstdElecRng=86, imcuDschrgngEstdElecRngV=0, imcuVehElecRng=186, imcuVehElecRngV=0, onBdChrgrAltrCrntInptCrnt=0, onBdChrgrAltrCrntInptVol=0), rvsChargeStatus=RvsChargeStatus(chargingDuration=0, chargingElectricityPhase=None, chargingGunState=0, chargingPileID=None, chargingPileSupplier=None, chargingType=1, endTime=1732428898, extendedData1=None, extendedData2=None, extendedData3=None, extendedData4=None, fotaLowestVoltage=None, fuelRangeElec=1860, lastChargeEndingPower=724, mileage=433550, mileageOfDay=150, mileageSinceLastCharge=880, powerUsageOfDay=62, powerUsageSinceLastCharge=245, realtimePower=479, startTime=1732406411, staticEnergyConsumption=None, totalBatteryCapacity=725, workingCurrent=20000, workingVoltage=1379))
2024-11-27 14:14:24.675 DEBUG (MainThread) [custom_components.mg_saic] Finished fetching MG SAIC data update coordinator data in 16.366 seconds (success: True)
2024-11-27 14:29:36.667 DEBUG (MainThread) [custom_components.mg_saic] Vehicle Type: BEV
2024-11-27 14:29:36.667 DEBUG (MainThread) [custom_components.mg_saic] Vehicle Info: [VinInfo(bindTime=redacted, brandName='MG', colorName='redacted' isActivate=False, isCurrentVehicle=True, isSubaccount=False, modelName='EH32 X1', modelYear='2022', name=None, series='EH32 L', vin='redacted', 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='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='0'), 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='2'), VehicleModelConfiguration(itemCode='SBH', itemName='SBH', itemValue='1'), VehicleModelConfiguration(itemCode='BHI', itemName='BHI', itemValue='1'), VehicleModelConfiguration(itemCode='ROV', itemName='ROV', itemValue='25857')])]
2024-11-27 14:29:36.668 DEBUG (MainThread) [custom_components.mg_saic] Vehicle Status: VehicleStatusResp(basicVehicleStatus=BasicVehicleStatus(batteryVoltage=126, bonnetStatus=0, bootStatus=0, canBusActive=1, clstrDspdFuelLvlSgmt=0, currentJourneyId=3736, currentJourneyDistance=40, dippedBeamStatus=0, driverDoor=0, driverWindow=0, engineStatus=0, extendedData1=66, extendedData2=0, exteriorTemperature=9, frontLeftSeatHeatLevel=0, frontLeftTyrePressure=58, frontRightSeatHeatLevel=0, frontRightTyrePressure=57, fuelLevelPrc=0, fuelRange=0, fuelRangeElec=0, handBrake=0, interiorTemperature=11, lastKeySeen=0, lockStatus=1, mainBeamStatus=0, mileage=433550, passengerDoor=0, passengerWindow=1, powerMode=0, rearLeftDoor=0, rearLeftTyrePressure=67, rearLeftWindow=1, rearRightDoor=0, rearRightTyrePressure=61, rearRightWindow=1, remoteClimateStatus=0, rmtHtdRrWndSt=0, sideLightStatus=0, steeringHeatLevel=0, steeringWheelHeatFailureReason=0, 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=0, timeStamp=0, wayPoint=GpsPosition.WayPoint(hdop=0, heading=0, position=GpsPosition.WayPoint.Position(altitude=0, latitude=0, longitude=0), satellites=0, speed=0)), statusTime=1732717770)
2024-11-27 14:29:36.668 DEBUG (MainThread) [custom_components.mg_saic] Vehicle Charging Data: ChrgMgmtDataResp(chrgMgmtData=ChrgMgmtData(bmsAdpPubChrgSttnDspCmd=0, bmsAltngChrgCrntDspCmd=4, bmsChrgCtrlDspCmd=2, bmsChrgOtptCrntReq=1023, bmsChrgOtptCrntReqV=1, bmsChrgSpRsn=0, bmsChrgSts=0, bmsDsChrgSpRsn=0, bmsEstdElecRng=224, bmsOnBdChrgTrgtSOCDspCmd=5, bmsPackCrnt=20000, bmsPackCrntV=0, bmsPackSOCDsp=661, bmsPackVol=1379, bmsPTCHeatReqDspCmd=2, bmsPTCHeatResp=0, bmsPTCHeatSpRsn=None, bmsReserCtrlDspCmd=2, bmsReserSpHourDspCmd=6, bmsReserSpMintueDspCmd=0, bmsReserStHourDspCmd=22, bmsReserStMintueDspCmd=0, ccuEleccLckCtrlDspCmd=2, ccuOffBdChrgrPlugOn=0, ccuOnbdChrgrPlugOn=0, chrgngAddedElecRng=0, chrgngAddedElecRngV=0, chrgngDoorOpenCnd=0, chrgngDoorPosSts=0, chrgngRmnngTime=1023, chrgngRmnngTimeV=1, chrgngSpdngTime=0, chrgngSpdngTimeV=0, clstrElecRngToEPT=186, disChrgngRmnngTime=1023, disChrgngRmnngTimeV=1, imcuChrgngEstdElecRng=231, imcuChrgngEstdElecRngV=0, imcuDschrgngEstdElecRng=87, imcuDschrgngEstdElecRngV=0, imcuVehElecRng=186, imcuVehElecRngV=0, onBdChrgrAltrCrntInptCrnt=0, onBdChrgrAltrCrntInptVol=0), rvsChargeStatus=RvsChargeStatus(chargingDuration=0, chargingElectricityPhase=None, chargingGunState=0, chargingPileID=None, chargingPileSupplier=None, chargingType=1, endTime=1732428898, extendedData1=None, extendedData2=None, extendedData3=None, extendedData4=None, fotaLowestVoltage=None, fuelRangeElec=1860, lastChargeEndingPower=724, mileage=433550, mileageOfDay=150, mileageSinceLastCharge=880, powerUsageOfDay=62, powerUsageSinceLastCharge=245, realtimePower=479, startTime=1732406411, staticEnergyConsumption=None, totalBatteryCapacity=725, workingCurrent=20000, workingVoltage=1379))
2024-11-27 14:29:36.668 DEBUG (MainThread) [custom_components.mg_saic] Finished fetching MG SAIC data update coordinator data in 12.359 seconds (success: True)
2024-11-27 14:44:50.090 DEBUG (MainThread) [custom_components.mg_saic] Vehicle Type: BEV
2024-11-27 14:44:50.090 DEBUG (MainThread) [custom_components.mg_saic] Vehicle Info: [VinInfo(bindTime=redacted, brandName='MG', colorName=redacted'', isActivate=False, isCurrentVehicle=True, isSubaccount=False, modelName='EH32 X1', modelYear='2022', name=None, series='EH32 L', vin='redacted', 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='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='0'), 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='2'), VehicleModelConfiguration(itemCode='SBH', itemName='SBH', itemValue='1'), VehicleModelConfiguration(itemCode='BHI', itemName='BHI', itemValue='1'), VehicleModelConfiguration(itemCode='ROV', itemName='ROV', itemValue='25857')])]
2024-11-27 14:44:50.091 DEBUG (MainThread) [custom_components.mg_saic] Vehicle Status: VehicleStatusResp(basicVehicleStatus=BasicVehicleStatus(batteryVoltage=126, bonnetStatus=0, bootStatus=0, canBusActive=1, clstrDspdFuelLvlSgmt=0, currentJourneyId=3736, currentJourneyDistance=40, dippedBeamStatus=0, driverDoor=0, driverWindow=0, engineStatus=0, extendedData1=66, extendedData2=0, exteriorTemperature=9, frontLeftSeatHeatLevel=0, frontLeftTyrePressure=58, frontRightSeatHeatLevel=0, frontRightTyrePressure=57, fuelLevelPrc=0, fuelRange=0, fuelRangeElec=0, handBrake=0, interiorTemperature=11, lastKeySeen=0, lockStatus=1, mainBeamStatus=0, mileage=433550, passengerDoor=0, passengerWindow=1, powerMode=0, rearLeftDoor=0, rearLeftTyrePressure=67, rearLeftWindow=1, rearRightDoor=0, rearRightTyrePressure=61, rearRightWindow=1, remoteClimateStatus=0, rmtHtdRrWndSt=0, sideLightStatus=0, steeringHeatLevel=0, steeringWheelHeatFailureReason=0, 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=1732718680, wayPoint=GpsPosition.WayPoint(hdop=8, heading=0, position=GpsPosition.WayPoint.Position(altitude=7, latitude=51953058, longitude=5706882), satellites=6, speed=0)), statusTime=1732718681)
2024-11-27 14:44:50.091 DEBUG (MainThread) [custom_components.mg_saic] Vehicle Charging Data: ChrgMgmtDataResp(chrgMgmtData=ChrgMgmtData(bmsAdpPubChrgSttnDspCmd=0, bmsAltngChrgCrntDspCmd=4, bmsChrgCtrlDspCmd=2, bmsChrgOtptCrntReq=1023, bmsChrgOtptCrntReqV=1, bmsChrgSpRsn=0, bmsChrgSts=0, bmsDsChrgSpRsn=0, bmsEstdElecRng=224, bmsOnBdChrgTrgtSOCDspCmd=5, bmsPackCrnt=20000, bmsPackCrntV=0, bmsPackSOCDsp=661, bmsPackVol=1379, bmsPTCHeatReqDspCmd=2, bmsPTCHeatResp=0, bmsPTCHeatSpRsn=None, bmsReserCtrlDspCmd=2, bmsReserSpHourDspCmd=6, bmsReserSpMintueDspCmd=0, bmsReserStHourDspCmd=22, bmsReserStMintueDspCmd=0, ccuEleccLckCtrlDspCmd=2, ccuOffBdChrgrPlugOn=0, ccuOnbdChrgrPlugOn=0, chrgngAddedElecRng=0, chrgngAddedElecRngV=0, chrgngDoorOpenCnd=0, chrgngDoorPosSts=0, chrgngRmnngTime=1023, chrgngRmnngTimeV=1, chrgngSpdngTime=0, chrgngSpdngTimeV=0, clstrElecRngToEPT=186, disChrgngRmnngTime=1023, disChrgngRmnngTimeV=1, imcuChrgngEstdElecRng=231, imcuChrgngEstdElecRngV=0, imcuDschrgngEstdElecRng=87, imcuDschrgngEstdElecRngV=0, imcuVehElecRng=186, imcuVehElecRngV=0, onBdChrgrAltrCrntInptCrnt=0, onBdChrgrAltrCrntInptVol=0), rvsChargeStatus=RvsChargeStatus(chargingDuration=0, chargingElectricityPhase=None, chargingGunState=0, chargingPileID=None, chargingPileSupplier=None, chargingType=1, endTime=1732428898, extendedData1=None, extendedData2=None, extendedData3=None, extendedData4=None, fotaLowestVoltage=None, fuelRangeElec=1860, lastChargeEndingPower=724, mileage=433550, mileageOfDay=150, mileageSinceLastCharge=880, powerUsageOfDay=62, powerUsageSinceLastCharge=245, realtimePower=479, startTime=1732406411, staticEnergyConsumption=None, totalBatteryCapacity=725, workingCurrent=20000, workingVoltage=1379))
2024-11-27 14:44:50.091 DEBUG (MainThread) [custom_components.mg_saic] Finished fetching MG SAIC data update coordinator data in 13.783 seconds (success: True)
2024-11-27 15:00:10.847 DEBUG (MainThread) [custom_components.mg_saic] Vehicle Type: BEV
2024-11-27 15:00:10.847 DEBUG (MainThread) [custom_components.mg_saic] Vehicle Info: [VinInfo(bindTime=redacted, brandName='MG', colorName='redacted', isActivate=False, isCurrentVehicle=True, isSubaccount=False, modelName='EH32 X1', modelYear='2022', name=None, series='EH32 L', vin='redacted8', 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='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='0'), 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='2'), VehicleModelConfiguration(itemCode='SBH', itemName='SBH', itemValue='1'), VehicleModelConfiguration(itemCode='BHI', itemName='BHI', itemValue='1'), VehicleModelConfiguration(itemCode='ROV', itemName='ROV', itemValue='25857')])]
2024-11-27 15:00:10.847 DEBUG (MainThread) [custom_components.mg_saic] Vehicle Status: VehicleStatusResp(basicVehicleStatus=BasicVehicleStatus(batteryVoltage=126, bonnetStatus=0, bootStatus=0, canBusActive=1, clstrDspdFuelLvlSgmt=0, currentJourneyId=3736, currentJourneyDistance=40, dippedBeamStatus=0, driverDoor=0, driverWindow=0, engineStatus=0, extendedData1=66, extendedData2=0, exteriorTemperature=9, frontLeftSeatHeatLevel=0, frontLeftTyrePressure=58, frontRightSeatHeatLevel=0, frontRightTyrePressure=57, fuelLevelPrc=0, fuelRange=0, fuelRangeElec=0, handBrake=0, interiorTemperature=11, lastKeySeen=0, lockStatus=1, mainBeamStatus=0, mileage=433550, passengerDoor=0, passengerWindow=1, powerMode=0, rearLeftDoor=0, rearLeftTyrePressure=67, rearLeftWindow=1, rearRightDoor=0, rearRightTyrePressure=61, rearRightWindow=1, remoteClimateStatus=0, rmtHtdRrWndSt=0, sideLightStatus=0, steeringHeatLevel=0, steeringWheelHeatFailureReason=0, 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=0, timeStamp=0, wayPoint=GpsPosition.WayPoint(hdop=0, heading=0, position=GpsPosition.WayPoint.Position(altitude=0, latitude=0, longitude=0), satellites=0, speed=0)), statusTime=1732719596)
2024-11-27 15:00:10.848 DEBUG (MainThread) [custom_components.mg_saic] Vehicle Charging Data: ChrgMgmtDataResp(chrgMgmtData=ChrgMgmtData(bmsAdpPubChrgSttnDspCmd=0, bmsAltngChrgCrntDspCmd=4, bmsChrgCtrlDspCmd=2, bmsChrgOtptCrntReq=1023, bmsChrgOtptCrntReqV=1, bmsChrgSpRsn=0, bmsChrgSts=0, bmsDsChrgSpRsn=0, bmsEstdElecRng=224, bmsOnBdChrgTrgtSOCDspCmd=5, bmsPackCrnt=20000, bmsPackCrntV=0, bmsPackSOCDsp=661, bmsPackVol=1379, bmsPTCHeatReqDspCmd=2, bmsPTCHeatResp=0, bmsPTCHeatSpRsn=None, bmsReserCtrlDspCmd=2, bmsReserSpHourDspCmd=6, bmsReserSpMintueDspCmd=0, bmsReserStHourDspCmd=22, bmsReserStMintueDspCmd=0, ccuEleccLckCtrlDspCmd=2, ccuOffBdChrgrPlugOn=0, ccuOnbdChrgrPlugOn=0, chrgngAddedElecRng=0, chrgngAddedElecRngV=0, chrgngDoorOpenCnd=0, chrgngDoorPosSts=0, chrgngRmnngTime=1023, chrgngRmnngTimeV=1, chrgngSpdngTime=0, chrgngSpdngTimeV=0, clstrElecRngToEPT=186, disChrgngRmnngTime=1023, disChrgngRmnngTimeV=1, imcuChrgngEstdElecRng=231, imcuChrgngEstdElecRngV=0, imcuDschrgngEstdElecRng=87, imcuDschrgngEstdElecRngV=0, imcuVehElecRng=186, imcuVehElecRngV=0, onBdChrgrAltrCrntInptCrnt=0, onBdChrgrAltrCrntInptVol=0), rvsChargeStatus=RvsChargeStatus(chargingDuration=0, chargingElectricityPhase=None, chargingGunState=0, chargingPileID=None, chargingPileSupplier=None, chargingType=1, endTime=1732428898, extendedData1=None, extendedData2=None, extendedData3=None, extendedData4=None, fotaLowestVoltage=None, fuelRangeElec=1860, lastChargeEndingPower=724, mileage=433550, mileageOfDay=150, mileageSinceLastCharge=880, powerUsageOfDay=62, powerUsageSinceLastCharge=245, realtimePower=479, startTime=1732406411, staticEnergyConsumption=None, totalBatteryCapacity=725, workingCurrent=20000, workingVoltage=1379))
2024-11-2

Additional Context

No response

Hi @x3e

That really seems odd. Checked all data and none of that has a value that could trigger the charging update interval.

Let me have a look and see what shall I fix. I did not find a similar behavior on my end, but for sure this needs to be looked into.

x3e commented

I added some logging to _async_update_data() (coordinator.py) myself, and it seems that the charging state is correctly registered:

        # Adjust update interval based on charging status
        new_interval = (
            self.update_interval_charging if self.is_charging else self.update_interval
        )
        LOGGER.debug("is_charging: %s; update_interval: %s; update_interval_charging: %s; new_interval: %s", self.is_charging, self.update_interval, self.update_interval_charging, new_interval)

2024-11-28 16:15:49.857 DEBUG (MainThread) [custom_components.mg_saic] bms_chrg_sts: 0
2024-11-28 16:15:49.857 DEBUG (MainThread) [custom_components.mg_saic] is_charging: False; update_interval: 2:00:00; update_interval_charging: 0:30:00; new_interval: 2:00:00

(by the way, I changed my "charging" interval to 30minutes, so these values are correct)

I'm also puzzled as to what is wrong. I'll keep you posted if I find the issu myself.

Great, that's for the digging @x3e

Let me know if you find something. This week I am quite loaded so I may not have time to go through it.

x3e commented

Found it! You've got your constants and variables mixed up in SAICMGDataUpdateCoordinator::_async_update_data().
You've got two update intervals; self.update_interval_charging and self.update_interval. But once the car starts charging, the self.update_interval gets overwritten with the charging interval. From that point on self.update_interval can never change back to the default not-charging interval.

2024-11-29 04:53:59.910 DEBUG (MainThread) [custom_components.mg_saic] is_charging: False; update_interval: 0:30:00; update_interval_charging: 0:30:00; new_interval: 0:30:00

I would advise to keep constants upper case and variables lower case. For example you could end up with these variables:
self.update_interval (the current interval), self.CHARGING_INTERVAL (constant for interval during charging) and self.DISCHARGING_INTERVAL (constant for when the car is not charging).

Would you like a Pull Request or do you want to fix it yourself?

x3e commented

Couldn't resist creating a PR ;)
Feel free to edit or decline.

Thanks, @x3e

I really appreciate you looking into this and the PR. Let me have a look later tomorrow or early next week and see how to get this addressed.

I did have a look into your suggestion and seems find though, but let me check just to keep consistency and ease the code.

Cheers 🍺

@x3e

Found today that the update interval was not working properly.

Got that fixed for version 0.7.1. Have been testing during the day and is working fine now. Just missing to test after charging, will do that later.

If I am able will do the release later today.