Closed mitch-dc closed 2 years ago
That is interesting. I only got integers so far. Can you send me a cache file from weconnect-cli when AC charging? Then I can do the changes
How do i get the cache file? My car is 100% now so cant create it now ;)
Previously i used this library: https://github.com/skagmo/ha_vwid/blob/main/custom_components/vwid/libvwid.py
It had decimals in Home Assistant
Would be enough to somehow have a sample of the data coming from the server. If it is from a different API would be fine too.
How can i get the cache file? Will charge the car later today/tomorrow.
If you use weconnect-cli: https://github.com/tillsteinbach/WeConnect-cli it will put a file with all content on your hard disk. You find the location with weconnect-cli --help
it will say something like:
--cachefile CACHEFILE
file to store cache (default: /tmp/weconnect.cache)
Ok will get it when charging
I think I was able to find the right data and changed to float (also for chargeRate_kmph) hope it works.
{"https://mobileapi.apps.emea.vwapps.io/vehicles/WVGZZZE2ZMP053387/selectivestatus?jobs=all": [{"automation": {"climatisationTimer": {"value": {"timers": [{"id": 1, "enabled": true, "recurringTimer": {"startTime": "06:30", "recurringOn": {"mondays": true, "tuesdays": true, "wednesdays": true, "thursdays": true, "fridays": false, "saturdays": false, "sundays": false}}}, {"id": 2, "enabled": true, "recurringTimer": {"startTime": "16:15", "recurringOn": {"mondays": true, "tuesdays": true, "wednesdays": true, "thursdays": true, "fridays": false, "saturdays": false, "sundays": false}}}], "carCapturedTimestamp": "2022-01-14T22:10:21.063Z", "timeInCar": "2022-01-14T23:10:21+01:00"}}, "chargingProfiles": {"error": {"message": "Resource could not be found", "info": "Internal error, please try again later. If the problem persists, please contact our support.", "errorTimeStamp": "2022-01-14T22:23:19Z", "code": 4103, "group": 2, "retry": true}}}, "userCapabilities": {"capabilitiesStatus": {"value": [{"id": "automation", "userDisablingAllowed": true}, {"id": "batteryChargingCare", "status": [1008], "userDisablingAllowed": false}, {"id": "batteryColdWarning", "status": [1008], "userDisablingAllowed": false}, {"id": "batterySupport", "status": [1008], "userDisablingAllowed": false}, {"id": "cdisDigitalKey", "status": [1008], "userDisablingAllowed": false}, {"id": "charging", "userDisablingAllowed": true}, {"id": "chargingStations", "userDisablingAllowed": true}, {"id": "climatisation", "userDisablingAllowed": true}, {"id": "dealerAppointment", "status": [1008], "userDisablingAllowed": false}, {"id": "destinations", "userDisablingAllowed": true}, {"id": "fuelStatus", "userDisablingAllowed": false}, {"id": "ignition", "userDisablingAllowed": false}, {"id": "mapUpdate", "userDisablingAllowed": true}, {"id": "measurements", "status": [1008], "userDisablingAllowed": false}, {"id": "onlineSpeech", "userDisablingAllowed": true}, {"id": "parkingBrake", "status": [1008], "userDisablingAllowed": false}, {"id": "parkingInformation", "userDisablingAllowed": true}, {"id": "parkingPosition", "status": [1008], "userDisablingAllowed": false}, {"id": "personalizationOnline", "status": [1008], "userDisablingAllowed": false}, {"id": "plugAndCharge", "status": [1008], "userDisablingAllowed": false}, {"id": "poiSearch", "status": [1008], "userDisablingAllowed": false}, {"id": "privateEmergencyCall", "status": [1008], "userDisablingAllowed": false}, {"id": "readiness", "userDisablingAllowed": false}, {"id": "roadExperienceManagementLocalization", "status": [1008], "userDisablingAllowed": false}, {"id": "roadExperienceManagementLocalizationUpload", "status": [1008], "userDisablingAllowed": false}, {"id": "roadsideAssistant", "status": [1008], "userDisablingAllowed": false}, {"id": "routing", "userDisablingAllowed": true}, {"id": "state", "status": [1008], "userDisablingAllowed": false}, {"id": "trafficInformation", "userDisablingAllowed": true}, {"id": "vehicleHealth", "status": [1008], "userDisablingAllowed": false}, {"id": "vehicleHealthInspection", "status": [1008], "userDisablingAllowed": false}, {"id": "vehicleHealthWarnings", "status": [1008], "userDisablingAllowed": false}, {"id": "vehicleLights", "status": [1008], "userDisablingAllowed": false}, {"id": "vehicleWakeUpTrigger", "status": [1008], "userDisablingAllowed": false}, {"id": "webRadio", "userDisablingAllowed": true}]}}, "charging": {"batteryStatus": {"value": {"carCapturedTimestamp": "2022-01-14T22:16:14Z", "currentSOC_pct": 68, "cruisingRangeElectric_km": 155}}, "chargingStatus": {"value": {"carCapturedTimestamp": "2022-01-14T22:16:14Z", "remainingChargingTimeToComplete_min": 255, "chargingState": "charging", "chargeMode": "manual", "chargePower_kW": 3.5, "chargeRate_kmph": 16}}, "chargingSettings": {"value": {"carCapturedTimestamp": "2022-01-14T22:10:24Z", "maxChargeCurrentAC": "reduced", "autoUnlockPlugWhenCharged": "off", "targetSOC_pct": 100}}, "plugStatus": {"value": {"carCapturedTimestamp": "2022-01-14T22:11:14Z", "plugConnectionState": "connected", "plugLockState": "locked"}}, "chargeMode": {"value": {"preferredChargeMode": "manual", "availableChargeModes": ["invalid"]}}}, "climatisation": {"climatisationStatus": {"value": {"carCapturedTimestamp": "2022-01-14T22:10:26Z", "remainingClimatisationTime_min": 0, "climatisationState": "off"}, "requests": [{"status": "in_progress", "operation": "start", "body": {"callback": "https://mobileapi.apps.emea.vwapps.io/vehicles/callbacks/WVGZZZE2ZMP053387/climatisation/start", "climatisationWithoutExternalPower": true, "climatizationAtUnlock": true, "targetTemperature_K": 293.65, "windowHeatingEnabled": true, "zoneFrontLeftEnabled": true, "zoneFrontRightEnabled": true}, "requestId": "8b1661d2-e302-4b62-b3f4-c97deb96c925", "vcfRequestId": "2f31b5ab-037c-4ec4-a623-3d538bb9f87c"}]}, "climatisationSettings": {"value": {"carCapturedTimestamp": "2022-01-14T22:10:26Z", "targetTemperature_C": 20.5, "targetTemperature_F": 69, "unitInCar": "celsius", "climatisationWithoutExternalPower": true, "climatizationAtUnlock": true, "windowHeatingEnabled": true, "zoneFrontLeftEnabled": true, "zoneFrontRightEnabled": true}}, "windowHeatingStatus": {"value": {"carCapturedTimestamp": "2022-01-14T22:10:26Z", "windowHeatingStatus": [{"windowLocation": "front", "windowHeatingState": "off"}, {"windowLocation": "rear", "windowHeatingState": "off"}]}}}, "fuelStatus": {"rangeStatus": {"value": {"carCapturedTimestamp": "2022-01-14T22:16:14Z", "carType": "electric", "primaryEngine": {"type": "electric", "currentSOC_pct": 68, "remainingRange_km": 155}, "totalRange_km": 155}}}, "readiness": {"readinessStatus": {"connectionState": {"isOnline": true, "isActive": false, "batteryPowerLevel": "comfort", "dailyPowerBudgetAvailable": true}, "connectionWarning": {"insufficientBatteryLevelWarning": false, "dailyPowerBudgetWarning": false}}}}, "2022-01-14 22:23:19.375182"], "https://vehicle-images-service.apps.emea.vwapps.io/v2/vehicle-images/WVGZZZE2ZMP053387?resolution=2x": [{"data": [{"id": "door_right_back_overlay", "url": "https://vehicle-images-service.apps.emea.vwapps.io/v2/image/id_4/2x/image_door_right_back_overlay.0.1.0.png", "fileName": "image_door_right_back_overlay.0.1.0.png"}, {"id": "window_left_back_overlay", "url": "https://vehicle-images-service.apps.emea.vwapps.io/v2/image/id_4/2x/image_window_left_back_overlay.0.1.0.png", "fileName": "image_window_left_back_overlay.0.1.0.png"},
Here is my cache file if you need it ;) Gonna update and try again!
It works! Thanks man!
Great! Thanks for reporting! When I checked I only saw integer values that is why I wrongly assumed it is int only.
Describe the bug The chargePower_kW field in charging/chargingStatus/chargePower_kW is an integer and has no decimals. The api returns decimals when AC charging. (I dont know about DC).