kia_uvo icon indicating copy to clipboard operation
kia_uvo copied to clipboard

Tucson PHEV scheduled charging

Open Utopia69 opened this issue 3 years ago • 21 comments

Hi, It would be nice to have the charging schedule for a (Tucson) PHEV . reservChargeInfos --> Next departure time (1) offpeakPowerInfo --> Off-peak setting reserveChargeInfo2 --> Next departure time (2)

Full response of Tucson PHEV (EU)

{ "retCode": "S", "resCode": "0000", "resMsg": { "vehicleStatusInfo": { "vehicleLocation": { "coord": { "lat": XX.XXXXX, "lon": X.XXXXX, "alt": 0, "type": 0 }, "head": 189, "speed": { "value": 0, "unit": 0 }, "accuracy": { "hdop": 0, "pdop": 0 }, "time": "20220203155212" }, "vehicleStatus": { "airCtrlOn": False, "engine": False, "doorLock": True, "doorOpen": { "frontLeft": 0, "frontRight": 0, "backLeft": 0, "backRight": 0 }, "trunkOpen": False, "airTemp": { "value": "00H", "unit": 0, "hvacTempType": 1 }, "defrost": False, "lowFuelLight": False, "acc": False, "evStatus": { "batteryCharge": False, "batteryStatus": 100, "batteryPlugin": 2, "remainTime2": { "etc2": { "value": 50, "unit": 1 }, "etc3": { "value": 20, "unit": 1 }, "atc": { "value": 0, "unit": 1 } }, "drvDistance": [{ "rangeByFuel": { "gasModeRange": { "value": 0, "unit": 1 }, "evModeRange": { "value": 0, "unit": 1 }, "totalAvailableRange": { "value": 0, "unit": 1 } }, "type": 2 }], "reservChargeInfos": { "reservChargeInfo": { "reservChargeInfoDetail": { "reservInfo": { "day": [0, 1, 2, 3, 4, 5, 6], "time": { "time": "0900", "timeSection": 0 } }, "reservChargeSet": True } }, "offpeakPowerInfo": { "offPeakPowerTime1": { "starttime": { "time": "0100", "timeSection": 0 }, "endtime": { "time": "0700", "timeSection": 0 } }, "offPeakPowerFlag": 2 }, "reserveChargeInfo2": { "reservChargeInfoDetail": { "reservInfo": { "day": [0, 1, 2, 3, 4, 5, 6], "time": { "time": "1200", "timeSection": 0 } }, "reservChargeSet": False } }, "reservFlag": 1, "ect": { "start": { "day": 0, "time": { "time": "0000", "timeSection": 0 } }, "end": { "day": 0, "time": { "time": "0000", "timeSection": 0 } } } } }, "ign3": False, "hoodOpen": False, "transCond": True, "steerWheelHeat": 0, "sideBackWindowHeat": 0, "tirePressureLamp": { "tirePressureLampAll": 0, "tirePressureLampFL": 0, "tirePressureLampFR": 0, "tirePressureLampRL": 0, "tirePressureLampRR": 0 }, "seatHeaterVentState": { "frSeatHeatState": 2, "flSeatHeatState": 2, "rlSeatHeatState": 2, "rrSeatHeatState": 2 }, "battery": { "batSoc": 89, "batState": 0, "sjbDeliveryMode": 1, "batSignalReferenceValue": { "batWarning": 65 }, "powerAutoCutMode": 2 }, "lampWireStatus": { "stopLamp": { "stopLampStatus": False, "leftLamp": False, "rightLamp": False }, "headLamp": { "headLampStatus": False, "leftLowLamp": False, "rightLowLamp": False, "leftHighLamp": False, "rightHighLamp": False, "leftBifuncLamp": False, "rightBifuncLamp": False }, "turnSignalLamp": { "turnSignalLampStatus": False, "leftFrontLamp": False, "rightFrontLamp": False, "leftRearLamp": False, "rightRearLamp": False } }, "windowOpen": { "frontLeft": 0, "frontRight": 0, "backLeft": 0, "backRight": 0 }, "smartKeyBatteryWarning": False, "fuelLevel": 100, "washerFluidStatus": False, "breakOilStatus": False, "sleepModeCheck": False, "time": "20220203155214", "remoteWaitingTimeAlert": { "remoteControlAvailable": 1, "remoteControlWaitingTime": 168, "elapsedTime": "04:43:02" }, "systemCutOffAlert": 0, "tailLampStatus": 0, "hazardStatus": 0 }, "odometer": { "value": 1801.8, "unit": 1 } } }, "msgId": "XXXXXX-XXXXX-XXXXXX-XXXXXX-XXXXXXXX" }

Utopia69 avatar Feb 03 '22 16:02 Utopia69

Are you looking to set this or display?

cdnninja avatar Feb 03 '22 17:02 cdnninja

Are you looking to set this or display?

Both would be nice, since it's constantly changing (resetting itself) without any reason

Utopia69 avatar Feb 03 '22 17:02 Utopia69

wow, just found this and realllyyy would like this Scheduled Charging feature. Stupid car is always disabling this.

pm me if testing is needed.

rayures avatar Sep 12 '22 10:09 rayures

I am interested to hear how people would want this displayed based on the raw data? If possible think about other data types you have seen in HACS as I don't think a string is helpful here. Also interested to see what you would do with the data in automations so that I make it useful.

cdnninja avatar Nov 11 '22 01:11 cdnninja

Could I get screenshots of how you this is shown in the app? May give me clues on how to show it in HACS.

cdnninja avatar Dec 08 '22 20:12 cdnninja

please find below some screenshots from the app Screenshot_20221209_083531_Bluelink Screenshot_20221209_083541_Bluelink Screenshot_20221209_083547_Bluelink

Utopia69 avatar Dec 09 '22 07:12 Utopia69

I have done the initial work of mapping this data from the API. https://github.com/Hyundai-Kia-Connect/hyundai_kia_connect_api/pull/204

I don't know how we set though and would need someone to sniff the traffic to figure that out. I am still unsure how to display this in home assistant.

Some items will just be binary sensors (on off) for now and could turn to a switch if we learn to set the schedule. For times I am thinking just text, same with days of the week. Would that help you?

cdnninja avatar Dec 22 '22 20:12 cdnninja

Could you update in hacs and select the version of "master"? It should show 6 new sensors. I haven't added day of the week yet. To start I want to confirm these 6 work and get any feedback you may have on this.

cdnninja avatar Dec 22 '22 22:12 cdnninja

With the master version I get 2 new sensors EV First Scheduled Departure & EV First Scheduled Departure Time (and they are correct)

Utopia69 avatar Dec 24 '22 09:12 Utopia69

Could I get the attribute contents of your data sensor? I'm interested to see why the second departure didn't show up.

cdnninja avatar Dec 24 '22 14:12 cdnninja

Could I get the attribute contents of your data sensor? I'm interested to see why the second departure didn't show up.

vehicleLocation: coord: lat: XX.XXXXX lon: XX.XXXXX alt: 0 type: 0 head: 0 speed: value: 0 unit: 0 accuracy: hdop: 0 pdop: 0 time: '20221224143639' vehicleStatus: airCtrlOn: false engine: false doorLock: true doorOpen: frontLeft: 0 frontRight: 0 backLeft: 0 backRight: 0 trunkOpen: false airTemp: value: 00H unit: 0 hvacTempType: 1 defrost: false lowFuelLight: false acc: false evStatus: batteryCharge: false batteryStatus: 99 batteryPlugin: 2 remainTime2: etc2: value: 1 unit: 1 etc3: value: 1 unit: 1 atc: value: 1 unit: 1 drvDistance:

  • rangeByFuel: gasModeRange: value: 249 unit: 1 evModeRange: value: 59 unit: 1 totalAvailableRange: value: 308 unit: 1 type: 2 reservChargeInfos: reservChargeInfo: reservChargeInfoDetail: reservInfo: day:
  • 0
  • 2
  • 3
  • 4 time: time: '0700' timeSection: 0 reservChargeSet: true offpeakPowerInfo: offPeakPowerTime1: starttime: time: '0200' timeSection: 0 endtime: time: '0500' timeSection: 0 offPeakPowerFlag: 2 reserveChargeInfo2: reservChargeInfoDetail: reservInfo: day:
  • 0
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6 time: time: '0100' timeSection: 1 reservChargeSet: true reservFlag: 0 ect: start: day: 0 time: time: '0000' timeSection: 0 end: day: 0 time: time: '0000' timeSection: 0 ign3: true hoodOpen: false transCond: true steerWheelHeat: 0 sideBackWindowHeat: 0 tirePressureLamp: tirePressureLampAll: 0 tirePressureLampFL: 0 tirePressureLampFR: 0 tirePressureLampRL: 0 tirePressureLampRR: 0 seatHeaterVentState: frSeatHeatState: 2 flSeatHeatState: 2 rlSeatHeatState: 2 rrSeatHeatState: 2 battery: batSoc: 82 batState: 0 sjbDeliveryMode: 1 batSignalReferenceValue: batWarning: 65 powerAutoCutMode: 2 lampWireStatus: stopLamp: stopLampStatus: false leftLamp: false rightLamp: false headLamp: headLampStatus: false leftLowLamp: false rightLowLamp: false leftHighLamp: false rightHighLamp: false leftBifuncLamp: false rightBifuncLamp: false turnSignalLamp: turnSignalLampStatus: false leftFrontLamp: false rightFrontLamp: false leftRearLamp: false rightRearLamp: false windowOpen: frontLeft: 0 frontRight: 0 backLeft: 0 backRight: 0 smartKeyBatteryWarning: false fuelLevel: 50 washerFluidStatus: false breakOilStatus: false sleepModeCheck: false time: '20221224143639' remoteWaitingTimeAlert: remoteControlAvailable: 1 remoteControlWaitingTime: 168 elapsedTime: '48:42:08' systemCutOffAlert: 0 tailLampStatus: 0 hazardStatus: 0 odometer: value: 7241.9 unit: 1 Vehicle name TUCSON

Utopia69 avatar Dec 24 '22 15:12 Utopia69

Please update to the latest release and let me know results. I found one issue that may have impacted other sensors not showing.

cdnninja avatar Dec 24 '22 15:12 cdnninja

Please update to the latest release and let me know results. I found one issue that may have impacted other sensors not showing.

Updated to 2.3.0, but sensors are the same

vehicleLocation: coord: lat: XX.XXXXX lon: XX.XXXX alt: 0 type: 0 head: 0 speed: value: 0 unit: 0 accuracy: hdop: 0 pdop: 0 time: '20221224165052' vehicleStatus: airCtrlOn: false engine: false doorLock: true doorOpen: frontLeft: 0 frontRight: 0 backLeft: 0 backRight: 0 trunkOpen: false airTemp: value: 00H unit: 0 hvacTempType: 1 defrost: false lowFuelLight: false acc: false evStatus: batteryCharge: false batteryStatus: 99 batteryPlugin: 2 remainTime2: etc2: value: 1 unit: 1 etc3: value: 1 unit: 1 atc: value: 1 unit: 1 drvDistance:

  • rangeByFuel: gasModeRange: value: 249 unit: 1 evModeRange: value: 59 unit: 1 totalAvailableRange: value: 308 unit: 1 type: 2 reservChargeInfos: reservChargeInfo: reservChargeInfoDetail: reservInfo: day:
  • 0
  • 2
  • 3
  • 4 time: time: '0700' timeSection: 0 reservChargeSet: true offpeakPowerInfo: offPeakPowerTime1: starttime: time: '0200' timeSection: 0 endtime: time: '0500' timeSection: 0 offPeakPowerFlag: 2 reserveChargeInfo2: reservChargeInfoDetail: reservInfo: day:
  • 0
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6 time: time: '0100' timeSection: 1 reservChargeSet: true reservFlag: 0 ect: start: day: 0 time: time: '0000' timeSection: 0 end: day: 0 time: time: '0000' timeSection: 0 ign3: true hoodOpen: false transCond: true steerWheelHeat: 0 sideBackWindowHeat: 0 tirePressureLamp: tirePressureLampAll: 0 tirePressureLampFL: 0 tirePressureLampFR: 0 tirePressureLampRL: 0 tirePressureLampRR: 0 seatHeaterVentState: frSeatHeatState: 2 flSeatHeatState: 2 rlSeatHeatState: 2 rrSeatHeatState: 2 battery: batSoc: 82 batState: 0 sjbDeliveryMode: 1 batSignalReferenceValue: batWarning: 65 powerAutoCutMode: 2 lampWireStatus: stopLamp: stopLampStatus: false leftLamp: false rightLamp: false headLamp: headLampStatus: false leftLowLamp: false rightLowLamp: false leftHighLamp: false rightHighLamp: false leftBifuncLamp: false rightBifuncLamp: false turnSignalLamp: turnSignalLampStatus: false leftFrontLamp: false rightFrontLamp: false leftRearLamp: false rightRearLamp: false windowOpen: frontLeft: 0 frontRight: 0 backLeft: 0 backRight: 0 smartKeyBatteryWarning: false fuelLevel: 50 washerFluidStatus: false breakOilStatus: false sleepModeCheck: false time: '20221224165050' remoteWaitingTimeAlert: remoteControlAvailable: 1 remoteControlWaitingTime: 168 elapsedTime: '50:56:20' systemCutOffAlert: 0 tailLampStatus: 0 hazardStatus: 0 odometer: value: 7241.9 unit: 1 Vehicle name TUCSON

Utopia69 avatar Dec 24 '22 15:12 Utopia69

Found some of the issues. They spell words different for the second charge and also I had a mistake on off peak. https://github.com/Hyundai-Kia-Connect/hyundai_kia_connect_api/pull/211 Please try again with the latest from "master"

cdnninja avatar Dec 24 '22 16:12 cdnninja

I can confirm, I have the new sensors now

Utopia69 avatar Dec 25 '22 10:12 Utopia69

Could you test out data from the afternoon and see what it does? I may need logs or you to roll back. Have another issue opened where the data is 1270 for time in the api but the app shows 1:10 so almost looks like they handle pm times strangely.

cdnninja avatar Dec 25 '22 18:12 cdnninja

My "EV Second Scheduled Depature Time" shows 01:00:00, this should be 13:00:00 Will test some more pm times later today

Utopia69 avatar Dec 27 '22 08:12 Utopia69

Also the other sensors are incorrect, the show for example 03:00:00 instead of 15:00:00

Utopia69 avatar Dec 27 '22 08:12 Utopia69

https://github.com/Hyundai-Kia-Connect/hyundai_kia_connect_api/pull/214

cdnninja avatar Dec 27 '22 15:12 cdnninja

If you update from "Master" in HACS the PM issue should be solved.

cdnninja avatar Dec 28 '22 04:12 cdnninja

Tested with master and can confirm the PM issue is solved.

Utopia69 avatar Dec 28 '22 10:12 Utopia69