New Plugin - BMW Connected Drive

Posted on
Sun May 10, 2020 6:00 am
FlyingDiver offline
User avatar
Posts: 4669
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: New Plugin - BMW Connected Drive

It's on my to-do list, but I want to get the first version of my new Stream Deck plugin out first.

Maybe you could file an enhancement request on GitHub to keep me reminded?

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

Posted on
Sun May 10, 2020 6:14 am
Turribeach offline
Posts: 300
Joined: Feb 06, 2015
Location: London, UK

Re: New Plugin - BMW Connected Drive

I am interested in actions too, I keep refining the script I posted and it already saved me from leaving the car open one day. I went to store some supermarket bags in the boot and I got distracted so I forgot to lock it. Clearly not using the car as much makes me forget simple things like locking it. Once I am happy with my script it's not providing any false alters I will move to the next stage which is to trigger the action to lock the car automatically when the alert is detected.

Posted on
Sun May 10, 2020 6:22 am
Turribeach offline
Posts: 300
Joined: Feb 06, 2015
Location: London, UK

Re: New Plugin - BMW Connected Drive

FlyingDiver wrote:
It's on my to-do list, but I want to get the first version of my new Stream Deck plugin out first.

Maybe you could file an enhancement request on GitHub to keep me reminded?


Issue 3 raised but I don't believe I can label it as I don't have write access to the repo.

Posted on
Sun Jun 07, 2020 7:39 pm
ryanbuckner offline
Posts: 331
Joined: Oct 08, 2011

Re: New Plugin - BMW Connected Drive

FlyingDiver wrote:
ryanbuckner wrote:
Sierra 10.12.6

It had been working fine up until today. I tested my credentials on the website and they passed.


You're running into the SSL/TLS issue. They must have just upgraded their servers.

Code: Select all
   BMW Connected Drive Error       get_tokens AUTH Error, exception = [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)


The only fix is to upgrade to at least High Sierra.


Found some time to update to Catalina and the plugin is working again !

Posted on
Sat Sep 26, 2020 7:58 pm
HEGarrard offline
Posts: 23
Joined: Sep 09, 2014

BMW Connected Drive Plugin

I am trying to use some of the information in the BMW Connected Drive to use in Triggers.
Specifically I was wanting to use the Fuel Percent or Remaining Fuel "Devices" and use the Device State to populate a couple of variables.

The devices I have setup are shown below ...

Devices.jpg
Devices.jpg (66.37 KiB) Viewed 340 times


If I use the python script ...
MyVar = indigo.devices[410812393] # This is the Connected Vehicle Device with Fuel Percent
indigo.variable.updateValue(1572747575, value=str(MyVar))

The variable is updated with the device address and not the "state" 38.5%

Variable List.jpg
Variable List.jpg (31.95 KiB) Viewed 340 times


I tried using .value or .state to get the "state" of the device - however, neither of those two worked.



My next attempt was using the following python script ...

bmw = indigo.devices[1387282993] # This is the Connected Account Device
FuelPercent = bmw.states["fuelPercent"]
indigo.variable.updateValue(1572747575, value=str(FuelPercent))

If I run this script I get an error ...

Script Error 1.jpg
Script Error 1.jpg (48.67 KiB) Viewed 340 times



bmw = indigo.devices[410812393] # This is the Connected Vehicle Device with Fuel Percent
FuelPercent = bmw.states["fuelPercent"]
indigo.variable.updateValue(1572747575, value=str(FuelPercent))

If I run this script ... I get the same error as above.

This is the "Vehicle Data to Log"

Vehicle Data to Log.jpg
Vehicle Data to Log.jpg (233.06 KiB) Viewed 340 times


Any suggestions on how to get the values for the BMW Connected Drive Devices as defined in my device list and write them to variables????

Thank you!

Posted on
Sat Sep 26, 2020 8:11 pm
FlyingDiver offline
User avatar
Posts: 4669
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: BMW Connected Drive Plugin

You're making this much harder than it actually is. And some bad assumptions. You don't need all those different vehicles devices. You only need one. The choice of status value is purely to give a choice in the Indigo UI. You need to look at the complete list of available states to see the names.

Screen Shot 2020-09-26 at 10.02.02 PM.png
Screen Shot 2020-09-26 at 10.02.02 PM.png (823.32 KiB) Viewed 333 times


And you don't need a script to put a device state into a variable.

Screen Shot 2020-09-26 at 10.10.10 PM.png
Screen Shot 2020-09-26 at 10.10.10 PM.png (471.34 KiB) Viewed 333 times

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

Posted on
Sat Sep 26, 2020 8:12 pm
FlyingDiver offline
User avatar
Posts: 4669
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: BMW Connected Drive Plugin

The states starting with "s_" are in the "status" data from the BMW servers. The "v_" states are from the "vehicle" data. Vehicle data is static, I think, what status data is dynamic.

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

Posted on
Sat Sep 26, 2020 8:15 pm
HEGarrard offline
Posts: 23
Joined: Sep 09, 2014

Re: BMW Connected Drive Plugin

Thank you very much for the quick reply!

I saw a thread that used something similar to the s_fuelPercent ... I just did not know how to get it!

Thanks again!

Posted on
Wed Oct 28, 2020 7:41 am
macpro offline
User avatar
Posts: 712
Joined: Dec 29, 2005
Location: Third byte on the right

Re: New Plugin - BMW Connected Drive

You can rename this plugin to "BMW/Mini Connected Drive". :D

"I tawt I taw a puddy tat!" Tweety

Posted on
Tue Nov 17, 2020 2:31 am
Turribeach offline
Posts: 300
Joined: Feb 06, 2015
Location: London, UK

Re: New Plugin - BMW Connected Drive

Started to get error 400 when trying to authenticate. Something changed on the BMW side? :? :(

Code: Select all
   Reloading plugin "BMW Connected Drive 0.0.6"
   Stopping plugin "BMW Connected Drive 0.0.6" (pid 863)
   BMW Connected Drive Debug       runConcurrentThread ending
   BMW Connected Drive             BMW Connected Drive Account: Stopping cdAccount Device xxxxxx
   BMW Connected Drive             BMW X1: Stopping cdVehicle Device xxxxxxx
   BMW Connected Drive             Stopping Connected Drive
   Stopped plugin "BMW Connected Drive 0.0.6"
   Starting plugin "BMW Connected Drive 0.0.6" (pid 50532)
   BMW Connected Drive Debug       logLevel = 10
   Started plugin "BMW Connected Drive 0.0.6"
   BMW Connected Drive             Starting Connected Drive
   BMW Connected Drive Debug       updateFrequency = 300.0
   BMW Connected Drive             BMW Connected Drive Account: Starting cdAccount Device
   BMW Connected Drive Error       get_tokens AUTH call failed, response code = 400
   BMW Connected Drive             BMW X1: Starting cdVehicle Device
   BMW Connected Drive Debug       runConcurrentThread starting
   BMW Connected Drive Error       get_tokens AUTH call failed, response code = 400
   BMW Connected Drive Debug       ConnectedDrive account xxxxxxx not authenticated, skipping update
   BMW Connected Drive Debug       ConnectedDrive get_vehicle_data: xxxxxxxx
   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 177, in updateVehicle
  File "/Library/Application Support/Perceptive Automation/Indigo 7.4/Plugins/BMW ConnectedDrive.indigoPlugin/Contents/Server Plugin/bmwcdapi.py", line 149, in get_vehicle_data
TypeError: 'NoneType' object has no attribute '__getitem__'

Posted on
Tue Nov 17, 2020 5:15 am
FlyingDiver offline
User avatar
Posts: 4669
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
Fri Nov 20, 2020 5:37 am
tomet offline
Posts: 5
Joined: Sep 30, 2014

Re: New Plugin - BMW Connected Drive

Hi Flyingdiver,

I use a few of your plugins and love them. Thank you.

Just reporting that I am seeing the same thing here with the 400 error and NoneType issue in Australia. Seems to have started around the 19th of this month +/- a few days.

Cheers

Tom

Posted on
Fri Nov 20, 2020 7:52 am
FlyingDiver offline
User avatar
Posts: 4669
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: New Plugin - BMW Connected Drive

I have not had time to look into the issue this week. I will as soon as I can.

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

Posted on
Fri Nov 20, 2020 4:21 pm
FlyingDiver offline
User avatar
Posts: 4669
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: New Plugin - BMW Connected Drive

Release 0.0.7 is on the plugin store.

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

Posted on
Fri Nov 20, 2020 11:43 pm
tomet offline
Posts: 5
Joined: Sep 30, 2014

Re: New Plugin - BMW Connected Drive

Thanks mate. Worked perfectly.

Who is online

Users browsing this forum: No registered users and 1 guest