FlyingDiver / Indigo-Connected-Drive

Plugin for the BMW Connected Drive portal
MIT License
3 stars 0 forks source link

ConnectedDrive.indigoPlugin/Contents/Server Plugin/bmwcdapi.py", line 139, in update_vehicles KeyError: 'vehicleStatus' #2

Closed smeee-again closed 4 years ago

smeee-again commented 4 years ago

I don't believe my vehicle supports or has a vehicle state.

Here is the error with debugging level logging:

Apr 2, 2020 at 8:37:48 PM
   BMW Connected Drive Threaddebug Auth Info =
{
    "access_token": "removed",
    "expires_in": 3600,
    "refresh_token": "removed",
    "scope": "vehicle_data remote_services authenticate_user",
    "token_type": "Bearer"
}
   BMW Connected Drive Debug       ConnectedDrive get_tokens: token r, Expires in 3600
removed   BMW Connected Drive Debug       ConnectedDrive update_vehicles
   BMW Connected Drive Error       Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 131, in runConcurrentThread
  File "/Library/Application Support/Perceptive Automation/Indigo 7.4/Plugins/BMW ConnectedDrive.indigoPlugin/Contents/Server Plugin/bmwcdapi.py", line 139, in update_vehicles
KeyError: 'vehicleStatus'

   BMW Connected Drive Error       plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
   BMW Connected Drive Debug       runConcurrentThread starting
FlyingDiver commented 4 years ago

Use the "Write Vehicle Data to Log" menu command and post the info here.

smeee-again commented 4 years ago
Apr 2, 2020 at 8:51:42 PM
   BMW Connected Drive             Vehicle Data:
{
    "vehicles": [
        {
            "a4a": "NOT_SUPPORTED",
            "bodytype": "F15",
            "brand": "BMW",
            "breakdownNumber": "+4989358957103",
            "carCloud": "NOT_SUPPORTED",
            "chargeNow": "NOT_SUPPORTED",
            "chargingControl": "NOT_SUPPORTED",
            "climateControl": "DEPARTURE_TIMER",
            "climateControlRES": "NOT_SUPPORTED",
            "climateFunction": "VENTILATION",
            "climateNow": "ACTIVATED",
            "climateNowRES": "NOT_SUPPORTED",
            "color": "BLACK SAPPHIRE METALLIC",
            "colorCode": "475",
            "countryCode": "V2-US",
            "dealer": {
                "city": "Removed",
                "country": "US",
                "name": "Removed,
                "phone": "Removed",
                "postalCode": "Removed",
                "street": "Removed"
            },
            "doorLock": "ACTIVATED",
            "doorUnlock": "ACTIVATED",
            "driveTrain": "CONV",
            "exFactoryPUStep": null,
            "fuelType": "PETROL",
            "hasAlarmSystem": true,
            "hmiVersion": "ID4",
            "hornBlow": "ACTIVATED",
            "hub": "HUB_US",
            "intermodalRouting": "NOT_AVAILABLE",
            "ipa": "NOT_SUPPORTED",
            "lastDestinations": "NOT_SUPPORTED",
            "lightFlash": "ACTIVATED",
            "lscType": "NOT_SUPPORTED",
            "model": "X5 xDrive50i",
            "onlineSearchMode": "MAP",
            "puStep": "1213",
            "rangeMap": "NOT_SUPPORTED",
            "remote360": "NOT_SUPPORTED",
            "remoteSoftwareUpgrade": "NOT_SUPPORTED",
            "sendPoi": "ACTIVATED",
            "smartSolution": "NOT_SUPPORTED",
            "statisticsAvailable": false,
            "statisticsCommunityEnabled": false,
            "steering": "LH",
            "vehicleFinder": "ACTIVATED",
            "vehicleFinderRestriction": "NONE",
            "vin": "Removed",
            "yearOfConstruction": 2018
        }
    ]
}
FlyingDiver commented 4 years ago

Grab the latest commit, turn on debug logging, and restart the plugin. https://github.com/FlyingDiver/Indigo-BMW-CD Let's see what's in the data instead since there's no vehicleStatus.

smeee-again commented 4 years ago
   Starting plugin "BMW Connected Drive 0.0.6" (pid 13044)
   BMW Connected Drive Debug       logLevel = 5
   Started plugin "BMW Connected Drive 0.0.6"
   BMW Connected Drive             Starting Connected Drive
   BMW Connected Drive Debug       updateFrequency = 3600.0
   BMW Connected Drive             BMW X5 50i: Starting cdVehicle Device
   BMW Connected Drive Threaddebug BMW X5 50i: getDeviceStateList, base state_list = States : (list)
     Item : (dict)
          Disabled : false (bool)
          Key : status (string)
          StateLabel : UI Status (string)
          TriggerLabel : UI Status (string)
          Type : 150 (integer)
   BMW Connected Drive Threaddebug BMW X5 50i: getDeviceStateList, final state_list = States : (list)
     Item : (dict)
          Disabled : false (bool)
          Key : status (string)
          StateLabel : UI Status (string)
          TriggerLabel : UI Status (string)
          Type : 150 (integer)
   BMW Connected Drive             BMW Connected Drive: Starting cdAccount Device
   BMW Connected Drive Threaddebug Auth Info =
{
    "access_token": "Removed",
    "expires_in": 3600,
    "refresh_token": "Removed",
    "scope": "vehicle_data remote_services authenticate_user",
    "token_type": "Bearer"
}
   BMW Connected Drive Debug       ConnectedDrive get_tokens: token Removed, Expires in 3600
   BMW Connected Drive Threaddebug BMW Connected Drive: getDeviceStateList, base state_list = States : (list)
     Item : (dict)
          Disabled : false (bool)
          Key : authenticated (string)
          StateLabel : Authenticated (yes or no) (string)
          TriggerLabel : Authenticated (string)
          Type : 52 (integer)
   BMW Connected Drive Threaddebug BMW Connected Drive: getDeviceStateList, final state_list = States : (list)
     Item : (dict)
          Disabled : false (bool)
          Key : authenticated (string)
          StateLabel : Authenticated (yes or no) (string)
          TriggerLabel : Authenticated (string)
          Type : 52 (integer)
   BMW Connected Drive Debug       runConcurrentThread starting
   BMW Connected Drive Debug       ConnectedDrive update_vehicles
   BMW Connected Drive Debug       ConnectedDrive no vehicleStatus, data =
{u'error': {u'code': 500, u'description': u'(SmartPhoneUtil-A-101) Mandatory parameter(s) missed or blank: dlat and dlon are required for BMW vehicles!'}}
   BMW Connected Drive Threaddebug update_vehicles account_data =
{
    "vehicles": [
        {
            "a4a": "NOT_SUPPORTED",
            "bodytype": "F15",
            "brand": "BMW",
            "breakdownNumber": "+4989358957103",
            "carCloud": "NOT_SUPPORTED",
            "chargeNow": "NOT_SUPPORTED",
            "chargingControl": "NOT_SUPPORTED",
            "climateControl": "DEPARTURE_TIMER",
            "climateControlRES": "NOT_SUPPORTED",
            "climateFunction": "VENTILATION",
            "climateNow": "ACTIVATED",
            "climateNowRES": "NOT_SUPPORTED",
            "color": "BLACK SAPPHIRE METALLIC",
            "colorCode": "475",
            "countryCode": "V2-US",
            "dealer": {
                "city": "Removed",
                "country": "US",
                "name": "Removed",
                "phone": "+Removed",
                "postalCode": "Removed",
                "street": "Removed"
            },
            "doorLock": "ACTIVATED",
            "doorUnlock": "ACTIVATED",
            "driveTrain": "CONV",
            "exFactoryPUStep": null,
            "fuelType": "PETROL",
            "hasAlarmSystem": true,
            "hmiVersion": "ID4",
            "hornBlow": "ACTIVATED",
            "hub": "HUB_US",
            "intermodalRouting": "NOT_AVAILABLE",
            "ipa": "NOT_SUPPORTED",
            "lastDestinations": "NOT_SUPPORTED",
            "lightFlash": "ACTIVATED",
            "lscType": "NOT_SUPPORTED",
            "model": "X5 xDrive50i",
            "onlineSearchMode": "MAP",
            "puStep": "1213",
            "rangeMap": "NOT_SUPPORTED",
            "remote360": "NOT_SUPPORTED",
            "remoteSoftwareUpgrade": "NOT_SUPPORTED",
            "sendPoi": "ACTIVATED",
            "smartSolution": "NOT_SUPPORTED",
            "statisticsAvailable": false,
            "statisticsCommunityEnabled": false,
            "steering": "LH",
            "vehicleFinder": "ACTIVATED",
            "vehicleFinderRestriction": "NONE",
            "vin": "Removed",
            "yearOfConstruction": 2018
        }
    ]
}
   BMW Connected Drive Debug       ConnectedDrive get_vehicle_data: Removed
   BMW Connected Drive Threaddebug BMW X5 50i: get_vehicle_data for Removed =
{u'sendPoi': u'ACTIVATED', u'lastDestinations': u'NOT_SUPPORTED', u'countryCode': u'V2-US', u'carCloud': u'NOT_SUPPORTED', u'color': u'BLACK SAPPHIRE METALLIC', u'vin': u'VIN Removed', u'climateControl': u'DEPARTURE_TIMER', u'ipa': u'NOT_SUPPORTED', u'puStep': u'1213', u'climateNow': u'ACTIVATED', u'hasAlarmSystem': True, u'climateControlRES': u'NOT_SUPPORTED', u'fuelType': u'PETROL', u'dealer': {u'city': u'Removed', u'name': u'Removed', u'country': u'US', u'phone': u'Removed', u'street': u'Removed', u'postalCode': u'Removed'}, u'remote360': u'NOT_SUPPORTED', u'smartSolution': u'NOT_SUPPORTED', u'vehicleFinder': u'ACTIVATED', u'a4a': u'NOT_SUPPORTED', u'colorCode': u'475', u'lscType': u'NOT_SUPPORTED', u'rangeMap': u'NOT_SUPPORTED', u'climateFunction': u'VENTILATION', u'statisticsCommunityEnabled': False, u'doorUnlock': u'ACTIVATED', u'chargeNow': u'NOT_SUPPORTED', u'hmiVersion': u'ID4', u'breakdownNumber': u'+4989358957103', u'driveTrain': u'CONV', u'hub': u'HUB_US', u'brand': u'BMW', u'climateNowRES': u'NOT_SUPPORTED', u'exFactoryPUStep': None, u'statisticsAvailable': False, u'yearOfConstruction': 2018, u'vehicleFinderRestriction': u'NONE', u'steering': u'LH', u'hornBlow': u'ACTIVATED', u'remoteSoftwareUpgrade': u'NOT_SUPPORTED', u'bodytype': u'F15', u'lightFlash': u'ACTIVATED', u'intermodalRouting': u'NOT_AVAILABLE', u'doorLock': u'ACTIVATED', u'model': u'X5 xDrive50i', u'onlineSearchMode': u'MAP', u'chargingControl': u'NOT_SUPPORTED'}
   BMW Connected Drive Debug       ConnectedDrive get_vehicle_status: VIN Removed
   BMW Connected Drive Error       Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 140, in runConcurrentThread
  File "plugin.py", line 181, in updateVehicle
  File "/Library/Application Support/Perceptive Automation/Indigo 7.4/Plugins/BMW ConnectedDrive.indigoPlugin/Contents/Server Plugin/bmwcdapi.py", line 160, in get_vehicle_status
KeyError: u'VIN Removed'

   BMW Connected Drive Error       plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
   BMW Connected Drive Debug       runConcurrentThread starting
FlyingDiver commented 4 years ago

Hmm. I have no idea what this means:

{u'error': {u'code': 500, u'description': u'(SmartPhoneUtil-A-101) Mandatory parameter(s) missed or blank: dlat and dlon are required for BMW vehicles!'}}

FlyingDiver commented 4 years ago

Looks like it's the same as this: https://github.com/bimmerconnected/bimmer_connected/issues/62

I'll look into that and see if I can do something to get around it.

smeee-again commented 4 years ago

No rush. It is the previous generation system. I'm not quite sure what I'd get out of the plugin. Albeit, I have thought about buying a used i3 for a dog vehicle.

FlyingDiver commented 4 years ago

Grab the latest commit and see if that works. I added lat/long of the Indigo server to the status request.

smeee-again commented 4 years ago
Apr 3, 2020 at 10:53:22 AM
   Enabling plugin "BMW Connected Drive 0.0.6"
   Starting plugin "BMW Connected Drive 0.0.6" (pid 20655)
   BMW Connected Drive Debug       logLevel = 5
   Started plugin "BMW Connected Drive 0.0.6"
   BMW Connected Drive             Starting Connected Drive
   BMW Connected Drive Debug       updateFrequency = 3600.0
   BMW Connected Drive             BMW X5 50i: Starting cdVehicle Device
   BMW Connected Drive Threaddebug BMW X5 50i: getDeviceStateList, base state_list = States : (list)
     Item : (dict)
          Disabled : false (bool)
          Key : status (string)
          StateLabel : UI Status (string)
          TriggerLabel : UI Status (string)
          Type : 150 (integer)
   BMW Connected Drive Threaddebug BMW X5 50i: getDeviceStateList, final state_list = States : (list)
     Item : (dict)
          Disabled : false (bool)
          Key : status (string)
          StateLabel : UI Status (string)
          TriggerLabel : UI Status (string)
          Type : 150 (integer)
   BMW Connected Drive             BMW Connected Drive: Starting cdAccount Device
   BMW Connected Drive Threaddebug Auth Info =
{
    "access_token": "Removed",
    "expires_in": 3600,
    "refresh_token": "Removed",
    "scope": "vehicle_data remote_services authenticate_user",
    "token_type": "Bearer"
}
   BMW Connected Drive Debug       ConnectedDrive get_tokens: token Removed, Expires in 3600
   BMW Connected Drive Threaddebug BMW Connected Drive: getDeviceStateList, base state_list = States : (list)
     Item : (dict)
          Disabled : false (bool)
          Key : authenticated (string)
          StateLabel : Authenticated (yes or no) (string)
          TriggerLabel : Authenticated (string)
          Type : 52 (integer)
   BMW Connected Drive Threaddebug BMW Connected Drive: getDeviceStateList, final state_list = States : (list)
     Item : (dict)
          Disabled : false (bool)
          Key : authenticated (string)
          StateLabel : Authenticated (yes or no) (string)
          TriggerLabel : Authenticated (string)
          Type : 52 (integer)
   BMW Connected Drive Debug       runConcurrentThread starting
   BMW Connected Drive Debug       ConnectedDrive update_vehicles
   BMW Connected Drive Debug       ConnectedDrive no vehicleStatus, data =
{u'error': {u'code': 500, u'description': u'(SmartPhoneUtil-A-101) Mandatory parameter(s) missed or blank: dlat and dlon are required for BMW vehicles!'}}
   BMW Connected Drive Threaddebug update_vehicles account_data =
{
    "vehicles": [
        {
            "a4a": "NOT_SUPPORTED",
            "bodytype": "F15",
            "brand": "BMW",
            "breakdownNumber": "+4989358957103",
            "carCloud": "NOT_SUPPORTED",
            "chargeNow": "NOT_SUPPORTED",
            "chargingControl": "NOT_SUPPORTED",
            "climateControl": "DEPARTURE_TIMER",
            "climateControlRES": "NOT_SUPPORTED",
            "climateFunction": "VENTILATION",
            "climateNow": "ACTIVATED",
            "climateNowRES": "NOT_SUPPORTED",
            "color": "BLACK SAPPHIRE METALLIC",
            "colorCode": "475",
            "countryCode": "V2-US",
            "dealer": {
                "city": "Removed",
                "country": "US",
                "name": "Removed",
                "phone": "Removed",
                "postalCode": "Removed",
                "street": "Removed"
            },
            "doorLock": "ACTIVATED",
            "doorUnlock": "ACTIVATED",
            "driveTrain": "CONV",
            "exFactoryPUStep": null,
            "fuelType": "PETROL",
            "hasAlarmSystem": true,
            "hmiVersion": "ID4",
            "hornBlow": "ACTIVATED",
            "hub": "HUB_US",
            "intermodalRouting": "NOT_AVAILABLE",
            "ipa": "NOT_SUPPORTED",
            "lastDestinations": "NOT_SUPPORTED",
            "lightFlash": "ACTIVATED",
            "lscType": "NOT_SUPPORTED",
            "model": "X5 xDrive50i",
            "onlineSearchMode": "MAP",
            "puStep": "1213",
            "rangeMap": "NOT_SUPPORTED",
            "remote360": "NOT_SUPPORTED",
            "remoteSoftwareUpgrade": "NOT_SUPPORTED",
            "sendPoi": "ACTIVATED",
            "smartSolution": "NOT_SUPPORTED",
            "statisticsAvailable": false,
            "statisticsCommunityEnabled": false,
            "steering": "LH",
            "vehicleFinder": "ACTIVATED",
            "vehicleFinderRestriction": "NONE",
            "vin": "Removed",
            "yearOfConstruction": 2018
        }
    ]
}
   BMW Connected Drive Debug       ConnectedDrive get_vehicle_data: Removed
   BMW Connected Drive Threaddebug BMW X5 50i: get_vehicle_data for Removed =
{u'sendPoi': u'ACTIVATED', u'lastDestinations': u'NOT_SUPPORTED', u'countryCode': u'V2-US', u'carCloud': u'NOT_SUPPORTED', u'color': u'BLACK SAPPHIRE METALLIC', u'vin': u'Removed', u'climateControl': u'DEPARTURE_TIMER', u'ipa': u'NOT_SUPPORTED', u'puStep': u'1213', u'climateNow': u'ACTIVATED', u'hasAlarmSystem': True, u'climateControlRES': u'NOT_SUPPORTED', u'fuelType': u'PETROL', u'dealer': {u'city': u'Removed', u'name': u'Removed', u'country': u'US', u'phone': u'Removed', u'street': u'Removed', u'postalCode': u'Removed'}, u'remote360': u'NOT_SUPPORTED', u'smartSolution': u'NOT_SUPPORTED', u'vehicleFinder': u'ACTIVATED', u'a4a': u'NOT_SUPPORTED', u'colorCode': u'475', u'lscType': u'NOT_SUPPORTED', u'rangeMap': u'NOT_SUPPORTED', u'climateFunction': u'VENTILATION', u'statisticsCommunityEnabled': False, u'doorUnlock': u'ACTIVATED', u'chargeNow': u'NOT_SUPPORTED', u'hmiVersion': u'ID4', u'breakdownNumber': u'+4989358957103', u'driveTrain': u'CONV', u'hub': u'HUB_US', u'brand': u'BMW', u'climateNowRES': u'NOT_SUPPORTED', u'exFactoryPUStep': None, u'statisticsAvailable': False, u'yearOfConstruction': 2018, u'vehicleFinderRestriction': u'NONE', u'steering': u'LH', u'hornBlow': u'ACTIVATED', u'remoteSoftwareUpgrade': u'NOT_SUPPORTED', u'bodytype': u'F15', u'lightFlash': u'ACTIVATED', u'intermodalRouting': u'NOT_AVAILABLE', u'doorLock': u'ACTIVATED', u'model': u'X5 xDrive50i', u'onlineSearchMode': u'MAP', u'chargingControl': u'NOT_SUPPORTED'}
   BMW Connected Drive Debug       ConnectedDrive get_vehicle_status: Removed
   BMW Connected Drive Error       Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 140, in runConcurrentThread
  File "plugin.py", line 181, in updateVehicle
  File "/Library/Application Support/Perceptive Automation/Indigo 7.4/Plugins/BMW ConnectedDrive.indigoPlugin/Contents/Server Plugin/bmwcdapi.py", line 160, in get_vehicle_status
KeyError: u'Removed'

   BMW Connected Drive Error       plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
   BMW Connected Drive Debug       runConcurrentThread starting
FlyingDiver commented 4 years ago

Try it again, new commit.

smeee-again commented 4 years ago

Sorry for the delay, I had to work. New error though:

Apr 3, 2020 at 6:14:36 PM Enabling plugin "BMW Connected Drive 0.0.6" Starting plugin "BMW Connected Drive 0.0.6" (pid 25063) BMW Connected Drive Error Error in plugin execution InitializeMain:

Traceback (most recent call last): File "plugin.py", line 9, in SyntaxError: ('invalid syntax', ('/Library/Application Support/Perceptive Automation/Indigo 7.4/Plugins/BMW ConnectedDrive.indigoPlugin/Contents/Server Plugin/bmwcdapi.py', 171, 12, ' else:\n'))

Stopping plugin "BMW Connected Drive 0.0.6" (pid 25063) Stopped plugin "BMW Connected Drive 0.0.6" Error (client) _setCurrentPluginDeviceType() caught exception: PacketTargetNotConnectedError -- plugin BMW Connected Drive is not enabled

Reloading plugin "BMW Connected Drive 0.0.6" Starting plugin "BMW Connected Drive 0.0.6" (pid 25072) BMW Connected Drive Error Error in plugin execution InitializeMain:

Traceback (most recent call last): File "plugin.py", line 9, in SyntaxError: ('invalid syntax', ('/Library/Application Support/Perceptive Automation/Indigo 7.4/Plugins/BMW ConnectedDrive.indigoPlugin/Contents/Server Plugin/bmwcdapi.py', 171, 12, ' else:\n'))

Stopping plugin "BMW Connected Drive 0.0.6" (pid 25072) Stopped plugin "BMW Connected Drive 0.0.6"

FlyingDiver commented 4 years ago

Stupid mistake. Try the latest commit.

smeee-again commented 4 years ago

Let me know if you need the full debug logging or if this is enough:

BMW Connected Drive Error Error in plugin execution runConcurrentThread:

Traceback (most recent call last): File "plugin.py", line 140, in runConcurrentThread File "plugin.py", line 191, in updateVehicle KeyError: u''

BMW Connected Drive Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds) BMW Connected Drive Debug runConcurrentThread starting

FlyingDiver commented 4 years ago

OK, trying to do without the vehicle status isn't as simple as I had hoped. I'll look at this again over the weekend.

smeee-again commented 4 years ago

I think the issue is that BMW has made changes and have various hardware. The CIC (iDrive 3.0) days saw some ConnectedDrive capabilities. This was further added too when NBT (iDrive 4.0) was introduced. Then even more was added with the NBT EVO. The latest is MGU (iDrive 7.0) which is what you have. So on the backend I'm sure BMW had added additional fields for new stuff but there are plenty of former generations of hardware that have no clue about the newer features and those fields are thus blank on the BMW ConnectedDrive site. So it might be making the plugin could be a little tricky to handle older hardware. Imagine the software developers at BMW that have to figure it all out; the app on the phone stays the same.

I'm pretty sure you don't want to have the user select which system they have as many wouldn't know. You can't go by model year either as there are times where one model get the new hardware and another model didn't. Then you have the Z4 which ran the CIC (iDrive 3.0) until the new 2020 Z4 was released. No other model used CIC after 2015 (7 series was 2015 and most others were 2012/2013 timeframe). So the Z4 was using really old hardware all the way until 2019.

FlyingDiver commented 4 years ago

I need to change the debug logging code so it dumps out what it's actually getting before it tries to parse it. Maybe I can figure out how to deal with an older system.

FlyingDiver commented 4 years ago

OK, more changes made. If it runs without crashing, set the logging to "Detailed Debugging", restart the plugin, and post the initial sections. Mainly I want the sections starting with:

   BMW Connected Drive Threaddebug Account Data =

   BMW Connected Drive Threaddebug Vehicle Data for XXXXX =

If you don't want to sanitize the data, send me a PM on the Indigo forums and I'll give you my email to send them to me directly.

smeee-again commented 4 years ago

Here you are:

Apr 9, 2020 at 5:39:35 PM
   Enabling plugin "BMW Connected Drive 0.0.6"
   Starting plugin "BMW Connected Drive 0.0.6" (pid 11656)
   BMW Connected Drive Debug       logLevel = 5
   Started plugin "BMW Connected Drive 0.0.6"
   BMW Connected Drive             Starting Connected Drive
   BMW Connected Drive Debug       updateFrequency = 3600.0
   BMW Connected Drive             BMW X5 50i: Starting cdVehicle Device
   BMW Connected Drive Threaddebug BMW X5 50i: getDeviceStateList, base state_list = States : (list)
     Item : (dict)
          Disabled : false (bool)
          Key : status (string)
          StateLabel : UI Status (string)
          TriggerLabel : UI Status (string)
          Type : 150 (integer)
   BMW Connected Drive Threaddebug BMW X5 50i: getDeviceStateList, final state_list = States : (list)
     Item : (dict)
          Disabled : false (bool)
          Key : status (string)
          StateLabel : UI Status (string)
          TriggerLabel : UI Status (string)
          Type : 150 (integer)
   BMW Connected Drive             BMW Connected Drive: Starting cdAccount Device
   BMW Connected Drive Threaddebug Auth Info =
{
    "access_token": "REMOVED",
    "expires_in": 3600,
    "refresh_token": "REMOVED",
    "scope": "vehicle_data remote_services authenticate_user",
    "token_type": "Bearer"
}
   BMW Connected Drive Debug       ConnectedDrive get_tokens Succesful, Expires in 3600
   BMW Connected Drive Threaddebug BMW Connected Drive: getDeviceStateList, base state_list = States : (list)
     Item : (dict)
          Disabled : false (bool)
          Key : authenticated (string)
          StateLabel : Authenticated (yes or no) (string)
          TriggerLabel : Authenticated (string)
          Type : 52 (integer)
   BMW Connected Drive Threaddebug BMW Connected Drive: getDeviceStateList, final state_list = States : (list)
     Item : (dict)
          Disabled : false (bool)
          Key : authenticated (string)
          StateLabel : Authenticated (yes or no) (string)
          TriggerLabel : Authenticated (string)
          Type : 52 (integer)
   BMW Connected Drive Debug       runConcurrentThread starting
   BMW Connected Drive Debug       ConnectedDrive update_vehicles
   BMW Connected Drive Threaddebug Account Data =
{
    "vehicles": [
        {
            "a4a": "NOT_SUPPORTED",
            "bodytype": "F15",
            "brand": "BMW",
            "breakdownNumber": "+4989358957103",
            "carCloud": "NOT_SUPPORTED",
            "chargeNow": "NOT_SUPPORTED",
            "chargingControl": "NOT_SUPPORTED",
            "climateControl": "DEPARTURE_TIMER",
            "climateControlRES": "NOT_SUPPORTED",
            "climateFunction": "VENTILATION",
            "climateNow": "ACTIVATED",
            "climateNowRES": "NOT_SUPPORTED",
            "color": "BLACK SAPPHIRE METALLIC",
            "colorCode": "475",
            "countryCode": "V2-US",
            "dealer": {
                "city": "REMOVED",
                "country": "US",
                "name": "REMOVED",
                "phone": "REMOVED",
                "postalCode": "REMOVED",
                "street": "REMOVED"
            },
            "doorLock": "ACTIVATED",
            "doorUnlock": "ACTIVATED",
            "driveTrain": "CONV",
            "exFactoryPUStep": null,
            "fuelType": "PETROL",
            "hasAlarmSystem": true,
            "hmiVersion": "ID4",
            "hornBlow": "ACTIVATED",
            "hub": "HUB_US",
            "intermodalRouting": "NOT_AVAILABLE",
            "ipa": "NOT_SUPPORTED",
            "lastDestinations": "NOT_SUPPORTED",
            "lightFlash": "ACTIVATED",
            "lscType": "NOT_SUPPORTED",
            "model": "X5 xDrive50i",
            "onlineSearchMode": "MAP",
            "puStep": "1213",
            "rangeMap": "NOT_SUPPORTED",
            "remote360": "NOT_SUPPORTED",
            "remoteSoftwareUpgrade": "NOT_SUPPORTED",
            "sendPoi": "ACTIVATED",
            "smartSolution": "NOT_SUPPORTED",
            "statisticsAvailable": false,
            "statisticsCommunityEnabled": false,
            "steering": "LH",
            "vehicleFinder": "ACTIVATED",
            "vehicleFinderRestriction": "NONE",
            "vin": "REMOVED",
            "yearOfConstruction": 2018
        }
    ]
}
   BMW Connected Drive Threaddebug Vehicle Data for REMOVED =
{
    "vehicleStatus": {
        "DCS_CCH_Activation": "NA",
        "DCS_CCH_Ongoing": false,
        "position": {
            "lat": REMOVED,
            "lon": -REMOVED,
            "status": "OK"
        },
        "updateTime": "2018-04-29T18:57:21+0000",
        "vehicleCountry": "US",
        "vin": "REMOVED"
    }
}
   BMW Connected Drive Threaddebug update_vehicles account_data =
{
    "REMOVED": {
        "DCS_CCH_Activation": "NA",
        "DCS_CCH_Ongoing": false,
        "position": {
            "lat": REMOVED,
            "lon": -REMOVED,
            "status": "OK"
        },
        "updateTime": "2018-04-29T18:57:21+0000",
        "vehicleCountry": "US",
        "vin": "REMOVED"
    },
    "vehicles": [
        {
            "a4a": "NOT_SUPPORTED",
            "bodytype": "F15",
            "brand": "BMW",
            "breakdownNumber": "+4989358957103",
            "carCloud": "NOT_SUPPORTED",
            "chargeNow": "NOT_SUPPORTED",
            "chargingControl": "NOT_SUPPORTED",
            "climateControl": "DEPARTURE_TIMER",
            "climateControlRES": "NOT_SUPPORTED",
            "climateFunction": "VENTILATION",
            "climateNow": "ACTIVATED",
            "climateNowRES": "NOT_SUPPORTED",
            "color": "BLACK SAPPHIRE METALLIC",
            "colorCode": "475",
            "countryCode": "V2-US",
            "dealer": {
                "city": "REMOVED",
                "country": "US",
                "name": "REMOVED",
                "phone": "REMOVED",
                "postalCode": "REMOVED",
                "street": "REMOVED"
            },
            "doorLock": "ACTIVATED",
            "doorUnlock": "ACTIVATED",
            "driveTrain": "CONV",
            "exFactoryPUStep": null,
            "fuelType": "PETROL",
            "hasAlarmSystem": true,
            "hmiVersion": "ID4",
            "hornBlow": "ACTIVATED",
            "hub": "HUB_US",
            "intermodalRouting": "NOT_AVAILABLE",
            "ipa": "NOT_SUPPORTED",
            "lastDestinations": "NOT_SUPPORTED",
            "lightFlash": "ACTIVATED",
            "lscType": "NOT_SUPPORTED",
            "model": "X5 xDrive50i",
            "onlineSearchMode": "MAP",
            "puStep": "1213",
            "rangeMap": "NOT_SUPPORTED",
            "remote360": "NOT_SUPPORTED",
            "remoteSoftwareUpgrade": "NOT_SUPPORTED",
            "sendPoi": "ACTIVATED",
            "smartSolution": "NOT_SUPPORTED",
            "statisticsAvailable": false,
            "statisticsCommunityEnabled": false,
            "steering": "LH",
            "vehicleFinder": "ACTIVATED",
            "vehicleFinderRestriction": "NONE",
            "vin": "REMOVED",
            "yearOfConstruction": 2018
        }
    ]
}
   BMW Connected Drive Debug       ConnectedDrive get_vehicle_data: REMOVED
   BMW Connected Drive Threaddebug BMW X5 50i: get_vehicle_data for REMOVED =
{u'sendPoi': u'ACTIVATED', u'lastDestinations': u'NOT_SUPPORTED', u'countryCode': u'V2-US', u'carCloud': u'NOT_SUPPORTED', u'color': u'BLACK SAPPHIRE METALLIC', u'vin': u'REMOVED', u'climateControl': u'DEPARTURE_TIMER', u'ipa': u'NOT_SUPPORTED', u'puStep': u'1213', u'climateNow': u'ACTIVATED', u'hasAlarmSystem': True, u'climateControlRES': u'NOT_SUPPORTED', u'fuelType': u'PETROL', u'dealer': {u'city': u'REMOVED', u'name': u'REMOVED', u'country': u'US', u'phone': u'REMOVED', u'street': u'REMOVED', u'postalCode': u'REMOVED'}, u'remote360': u'NOT_SUPPORTED', u'smartSolution': u'NOT_SUPPORTED', u'vehicleFinder': u'ACTIVATED', u'a4a': u'NOT_SUPPORTED', u'colorCode': u'475', u'lscType': u'NOT_SUPPORTED', u'rangeMap': u'NOT_SUPPORTED', u'climateFunction': u'VENTILATION', u'statisticsCommunityEnabled': False, u'doorUnlock': u'ACTIVATED', u'chargeNow': u'NOT_SUPPORTED', u'hmiVersion': u'ID4', u'breakdownNumber': u'+4989358957103', u'driveTrain': u'CONV', u'hub': u'HUB_US', u'brand': u'BMW', u'climateNowRES': u'NOT_SUPPORTED', u'exFactoryPUStep': None, u'statisticsAvailable': False, u'yearOfConstruction': 2018, u'vehicleFinderRestriction': u'NONE', u'steering': u'LH', u'hornBlow': u'ACTIVATED', u'remoteSoftwareUpgrade': u'NOT_SUPPORTED', u'bodytype': u'F15', u'lightFlash': u'ACTIVATED', u'intermodalRouting': u'NOT_AVAILABLE', u'doorLock': u'ACTIVATED', u'model': u'X5 xDrive50i', u'onlineSearchMode': u'MAP', u'chargingControl': u'NOT_SUPPORTED'}
   BMW Connected Drive Debug       ConnectedDrive get_vehicle_status: REMOVED
   BMW Connected Drive Threaddebug BMW X5 50i: get_vehicle_status for REMOVED =
{u'updateTime': u'2018-04-29T18:57:21+0000', u'vin': u'REMOVED', u'vehicleCountry': u'US', u'DCS_CCH_Ongoing': False, u'position': {u'lat': REMOVED, u'status': u'OK', u'lon': -REMOVED}, u'DCS_CCH_Activation': u'NA'}
   BMW Connected Drive Error       Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 140, in runConcurrentThread
  File "plugin.py", line 188, in updateVehicle
KeyError: u''

   BMW Connected Drive Error       plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
   BMW Connected Drive Debug       runConcurrentThread starting
FlyingDiver commented 4 years ago

Can you edit that (or repost) with the VIN number explicitly identified, wherever it appears, rather than "REMOVED" everywhere? I use the VIN as a data key and I need to know where it's showing up in the data.

FlyingDiver commented 4 years ago

OK, I think I figured it out anyway. Try last commit.

smeee-again commented 4 years ago

Sorry about the delayed response. The client has been moving projects up; things that were planned to be done in the second half of the year are well, moved to now.

I installed the latest commit (I downloaded it a few minutes ago) and it runs without errors. So it appears to be good.