New Plugin - BMW Connected Drive

Posted on
Thu Dec 12, 2019 8:32 pm
FlyingDiver offline
User avatar
Posts: 7221
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: New Plugin - BMW Connected Drive

Errors from other thread:

Code: Select all
   Error                           device "Ryan's BMW 540ix" state key publicKey not defined (ignoring update request)
   Error                           device "Ryan's BMW 540ix" state key asymEncryptionMethod not defined (ignoring update request)
   Error                           device "Ryan's BMW 540ix" state key egoVehiclePath not defined (ignoring update request)
   Error                           device "Ryan's BMW 540ix" state key remote360packageEncryption not defined (ignoring update request)


I'm leaving tomorrow for a week. When I get back I'm going to work on defining the state variables on the fly. I do this in other plugins, but my first try on this one didn't work.

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

Posted on
Thu Dec 12, 2019 8:56 pm
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: New Plugin - BMW Connected Drive

Not a problem. Pretty amazing first crack. I've retired by python script already and I'll test this while you're gone.

Would be nice to be able to press that 5 minute update limit to use Geofencing or sunroof / window open triggers on rainy days.

Posted on
Wed Dec 18, 2019 5:13 pm
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: New Plugin - BMW Connected Drive

Some troubleshooting for you. I had the car at the dealer today and they disabled GPS Tracking in the vehicle. Here's the error I got when that happened.

Code: Select all
Dec 18, 2019 at 6:06:35 PM
   Enabling plugin "BMW Connected Drive 0.0.1"
   Starting plugin "BMW Connected Drive 0.0.1" (pid 71803)
   Started plugin "BMW Connected Drive 0.0.1"
   BMW Connected Drive Error       Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 99, in runConcurrentThread
KeyError: 'heading'

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

Posted on
Wed Dec 18, 2019 5:16 pm
FlyingDiver offline
User avatar
Posts: 7221
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: New Plugin - BMW Connected Drive

Can you PM me a new data dump? I’ll look at it when I get back this weekend.

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

Posted on
Sun Dec 22, 2019 3:25 pm
FlyingDiver offline
User avatar
Posts: 7221
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: New Plugin - BMW Connected Drive

Pre-release 0.0.2 available: https://github.com/FlyingDiver/Indigo-B ... /tag/0.0.2

Device states have changed (again). States are now auto-created from the CD API data.

I need examples of data from PHEV and BEV vehicles. Use the plugin menu command to write the data to the log.

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

Posted on
Mon Dec 23, 2019 10:03 pm
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: New Plugin - BMW Connected Drive

Version 0.0.2 threw an error on fuelPercent . It did not populate any device states.

Code: Select all
Dec 23, 2019 at 11:00:45 PM
   Schedule                        Turn Off All Lights Cleanup PM (delayed action)
   Sent INSTEON                    "Guest Room - Fan" set motor speed to low
   Reloading plugin "BMW Connected Drive 0.0.2"
   Stopping plugin "BMW Connected Drive 0.0.2" (pid 65329)
   Stopped plugin "BMW Connected Drive 0.0.2"
   Starting plugin "BMW Connected Drive 0.0.2" (pid 65436)
   Started plugin "BMW Connected Drive 0.0.2"
   BMW Connected Drive Error       Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 91, in runConcurrentThread
  File "plugin.py", line 148, in updateVehicle
KeyError: 'fuelPercent'

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


Posted on
Mon Dec 23, 2019 10:04 pm
FlyingDiver offline
User avatar
Posts: 7221
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: New Plugin - BMW Connected Drive

ryanbuckner wrote:
Version 0.0.2 threw an error on fuelPercent . It did not populate any device states.

Code: Select all
Dec 23, 2019 at 11:00:45 PM
   Schedule                        Turn Off All Lights Cleanup PM (delayed action)
   Sent INSTEON                    "Guest Room - Fan" set motor speed to low
   Reloading plugin "BMW Connected Drive 0.0.2"
   Stopping plugin "BMW Connected Drive 0.0.2" (pid 65329)
   Stopped plugin "BMW Connected Drive 0.0.2"
   Starting plugin "BMW Connected Drive 0.0.2" (pid 65436)
   Started plugin "BMW Connected Drive 0.0.2"
   BMW Connected Drive Error       Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 91, in runConcurrentThread
  File "plugin.py", line 148, in updateVehicle
KeyError: 'fuelPercent'

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



Do you have a PHEV or BEV? Please post or PM me the vehicle data.

Oh, wait, you did previously. I wonder why your data doesn't include the fuelPercent field that mine has? What should I use for the status if that field isn't present?

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

Posted on
Tue Dec 24, 2019 10:34 am
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: New Plugin - BMW Connected Drive

Here's what my script spits out:

Code: Select all
/usr/bin/python2.7 /Users/ryanbuckner/PycharmProjects/BMWAPI/bmwcdapi.py
...running bmwcdapi.py
(u'updateTime_converted_timestamp', u'1577168749000')
(u'door_driver_rear', u'CLOSED')
(u'remaining_fuel', u'40')
(u'updateTime_converted', u'12/24/2019 06:25 AM')
(u'updateTime', u'24.12.2019 05:25:49 UTC')
(u'beRemainingRangeFuelMile', u'311.0')
(u'gps_lng', u'-74.31657')
(u'head_unit', u'NBTEvo')
(u'window_passenger_rear', u'CLOSED')
(u'hood_state', u'CLOSED')
(u'updateTime_converted_date', u'12/24/2019')
(u'door_passenger_front', u'CLOSED')
(u'head_unit_pu_software', u'09/19')
(u'door_driver_front', u'CLOSED')
(u'kombi_current_remaining_range_fuel', u'502')
(u'check_control_messages', u'')
(u'vehicle_tracking', u'1')
(u'door_lock_state', u'SECURED')
(u'gps_lat', u'40.289288')
(u'mileage', u'23575')
(u'door_passenger_rear', u'CLOSED')
(u'unitOfElectricConsumption', u'mls/kWh')
(u'isAmPm', u'')
(u'lsc_trigger', u'VEHCSHUTDOWN_SECURED')
(u'sunroof_position', u'0')
(u'unitOfLength', u'mls')
(u'unitOfCombustionConsumption', u'mpg')
(u'sunroof_state', u'CLOSED')
(u'window_driver_front', u'CLOSED')
(u'condition_based_services', u'00001,OK,2020-12,14000;00100,OK,2020-12,14000;00003,OK,2021-07,')
(u'lastUpdateReason', u'VEHCSHUTDOWN_SECURED')
(u'lights_parking', u'OFF')
(u'window_driver_rear', u'CLOSED')
(u'updateTime_converted_time', u'06:25 AM')
(u'beRemainingRangeFuel', u'311.0')
(u'unitOfEnergy', u'kWh')
(u'shdStatusUnified', u'CLOSED')
(u'beRemainingRangeFuelKm', u'502.0')
(u'window_passenger_front', u'CLOSED')
(u'heading', u'259')
(u'trunk_state', u'CLOSED')

Posted on
Tue Dec 24, 2019 10:35 am
FlyingDiver offline
User avatar
Posts: 7221
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: New Plugin - BMW Connected Drive

Please use the menu command in the plugin.

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

Posted on
Tue Dec 24, 2019 10:40 am
FlyingDiver offline
User avatar
Posts: 7221
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: New Plugin - BMW Connected Drive


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

Posted on
Tue Dec 24, 2019 2:43 pm
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: New Plugin - BMW Connected Drive

Bingo. Write data to log is not working or I'd send it to you.

Posted on
Tue Dec 24, 2019 3:04 pm
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: New Plugin - BMW Connected Drive

Remaining Range Fuel is in litres. It would be nice to have a custom state for miles. For the meantime, we can trigger and populate a variable.

Posted on
Tue Dec 24, 2019 3:07 pm
FlyingDiver offline
User avatar
Posts: 7221
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: New Plugin - BMW Connected Drive

ryanbuckner wrote:
Bingo. Write data to log is not working or I'd send it to you.


Did you try the version I just posted?

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

Posted on
Tue Dec 24, 2019 3:14 pm
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: New Plugin - BMW Connected Drive

Yeah, version .0.0.3 works great but write to log isn't

Posted on
Tue Dec 24, 2019 3:15 pm
FlyingDiver offline
User avatar
Posts: 7221
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: New Plugin - BMW Connected Drive

ryanbuckner wrote:
Yeah, version .0.0.3 works great but write to log isn't


Any errors? Turn on debug logging.

It works fine for me, so there's something weird going on.

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

Who is online

Users browsing this forum: No registered users and 4 guests

cron