Hyundai-Kia-Connect / kia_uvo

A Home Assistant HACS integration that supports Kia Connect(Uvo) and Hyundai Bluelink. The integration supports the EU, Canada and the USA.
MIT License
433 stars 85 forks source link

Start_Climate turns car on for a second but then car turns immediately off #319

Closed FuzzyMistborn closed 5 months ago

FuzzyMistborn commented 2 years ago

Region and Brand of car USA, Hyundai

Describe the bug

I've tried using the start_climate service call and I send the command and see the car start up/dash lights up, but then a few seconds later the car turns back off again.

Debug logs if an error occurred

2022-04-17 21:59:05 DEBUG (MainThread) [custom_components.kia_uvo.Vehicle] kia_uvo - force_update_loop start 0 5
2022-04-17 21:59:05 DEBUG (MainThread) [custom_components.kia_uvo.Vehicle] kia_uvo - force_update_loop last_updated 2022-04-18 01:57:28+00:00
2022-04-17 21:59:05 DEBUG (SyncWorker_17) [custom_components.kia_uvo.HyundaiBlueLinkAPIUSA] kia_uvo - using API headers: {'content-type': 'application/json;charset=UTF-8', 'accept': 'application/json, text/plain, */*', 'accept-encoding': 'gzip, deflate, br', 'accept-language': 'en-US,en;q=0.9', 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36', 'host': 'api.telematics.hyundaiusa.com', 'origin': 'https://api.telematics.hyundaiusa.com', 'referer': 'https://api.telematics.hyundaiusa.com/login', 'from': 'SPA', 'to': 'ISS', 'language': '0', 'offset': '-4', 'sec-fetch-dest': 'empty', 'sec-fetch-mode': 'cors', 'sec-fetch-site': 'same-origin', 'refresh': 'false', 'encryptFlag': 'false', 'brandIndicator': 'H', 'gen': '2', 'username': 'xxxxxxxxx', 'blueLinkServicePin': '4203', 'client_id': 'm66129Bb-em93-SPAHYN-bZ91-am4540zp19920', 'clientSecret': 'v558o935-6nne-423i-baa8', 'accessToken': 'w6q2T/okx5dKu0YxjaGYtZnseBROS8uAOpspFLtX/rnhBTa+yXu6XvpPsTpJJR+73JKBamye1MTkiIklLwPAhrpdiXFrEnXWjm+rCf85wjv6dROGqNAbDZCTVE918eswNOktBAhz6eyvaWklRx0NjMdW484CUDqRJboom5wJxlMgdjrTdDxGvHrGBC9eTVbCo/736QbZTWJx5x++dIS7tpgExWhyuofr6JRidMWOpSS48dt2fzX8/1qSFVV0ZHqAr7T0XYWzW7nB46g6GLQ4fEUmGRcpi49hm3muhM7cPIgQA4WxR2Utqvapuo1N1nf2oXqbB1N1R4xEnMmiebEfBIXz4iQm+FWxfcjCrXh7IYIseEUa2yNAJdpNLj4ATL1ZTPVdJuHFu3f1zKuhmM7iQBGokdWc1coRFO42BNGfpTK/wUm3dqJDv1CY6bHlRa1H9eDeL1KQfNrGWO7sNxq8D5nc5XkodZhqQbwBan5z5bpBDnJgh+eRLoX8pc20Sw6bqirJLSyu+0fbwsMSGhXCn9+goBSfIeRYBDzTIN68AN083yf+s5ThCkYHyK01D++RLRzJNG/pqnlwF+uXY03vaKkzu6526WRWd2RnBbf6pIbqUZnNWkFldcjfu6T8Ew0wgrbt0J/UGq8T6MlHxj1AsPJf+H3ltOMpINgSwBJX/Rr8boBHzgbWVXX3s6bJgxS0DbkWAERSS/YnmU8yDeRXXOUuj3zJRegF4iKNoEqRY0c+Ei42fcsmM1rxel7d87Ri', 'vin': 'KM8KRDAF9NU069614', 'vehicleId': 'KM8KRDAF9NU069614', 'pAuth': None, 'registrationId': 'H00004152526VKM8KRDAF9NU069614'}
2022-04-17 21:59:06 DEBUG (SyncWorker_17) [custom_components.kia_uvo.HyundaiBlueLinkAPIUSA] kia_uvo - get_cached_vehicle_status response {'hataTID': 'De_te08WQ--xcetjX2WWiA', 'vehicleStatus': {'dateTime': '2022-04-18T01:58:08Z', 'acc': False, 'defrostStatus': 'false', 'transCond': True, 'doorLockStatus': 'true', 'doorOpen': {'frontRight': 0, 'frontLeft': 0, 'backLeft': 0, 'backRight': 0}, 'washerFluidStatus': False, 'battery': {'batSoc': 97, 'sjbDeliveryMode': 1}, 'hazardStatus': 0, 'vehicleLocation': {'coord': {'lon': XXXXXXXXXXXXX, 'type': 0, 'lat': XXXXXXXXXX}}, 'ign3': True, 'ignitionStatus': 'false', 'lowFuelLight': False, 'sideBackWindowHeat': 0, 'engine': False, 'remoteWaitingTimeAlert': {'remoteControlWaitingTime': 168, 'remoteControlAvailable': 1}, 'hoodOpen': False, 'breakOilStatus': False, 'airConditionStatus': 'false', 'smartKeyBatteryWarning': False, 'steerWheelHeat': 0, 'tailLampStatus': 0, 'trunkOpen': False, 'doorLock': True, 'airCtrlOn': False, 'airTemp': {'unit': 1, 'hvacTempType': 1, 'value': 'LO'}, 'evStatus': {'valueDiff': 0, 'remainTime2': {'etc3': {'unit': 1, 'value': 50}, 'etc2': {'unit': 1, 'value': 440}, 'atc': {'unit': 1, 'value': 60}, 'etc1': {'unit': 1, 'value': 0}}, 'evIgnitionStatus': True, 'inletLockModeStatus': 0, 'batteryPlugin': 2, 'timeDiff': 80, 'batteryCharge': True, 'batteryStatus': 80, 'remainTime': [], 'batteryPreconditiong': False, 'drvDistance': [{'rangeByFuel': {'gasModeRange': {'unit': 3, 'value': 0.0}, 'totalAvailableRange': {'unit': 3, 'value': 224.0}, 'evModeRange': {'unit': 3, 'value': 224.0}}, 'type': 2}], 'reservChargeInfos': {'targetSOClist': [{'rangeByFuel': {'gasModeRange': {'unit': 3, 'value': 0}, 'totalAvailableRange': {'unit': 3, 'value': 224}, 'evModeRange': {'unit': 3, 'value': 224}}, 'plugType': 0, 'targetSOClevel': 80, 'type': 2}, {'rangeByFuel': {'gasModeRange': {'unit': 3, 'value': 0}, 'totalAvailableRange': {'unit': 3, 'value': 224}, 'evModeRange': {'unit': 3, 'value': 224}}, 'plugType': 1, 'targetSOClevel': 90, 'type': 2}], 'reservChargeInfo': {'dateTime': '2022/04/17T18:59:06Z', 'reservChargeInfoDetail': {'reservChargeSet': True, 'reservEndTime': '', 'reservFatcSet': {'defrost': False, 'airTemp': {'unit': 1, 'value': '76'}, 'airCtrl': 0}, 'reservInfo': {'time': {'timeSection': 0, 'time': '0730'}, 'day': [1, 2, 3, 4, 5]}}}, 'reservFlag': 1, 'reserveChargeInfo2': {'reservChargeInfoDetail': {'reservChargeSet': False, 'reservEndTime': '', 'reservFatcSet': {'defrost': False, 'airTemp': {'unit': 1, 'value': '76'}, 'airCtrl': 0}, 'reservInfo': {'time': {'timeSection': 0, 'time': '1200'}, 'day': [1, 3]}}}, 'offpeakPowerInfo': {'offPeakPowerFlag': 1, 'offPeakPowerTime1': {'startTime': {'timeSection': 0, 'time': '1100'}, 'endTime': {'timeSection': 0, 'time': '0600'}}}}}, 'lampWireStatus': {'headLamp': {'rightBifuncLamp': False, 'headLampStatus': False, 'leftLowLamp': False, 'rightHighLamp': False, 'leftBifuncLamp': False, 'leftHighLamp': False, 'rightLowLamp': False}, 'stopLamp': {'rightLamp': False, 'leftLamp': False}, 'turnSignalLamp': {'rightRearLamp': False, 'rightFrontLamp': False, 'leftRearLamp': False, 'leftFrontLamp': False}}, 'sleepModeCheck': False, 'defrost': False, 'tirePressureLamp': {'tirePressureWarningLampRearLeft': 0, 'tirePressureWarningLampFrontLeft': 0, 'tirePressureWarningLampFrontRight': 0, 'tirePressureWarningLampAll': 0, 'tirePressureWarningLampRearRight': 0}, 'trunkOpenStatus': 'false'}}
2022-04-17 21:59:07 DEBUG (SyncWorker_17) [custom_components.kia_uvo.HyundaiBlueLinkAPIUSA] kia_uvo - Get Vehicles Response {"enrolledVehicleDetails":[{"packageDetails":[{"assetNumber":"1-24530972093","displayCategory":"Remote","packageId":"1-NZ1ITF","term":"36","renewalDate":"20250331000000","packageType":"Remote","startDate":"20220331000000"},{"assetNumber":"1-24530972033","displayCategory":"Guidance","packageId":"1-NZ1IRG","term":"36","renewalDate":"20250331000000","packageType":"Guidance","startDate":"20220331000000"},{"assetNumber":"1-24530971973","displayCategory":"Connected Care","packageId":"1-NZ1IOU","term":"36","renewalDate":"20250331000000","packageType":"Connected Care","startDate":"20220331000000"}],"vehicleDetails":{"svrStatus":"NONE","dynamicBurgerMenu":"https://owners.hyundaiusa.com/content/dam/hyundai/us/myhyundai/image/2022/ioniq-5/limited/exterior/base/lucid-blue/Dashboard-01.png/jcr:content/renditions/cq5dam.thumbnail.105.68.png","remoteStartWakeupDays":"seven","enrollmentDate":"20220331","svdDay":"28","trim":"LIMITED","modelCode":"IONIQ 5","ubiCapabilityInd":"Y","vin":"KM8KRDAF9NU069614","enrollmentId":"3721476","sideMirrorHeatCapable":"NO","ownersuccession":"1","odometer":"1647","nickName":"Bluey","defaultBurgerMenu":"https://owners.hyundaiusa.com/content/dam/hyundai/us/myhyundai/image/2022/ioniq-5/limited/exterior/base/default/Dashboard-01.png/jcr:content/renditions/cq5dam.thumbnail.105.68.png","evStatus":"E","modelYear":"2022","steeringWheelHeatCapable":"NO","defaultDashboard":"https://owners.hyundaiusa.com/content/dam/hyundai/us/myhyundai/image/2022/ioniq-5/limited/exterior/base/default/Dashboard-01.png","vehicleGeneration":"2","starttype":"BUTTON","enrollmentType":"INDIVIDUAL","sapColorCode":"U3P","bluelinkEnabled":true,"odometerUpdateDate":"20220417180035","fatcAvailable":"Y","color":"BLUE","maintSyncCapable":"YES","brandIndicator":"H","deviceStatus":"ENROLLED","setOffPeak":"1","mapProvider":"HERE","generalBurgerMenu":"https://owners.hyundaiusa.com/content/dam/hyundai/us/myhyundai/image/2022/ioniq-5/general/exterior/base/default/Dashboard-01.png/jcr:content/renditions/cq5dam.thumbnail.105.68.png","interiorColor":"NNB","accessoryCode":"WAVN 5.0","nadid":"9496059771","mit":"7500","regid":"H00004152526VKM8KRDAF9NU069614","blueLink":"Y","waypointInd":"NO","billingInd":"MONTHLY","dynamicDashboard":"https://owners.hyundaiusa.com/content/dam/hyundai/us/myhyundai/image/2022/ioniq-5/limited/exterior/base/lucid-blue/Dashboard-01.png","imat":"7500","additionalVehicleDetails":{"combinedHeatSettingsEnable":"Y","tmuSleepMode":"No","enableHCAModule":"Y","hyundaiHome":"N","wifiHotspotCapable":"N","remoteLockConsentForRemoteStart":"No","calendarVehicleSyncEnable":"Yes","tmuSleepInMin":1.6666666666666667,"dkEnrolled":"N","icpAvntCapable":"N","icpAACapable":"N","dynamicSOCText":"Use the slider above to set a charge limit. Charging will stop when this battery level is reached. The limit cannot be set lower than 50% This setting will override all other charge settings if set.","targetSOCLevelMax":100,"enableRoadSideAssitanceAAAModule":"Y","evAlarmOptionInfo":"Yes","remoteLockConsentForRemoteStartCapable":"No","mapOtaAccepted":"N","icpCPCapable":"N","dkCapable":"N","enableValetActivate":"N","energyConsoleCapable":"No"},"transmissiontype":"AUTO","bluelinkEnrolled":true,"targetSOCLevel":"50","rearWindowHeatCapable":"NO","preferredDealerCode":"PA076","hmaModel":"NE1","series":"IONIQ 5","enrollmentStatus":"ACTIVE","generalDashboard":"https://owners.hyundaiusa.com/content/dam/hyundai/us/myhyundai/image/2022/ioniq-5/general/exterior/base/default/Dashboard-01.png","userprofilestatus":"Y"},"roleDetails":[{"roleCode":"OWN","roleName":"OWNER"},{"roleCode":"SUB","roleName":"SUBSCRIBER"}],"responseHeaderMap":{}}],"addressDetails":[{"city":"XXXX","street":"XXXXX","postalCode":"XXXXXX","type":"PRIMARY","region":"XXXXX"}],"user":{"accountId":"5097965","firstName":"XXXX","lastName":"Weyl","phonesOptIn":[{"number":"7173008030","primaryPhoneIndicator":"YES","fccOptIn":"NO","type":"MOBILE"}],"loginId":"XXXXXXXX","additionalUserDetails":{"userProfileUpdate":"N","timezoneOffset":-4,"appRating":"N","timezoneAbbr":"EDT","otaAcceptance":"N","telematicsPhoneNumber":"7173008030"},"tncFlag":"N","phones":[{"number":"7173008030","type":"cell","order":1}],"idmId":"C23MOBK4","userId":"XXXXXX","notificationEmail":"XXXXXXX","email":"XXXXXXX"}}
2022-04-17 21:59:07 DEBUG (MainThread) [custom_components.kia_uvo.Vehicle] kia_uvo - LastUpdated 2022-04-18 01:58:08+00:00 - Timezone UTC
2022-04-17 21:59:07 DEBUG (MainThread) [custom_components.kia_uvo.Vehicle] kia_uvo - Engine type set VEHICLE_ENGINE_TYPE.PHEV
2022-04-17 21:59:07 DEBUG (MainThread) [custom_components.kia_uvo.Vehicle] kia_uvo - force_update_loop force_update_finished 2022-04-18 01:57:28+00:00 2022-04-18 01:58:08+00:00

To Reproduce Here's my service call:

service: kia_uvo.start_climate
data:
  Duration: 5
  Temperature: 75
  Heating: true

Expected behavior

Car should turn on and heat/cool to appropriate temp.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context

The car is plugged in (not sure if that's required) and I tried setting the charge limit higher (car was at 80%, set charge to 90%) but didn't change the result.

cdnninja commented 2 years ago

Are you able to make sure the values in your service call match roughly the items you have access to in the app? Not all items are supported on all cars. As a note your logs also don't reference a service call for remote start.

Could you also try with the car unplugged to see if that changes anything?

FuzzyMistborn commented 2 years ago

Are you able to make sure the values in your service call match roughly the items you have access to in the app? Not all items are supported on all cars.

Yes, all items I'm checking are supported. I've even tried a stripped down/basic approach without luck (just duration and temp)

As a note your logs also don't reference a service call for remote start.

Is that required on top of the climate call?

Could you also try with the car unplugged to see if that changes anything?

Car unplugged means it doesn't work at all. Not even the short turn over.

Edit: I just tried turning the car on from the Hyundai website and it worked just fine. Didn't change anything with the car.

cdnninja commented 2 years ago

Poor wording on my part. start_climate will do that. I often think of it as remote start since I have an ICE. Will need to compare this to a a sniff. I will reply to the other thread on this.

cdnninja commented 1 year ago

Any update on this? Looking for a sniff of the traffic and comparing to our data.

FuzzyMistborn commented 1 year ago

What do you need from me? I thought we were working in #317 to try to source some of the issues as they may be related.

cdnninja commented 1 year ago

Good catch that I haven't replied to that one. I do think different issues but same troubleshooting steps needed.

cdnninja commented 1 year ago

Just noting a follow up on this one. Traffic sniffing is most likely required here too.

andyearnshaw commented 1 year ago

FYI I've experienced this problem from the BlueLink app itself (EU, Hyundai Kona). I'll often switch on the climate control and when I go to the car 10 minutes later I discover that the button didn't work even though I got a "success" notification from the car. I've gotten into the habit of pressing the button again after receiving the notification.

I don't think this is an issue with the API, more an issue with the car itself.

Kirono commented 1 year ago

I get this problem too, I think it's linked to the car beeing connected to a charger and at the % charging limit. The start_climate will trigger the car to start charging, the car then stops the charging as it's on the limit and at the same time stop the climate controll. Anyone can confirm this theory?

FuzzyMistborn commented 5 months ago

Closing as this has been working for a few months now.