Closed TimoD87 closed 7 months ago
I started getting some errors a few hours ago but not the same as you when using CLI - I get the following
Note in the past sometimes wait for a few hours (24) and it may start working again. I think I have seen this before and something got reset after a period of time. I was debugging this morning so issued a few API calls in quite a short period of time (which may trigger something)
Traceback (most recent call last):
File "./c.py", line 4, in
I am getting this one after 15:00 CET:
2023-11-16 15:11:51.672 ERROR (MainThread) [custom_components.porscheconnect] Unexpected error fetching porscheconnect data: 'vehicleServiceEnabledMap' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 290, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/porscheconnect/init.py", line 256, in _async_update_data vdata = await self._update_data_for_vehicle(vehicle) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/porscheconnect/init.py", line 146, in _update_data_for_vehicle services = await self.controller.getServices(vin) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pyporscheconnectapi/client.py", line 488, in getServices is_privacy = data['vehicleServiceEnabledMap']['VSR'] == 'DISABLED'
KeyError: 'vehicleServiceEnabledMap'
I tend to think this may be due to intermittent problems in the back-end. I can see that sometime the same call fails and sometimes it gets through. Let's give it a few days before trying to chase it down further.
OK it is working for me once again - didn't hit an API for > 12 hours. My typical cadence is about one ping an hour (other than when I am debugging)
I was still getting seemingly random failures, probably things are in flux as they are rolling out new functions. I may have found out that we need to set a different scope when authenticating.
If you are still experiencing problems, please try out #40 .. grateful for your feedback.
I had one failure a couple of hours ago but retried (within 20 minutes) and it worked. I will monitor and try your update if I get back into the state of it not working again. Note sometimes when it fails I try the mobile app to ensure their APIs are actually working as it sometimes goes down for a period of time.
OK I finally got the failures for the last 3 hours. I just tried it failed with the following errors:
Traceback (most recent call last):
File "./porsche1.py", line 142, in
and then I immediately tried your new patch and it works!!! I will keep using that version and see how it goes.
Thanks!
If you really want to bring out your daring side (and help me with some testing), you could check out the "cleanup" branch and try that. The name says it all, but also incorporates the fix with the oauth2 scope.
When I'm trying to get Information with client.getEmobility(vin, model) i get the following error:
conn {'pcckErrorKey': 'GRAY_SLICE_ERROR_UNKNOWN_MSG', 'pcckErrorMessage': None, 'pcckErrorCode': None, 'pcckIsBusinessError': True}
Trying to get the data direct with the cli.py the data looks okay:
{ "batteryChargeStatus": { "plugState": "DISCONNECTED", "lockState": "UNLOCKED", "chargingState": "OFF", "chargingReason": "INVALID", "externalPowerSupplyState": "UNAVAILABLE", "ledColor": "NONE", "ledState": "OFF", "chargingMode": "OFF", "stateOfChargeInPercentage": 70, "remainingChargeTimeUntil100PercentInMinutes": null, "remainingERange": { "value": 301, "unit": "KILOMETERS", "originalValue": 301, "originalUnit": "KILOMETERS", "valueInKilometers": 301, "unitTranslationKey": "GRAY_SLICE_UNIT_KILOMETER", "unitTranslationKeyV2": "TC.UNIT.KILOMETER" }, "remainingCRange": null, "chargingTargetDateTime": "2023-11-14T05:33", "status": null, "chargeRate": { "value": 0, "unit": "KM_PER_MIN", "valueInKmPerHour": 0, "unitTranslationKey": "EM.COMMON.UNIT.KM_PER_MIN", "unitTranslationKeyV2": "TC.UNIT.KM_PER_MIN" }, "chargingPower": 0, "chargingTargetDateTimeOplEnforced": null, "chargingInDCMode": false }, "directCharge": { "disabled": true, "isActive": false }, "directClimatisation": { "climatisationState": "OFF", "remainingClimatisationTime": null, "targetTemperature": "2950", "climatisationWithoutHVpower": "false", "heaterSource": "electric" }, "timers": [ { "timerID": "1", "departureDateTime": "2023-11-17T13:31:00.000Z", "preferredChargingTimeEnabled": false, "preferredChargingStartTime": null, "preferredChargingEndTime": null, "frequency": "SINGLE", "climatised": true, "weekDays": null, "active": false, "chargeOption": true, "targetChargeLevel": 25, "climatisationTimer": false, "e3_CLIMATISATION_TIMER_ID": "4" } ], "climateTimer": null, "chargingProfiles": { "currentProfileId": 0, "profiles": [ { "profileId": 4, "profileName": "Allgemein", "profileActive": false, "profileOptions": { "autoPlugUnlockEnabled": false, "energyCostOptimisationEnabled": false, "energyMixOptimisationEnabled": false, "powerLimitationEnabled": false, "timeBasedEnabled": false, "usePrivateCurrentEnabled": true }, "chargingOptions": { "minimumChargeLevel": 25, "targetChargeLevel": 100, "smartChargingEnabled": true, "preferredChargingEnabled": false, "preferredChargingTimeStart": "00:00", "preferredChargingTimeEnd": "06:00" }, "position": null, "timerActionList": { "timerAction": [ 1, 2, 3, 4, 5 ] } } ] }, "departureInformation": null, "errorInfo": []
Don't know were the error is coming from :-(