New Plugin - BMW Connected Drive

Posted on
Sun Aug 15, 2021 5:59 pm
Turribeach offline
Posts: 429
Joined: Feb 06, 2015
Location: London, UK

Re: New Plugin - BMW Connected Drive

I got version 1.0.4 from Github but it's not working properly, this is what I get:

BMW Connected Drive Debug runConcurrentThread starting
BMW Connected Drive Debug Send wrapper message: {"cmd": "vehicles"}
BMW Connected Drive Debug wrapper_read JSON decode error:

I see that you are using the bimmer-connected library in your plugin. I installed version 0.7.18 on my Python 3 env and it's working fine for me outsiode the plugin. The library releases page shows they have fixed the login issues. So looks like you just need to update the library version inside the plugin and it should work. I tried replacing the bimmer-connected library inside the plugin installation directory (/Library/Application Support/Perceptive Automation/Indigo 2021.1/Plugins/BMW ConnectedDrive.indigoPlugin/Contents/Server Plugin/bimmer_connected) but it didn't work, not sure if that hack is possible but thought it was worth a try.

Posted on
Sun Aug 15, 2021 6:03 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: New Plugin - BMW Connected Drive

Yeah, they were still dorking around trying to fix it last I checked. I'll see if I can get an update out soon.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Mon Aug 16, 2021 10:05 am
ryanbuckner offline
Posts: 1074
Joined: Oct 08, 2011
Location: Northern Virginia

Re: New Plugin - BMW Connected Drive

I'm getting login errors too:

Code: Select all
Aug 16, 2021 at 9:17:52 AM
   BMW Connected Drive Error       BMW Account: [u'Authentication failed. Maybe your password is invalid?']

Posted on
Sat Sep 04, 2021 9:46 am
ryanbuckner offline
Posts: 1074
Joined: Oct 08, 2011
Location: Northern Virginia

Re: New Plugin - BMW Connected Drive

Turribeach wrote:
I got version 1.0.4 from Github but it's not working properly, this is what I get:

BMW Connected Drive Debug runConcurrentThread starting
BMW Connected Drive Debug Send wrapper message: {"cmd": "vehicles"}
BMW Connected Drive Debug wrapper_read JSON decode error:

I see that you are using the bimmer-connected library in your plugin. I installed version 0.7.18 on my Python 3 env and it's working fine for me outsiode the plugin. The library releases page shows they have fixed the login issues. So looks like you just need to update the library version inside the plugin and it should work. I tried replacing the bimmer-connected library inside the plugin installation directory (/Library/Application Support/Perceptive Automation/Indigo 2021.1/Plugins/BMW ConnectedDrive.indigoPlugin/Contents/Server Plugin/bimmer_connected) but it didn't work, not sure if that hack is possible but thought it was worth a try.


@Turribeach did you have any luck getting this working?

Posted on
Wed Sep 08, 2021 3:17 am
Turribeach offline
Posts: 429
Joined: Feb 06, 2015
Location: London, UK

Re: New Plugin - BMW Connected Drive

No, when I attempted to hack the new library version into the plugin it didn't work so I was waiting for joe to update the BMW library in the plugin and release a new version.

Posted on
Sat Sep 18, 2021 8:42 am
ryanbuckner offline
Posts: 1074
Joined: Oct 08, 2011
Location: Northern Virginia

Re: New Plugin - BMW Connected Drive

Turribeach wrote:
No, when I attempted to hack the new library version into the plugin it didn't work so I was waiting for joe to update the BMW library in the plugin and release a new version.


I tried the same. Didn't work.

Posted on
Mon Apr 11, 2022 10:59 am
ryanbuckner offline
Posts: 1074
Joined: Oct 08, 2011
Location: Northern Virginia

Re: New Plugin - BMW Connected Drive

FlyingDiver wrote:
Yeah, they were still dorking around trying to fix it last I checked. I'll see if I can get an update out soon.


it looks like there has been progress made here to combine the latest and greatest libraries

https://github.com/bimmerconnected/bimmer_connected

Posted on
Sun Apr 17, 2022 11:53 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: New Plugin - BMW Connected Drive

I'm working on the Python3 version of this plugin for Indigo 2022.1. The updated bimmer_connected library is considerably different than what I was using before, and makes available a LOT of information on each vehicle. Way more than I can shoehorn into an Indigo device.

So, what I need from current users is a list of the information you actually need from the plugin. I'll definitely be doing simple stuff like fuel level and range remaining. Probably also door/window/lock states.

Just FYI, here's a (partial) list of the data I'm getting back from the API.
Code: Select all
{
    'attributes':
    {
        'vin': '5UX2V5C08L9BXXXXX',
        'model': 'X4 M40i',
        'year': 2019,
        'brand': 'BMW',
        'headUnit': 'MGU',
        'isLscSupported': True,
        'driveTrain': 'COMBUSTION',
        'puStep': '0321',
        'iStep': 'S15A-21-03-582',
        'telematicsUnit': 'ATM02',
        'hmiVersion': 'id7',
        'bodyType': 'G02',
        'a4aType': 'NOT_SUPPORTED',
        'capabilities':
        {
            'isRemoteServicesBookingRequired': False,
            'isRemoteServicesActivationRequired': False,
            'lock':
            {'
                isEnabled': True,
                'isPinAuthenticationRequired': False,
                executionMessage': 'Lock your vehicle now? Remote functions may take a few seconds.'
            },
            'unlock':
            {
                'isEnabled': True,
                'isPinAuthenticationRequired': True,
                'executionMessage': 'Unlock your vehicle now? Remote functions may take a few seconds.'
            },
            'lights':
            {
                'isEnabled': True,
                'isPinAuthenticationRequired': False,
                'executionMessage': 'Flash headlights now? Remote functions may take a few seconds.'
            },
            'horn':
            {
                'isEnabled': True,
                'isPinAuthenticationRequired': False,
                'executionMessage': 'Using your horn is only allowed in certain situations in many countries. Responsibility for the use and adherence to the respective regulations lies solely with you as the user. \n\nDo you want to use the horn now? Remote functions may take a few seconds.'
            },
            'vehicleFinder':
            {
                'isEnabled': True,
                'isPinAuthenticationRequired': False,
                'executionMessage': 'Find your vehicle now? Remote functions may take a few seconds.'
            },
            'speechThirdPartyAlexa':
            {
                'isEnabled': True, '
                isPinAuthenticationRequired': False,
                'executionMessage': 'Activate Alexa now? Remote functions may take a few seconds.'
            },
            'sendPoi':
            {'
                isEnabled': True,
                'isPinAuthenticationRequired': False,
                'executionMessage': 'Send POI now? Remote functions may take a few seconds.'
            },
            'lastStateCall':
            {
                'isNonLscFeatureEnabled': False,
                'lscState': 'ACTIVATED'
            },
            'climateNow':
            {
                'isEnabled': True, '
                isPinAuthenticationRequired': False,
                'executionMessage': 'Do you want to ventilate now? Remote functions may take a few seconds.',
                'executionPopup':
                {
                    'executionMessage': 'Do you want to ventilate now? Remote functions may take a few seconds.',
                    'popupType': 'DIALOG',
                    'title': 'Start Ventilation',
                    'primaryButtonText': 'Start',
                    'secondaryButtonText': 'Cancel',
                    'iconId': 59733
                },
                'executionStopPopup':
                {
                    'executionMessage': 'Stop climate control in your vehicle now? Remote functions may take a few seconds.',
                    'title': 'Climate control is running'
                }
            },
            'isRemoteHistorySupported': True,
            'canRemoteHistoryBeDeleted': False,
            'remote360':
            {
                'isEnabled': True,
                'isToggleEnabled': True,
                'isComingSoonEnabled': False,
                'isPinAuthenticationRequired': False,
                'isDataPrivacyEnabled': False
            },
            'climateTimer':
            {
                'isEnabled': True,
                'isPinAuthenticationRequired': False,
                'tile':
                {
                    'iconId': 59774,
                    'title': 'Ventilation timer',
                    'description': 'Set departure time'
                },
                'page':
                {
                    'primaryButtonText': 'SEND TO VEHICLE',
                    'secondaryButtonText': 'DEACTIVATE AND SEND TO VEHICLE',
                    'title': 'Ventilation timer',
                    'subtitle': 'Set departure time',
                    'description': 'By setting a departure time you let the vehicle know when you plan to use it.'
                }, '
                isToggleEnabled': True
            },
            'isChargingHistorySupported': False,
            'isScanAndChargeSupported': False,
            'isDCSContractManagementSupported': False,
            'isBmwChargingSupported': False,
            'isMiniChargingSupported': False,
            'isChargeNowForBusinessSupported': False,
            'isDataPrivacyEnabled': False,
            'isChargingPlanSupported': False,
            'isChargingPowerLimitEnable': False,
            'isChargingTargetSocEnable': False,
            'isChargingLoudnessEnable': False,
            'isChargingSettingsEnabled': False,
            'isChargingHospitalityEnabled': False,
            'isEvGoChargingSupported': False,
            'isFindChargingEnabled': False,
            'isCustomerEsimSupported': False,
            'isCarSharingSupported': False,
            'isEasyChargeSupported': False,
            'isSustainabilitySupported': False,
            'specialThemeSupport': [],
            'isRemoteParkingSupported': False
        },
        'connectedDriveServices': [],
        'isMappingPending': False,
        'isMappingUnconfirmed': False,
        'driverGuideInfo':
        {
            'title': "BMW\nDriver's Guide",
            'androidAppScheme': 'com.bmwgroup.driversguide.usa',
            'iosAppScheme': 'bmwdriversguide:///open',
            'androidStoreUrl': 'https://play.google.com/store/apps/details?id=com.bmwgroup.driversguide.usa',
            'iosStoreUrl': 'https://apps.apple.com/us/app/id714042570?mt=8'
        },
        'themeSpecs':
        {
            'vehicleStatusBackgroundColor':
            {
                'red': 127,
                'green': 129,
                'blue': 133
            }
        },
        'exFactoryPUStep': '0719',
        'exFactoryILevel': 'S15A-19-07-553'
    },
    'status': <bimmer_connected.vehicle_status.VehicleStatus object at 0x10679b1f0>,
    'observer_latitude': None,
    'observer_longitude': None,
    'available_attributes': ['gps_position', 'vin', 'remaining_range_total', 'mileage', 'remaining_fuel', 'remaining_range_fuel', 'fuel_percent', 'condition_based_services', 'check_control_messages', 'door_lock_state', 'timestamp', 'last_update_reason', 'lids', 'windows'],
    'available_state_services': ['status'],
    'brand': <CarBrand.BMW: 'bmw'>,
    'charging_profile': None,
    'drive_train': <DriveTrainType.COMBUSTION: 'COMBUSTION'>,
    'drive_train_attributes': ['remaining_range_total', 'mileage', 'remaining_fuel', 'remaining_range_fuel', 'fuel_percent'],
    'has_hv_battery': False,
    'has_internal_combustion_engine': True,
    'has_range_extender': False,
    'has_weekly_planner_service': False,
    'is_vehicle_tracking_enabled': True,
    'lsc_type': <LscType.ACTIVATED: 'ACTIVATED'>,
    'name': 'X4 M40i'
}


{
    'status':
    {
        'lastUpdatedAt': '2022-04-15T14:08:28Z',
        'currentMileage':
        {
            'mileage': 11154,
            'units': 'mi',
            'formattedMileage': '11154'
        },
        'issues': {},
        'doorsGeneralState': 'Unlocked',
        'checkControlMessagesGeneralState': 'No Issues',
        'doorsAndWindows':
        [
            {'iconId': 59737, 'title': 'Lock status', 'state': 'Unlocked', 'criticalness': 'nonCritical'},
            {'iconId': 59722, 'title': 'All doors', 'state': 'Closed', 'criticalness': 'nonCritical'},
            {'iconId': 59725, 'title': 'All windows', 'state': 'Closed', 'criticalness': 'nonCritical'},
            {'iconId': 59706, 'title': 'Hood', 'state': 'Closed', 'criticalness': 'nonCritical'},
            {'iconId': 59704, 'title': 'Trunk', 'state': 'Closed', 'criticalness': 'nonCritical'},
            {'iconId': 59705, 'title': 'Sunroof', 'state': 'Closed', 'criticalness': 'nonCritical'}
        ],
        'checkControlMessages':
        [
            {'criticalness': 'nonCritical', 'iconId': 60117, 'title': 'Tires', 'state': 'OK'},
            {'criticalness': 'nonCritical', 'iconId': 60197, 'title': 'Engine Oil', 'state': 'OK'}
        ],
        'requiredServices':
        [
            {'id': 'BrakeFluid', 'title': 'Brake fluid', 'iconId': 60223, 'longDescription': 'Next service due by the specified date.', 'subtitle': 'Due in October 2022', 'criticalness': 'nonCritical'},
            {'id': 'Oil', 'title': 'Engine oil', 'iconId': 60197, 'longDescription': 'Next service due after the specified distance or date.', 'subtitle': 'Due in November 2022 or 8997 mi', 'criticalness': 'nonCritical'},
            {'id': 'VehicleCheck', 'title': 'Vehicle check', 'iconId': 60215, 'longDescription': 'Next visual inspection due by specified date or, if shown, when stated distance has been reached.', 'subtitle': 'Due in November 2023 or 19001 mi', 'criticalness': 'nonCritical'}
        ],
        'recallMessages': [],
        'recallExternalUrl': 'https://www.bmwusa.com/safety-and-emission-recalls.html#5UX2V5C08L9BXXXXX',
        'fuelIndicators':
        [
            {
                'secondaryBarValue': 0,
                'infoIconId': 59930,
                'infoLabel': 'Fuel Level',
                'rangeIconId': 59681,
                'rangeUnits': 'mi',
                'rangeValue': '409',
                'levelIconId': 59682,
                'isCircleIcon': False,
                'iconOpacity': 'high',
                'chargingType': None,
                'mainBarValue': 100,
                'showsBar': True,
                'levelUnits': '%',
                'levelValue': '100',
                'isInaccurate': False
            }
        ],
        'timestampMessage': 'Updated from vehicle 4/16/2022 10:08 AM'
    },
    'properties':
    {
        'lastUpdatedAt': '2022-04-15T14:08:28Z',
        'inMotion': False,
        'areDoorsLocked': False,
        'originCountryISO': 'US',
        'areDoorsClosed': True,
        'areDoorsOpen': False,
        'areWindowsClosed': True,
        'doorsAndWindows':
        {
            'doors':
            {
                'driverFront': 'CLOSED',
                'driverRear': 'CLOSED',
                'passengerFront': 'CLOSED',
                'passengerRear': 'CLOSED'
            },
            'windows':
            {
                'driverFront': 'CLOSED',
                'driverRear': 'CLOSED',
                'passengerFront': 'CLOSED',
                'passengerRear': 'CLOSED'
            },
            'trunk': 'CLOSED',
            'hood': 'CLOSED',
            'moonroof': 'CLOSED'
        },
        'tires':
        {
            'frontLeft':
            {
                'status': {'currentPressure': 214, 'localizedCurrentPressure': '31.0 psi', 'targetPressure': 234, 'localizedTargetPressure': '33.9 psi'}
            },
            'frontRight':
            {
                'status': {'currentPressure': 214, 'localizedCurrentPressure': '31.0 psi', 'targetPressure': 234, 'localizedTargetPressure': '33.9 psi'}
            },
            'rearLeft':
            {
                'status': {'currentPressure': 234, 'localizedCurrentPressure': '33.9 psi', 'targetPressure': 255, 'localizedTargetPressure': '37.0 psi'}
            },
            'rearRight':
            {
                'status': {'currentPressure': 234, 'localizedCurrentPressure': '33.9 psi', 'targetPressure': 255, 'localizedTargetPressure': '37.0 psi'}
            }
        },
        'isServiceRequired': False,
        'fuelLevel': {'value': 62, 'units': 'LITERS'},
        'fuelPercentage': {'value': 100},
        'combustionRange': {'distance': {'value': 659, 'units': 'KILOMETERS'}},
        'checkControlMessages': [],
        'serviceRequired':
        [
            {'type': 'BRAKE_FLUID', 'status': 'OK', 'dateTime': '2022-10-01T00:00:00.000Z'},
            {'type': 'OIL', 'status': 'OK', 'dateTime': '2022-11-01T00:00:00.000Z', 'distance': {'value': 14480, 'units': 'KILOMETERS'}},
            {'type': 'VEHICLE_CHECK', 'status': 'OK', 'dateTime': '2023-11-01T00:00:00.000Z', 'distance': {'value': 30580, 'units': 'KILOMETERS'}}
        ],
        'vehicleLocation':
        {
            'coordinates': {'latitude': XXXX, 'longitude': XXXX},
            'address': {'formatted': 'XXXX'},
            'heading': 77
        },
        'climateControl':
        {
            'activity': 'INACTIVE'
        }
    },
    'all_lids_closed': True,
    'all_windows_closed': True,
    'are_all_cbs_ok': True,
    'are_parking_lights_on': None,
    'charging_end_time': None,
    'charging_level_hv': None,
    'charging_start_time': None,
    'charging_status': None,
    'charging_time_label': None,
    'charging_time_remaining': 0.0,
    'check_control_messages': [],
    'condition_based_services':
    [
        <bimmer_connected.vehicle_status.ConditionBasedServiceReport object at 0x112e3c3a0>,
        <bimmer_connected.vehicle_status.ConditionBasedServiceReport object at 0x112e3c2e0>,
        <bimmer_connected.vehicle_status.ConditionBasedServiceReport object at 0x112e3d630>
    ],
    'connection_status': None,
    'door_lock_state': <LockState.UNLOCKED: 'UNLOCKED'>,
    'fuel_indicator_count': 1,
    'fuel_percent': 100,
    'gps_heading': 77,
    'gps_position': (26.543991, -82.011688),
    'has_check_control_messages': False,
    'has_parking_light_state': False,
    'is_vehicle_active': False,
    'last_charging_end_result': None,
    'last_update_reason': 'Updated from vehicle 4/16/2022 10:08 AM',
    'lids':
    [
        <bimmer_connected.vehicle_status.Lid object at 0x1130ded70>,
        <bimmer_connected.vehicle_status.Lid object at 0x1130df1f0>,
        <bimmer_connected.vehicle_status.Lid object at 0x1130defe0>,
        <bimmer_connected.vehicle_status.Lid object at 0x112e3c070>,
        <bimmer_connected.vehicle_status.Lid object at 0x112e3c130>,
        <bimmer_connected.vehicle_status.Lid object at 0x112e3d690>
    ],
    'max_range_electric': None,
    'mileage': (11154, 'mi'),
    'open_lids': [],
    'open_windows': [],
    'parking_lights': None,
    'remaining_fuel': (62, 'LITERS'),
    'remaining_range_electric': (None, None),
    'remaining_range_fuel': (409, 'mi'),
    'remaining_range_total': (409, 'mi'),
    'timestamp': datetime.datetime(2022, 4, 15, 14, 8, 28, tzinfo=datetime.timezone.utc),
    'windows':
    [
        <bimmer_connected.vehicle_status.Window object at 0x112e3d600>,
        <bimmer_connected.vehicle_status.Window object at 0x112e3c4c0>,
        <bimmer_connected.vehicle_status.Window object at 0x112e3c370>,
        <bimmer_connected.vehicle_status.Window object at 0x112e3ece0>,
        <bimmer_connected.vehicle_status.Window object at 0x112e3d5d0>
    ]
}

   

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sun Apr 17, 2022 2:21 pm
ryanbuckner offline
Posts: 1074
Joined: Oct 08, 2011
Location: Northern Virginia

Re: New Plugin - BMW Connected Drive

My car isn't electric so I don't need any of that information. I use:

  • Basic Attributes: make model year
  • Status of each window
  • Status of each door (open/closed)
  • Status of each door (locked/unlocked)
  • Status of hood trunk sunroof
  • Fuel and range indicators
  • Mileage
  • Lat Long
  • Direction heading GPS
  • Anything I can control (locks, climate, horn, lights, etc.. )

Posted on
Mon Apr 18, 2022 5:30 am
macpro offline
User avatar
Posts: 765
Joined: Dec 29, 2005
Location: Third byte on the right

Re: New Plugin - BMW Connected Drive

Is that all? :wink:

For me the fuel level and door status is useful info.
Details on the car like istep and type of headunit would be very nice to have, because I never know where to find these.

Posted on
Mon Apr 18, 2022 6:29 am
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: New Plugin - BMW Connected Drive

For the Tesla plugin, I just dump all the JSON response into states.

I don’t process any of them, just leave them for the user to use.

(UI display state is a custom statename in config, so user can choose which state to display)


Sent from my iPhone using Tapatalk Pro

Posted on
Mon Apr 18, 2022 6:32 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: New Plugin - BMW Connected Drive

howartp wrote:
For the Tesla plugin, I just dump all the JSON response into states.

I don’t process any of them, just leave them for the user to use.

(UI display state is a custom statename in config, so user can choose which state to display)


That's what I was doing before, but there are multiple API calls to get different info, and the results are way to complicated now to do that. I'm working on an alternate solution.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed Apr 20, 2022 5:56 pm
Dave Durham offline
Posts: 23
Joined: Nov 30, 2003
Location: Los Angeles, CA

Re: New Plugin - BMW Connected Drive

Hey FlyingDiver,
I'm glad you're still working on this Plug In! I used it extensively before. But when all is said and done my wants are simple :D

Is the car plugged into the charger or not?
Current battery level?
Current fuel level? (I have a BMW i3 with the Range Extender, so electric and gasoline but not a hybrid)
Door and Windows closed and locked?
Charging Started, Charging Done?
Current Range?

Those would make me very happy.
Thanks again for the great work!!!!

-Dave

Posted on
Wed Apr 20, 2022 5:58 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: New Plugin - BMW Connected Drive

Dave Durham wrote:
Hey FlyingDiver,
I'm glad you're still working on this Plug In! I used it extensively before. But when all is said and done my wants are simple :D

Is the car plugged into the charger or not?
Current battery level?
Current fuel level? (I have a BMW i3 with the Range Extender, so electric and gasoline but not a hybrid)
Door and Windows closed and locked?
Charging Started, Charging Done?
Current Range?

Those would make me very happy.
Thanks again for the great work!!!!

-Dave


As soon as Indigo 2022.1 is released, and you upgrade, I'll need you to run the plugin so I can see what data it's returning for your vehicle. As of right now, I only have gas-only test data.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed Apr 20, 2022 6:25 pm
Dave Durham offline
Posts: 23
Joined: Nov 30, 2003
Location: Los Angeles, CA

Re: New Plugin - BMW Connected Drive

Joe,
Happy to help out. I'm usually an early adopter so 2022.1 can't come fast enough!

-d

Who is online

Users browsing this forum: No registered users and 2 guests