New Plugin - BMW Connected Drive

Posted on
Wed Apr 14, 2021 9:31 am
ryanbuckner offline
Posts: 1074
Joined: Oct 08, 2011
Location: Northern Virginia

Re: New Plugin - BMW Connected Drive

Code: Select all
Last login: Wed Apr 14 11:08:05 on ttys000

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
HomeAutonServer:~ ryanbuckner$ /usr/bin/python3 --version
Python 3.8.2
HomeAutonServer:~ ryanbuckner$

Posted on
Wed Apr 14, 2021 9:35 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: New Plugin - BMW Connected Drive

Darn. That looks right. Something must be getting messed up in the venv when copying it to another machine. I'm going to have to look into that.

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

Posted on
Thu Apr 15, 2021 1:10 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: New Plugin - BMW Connected Drive

Here's the current status:

The newest branch of the plugin tries to include a Python virtual environment as part of the plugin package, so that users don't need to install a bunch of additional libraries manually. Turns out that copying the venv files to another computer as part of the plugin install breaks it. So until I figure out a way to fix that, we'll have to go back to the older method which DOES require all the additional libraries.

Actions aren't working for me at all, and I'm not sure if it's a problem with the library, with BMW's servers, or what. At my house, I can't even use the mobile app to run any remote services. I don't know what mobile service BMW is using, but it doesn't work here. When I went to the grocery store earlier today, I WAS able to use the remote services from my phone. So I set up action groups I can activate with Indigo touch, and next time I'm somewhere the mobile app works, I'll try those to execute actions from Indigo.

Do any of the testers have the Python 3 version (not the venv branch) working?

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

Posted on
Thu Apr 15, 2021 2:08 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: New Plugin - BMW Connected Drive

OK, I think I got the venv thing fixed. Please try: https://github.com/FlyingDiver/Indigo-B ... /tag/1.0.3

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

Posted on
Sat Apr 17, 2021 1:48 pm
ryanbuckner offline
Posts: 1074
Joined: Oct 08, 2011
Location: Northern Virginia

Re: New Plugin - BMW Connected Drive

FlyingDiver wrote:
OK, I think I got the venv thing fixed. Please try: https://github.com/FlyingDiver/Indigo-B ... /tag/1.0.3



Everything worked great. Didn't get to try ventilate because I got a Too Many Requests error. I did have to send Unlock 3 times to unlock all the doors. First attempt unlocked driver side. Second did nothing. Third unlocked all.

Code: Select all
Starting shell for plugin BMW ConnectedDrive.indigoPlugin.
To access the plugin instance use the global named self.

Python 2.7.16 (default, Jun  5 2020, 22:59:21)
[GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.29.20) (-macos10.15-objc-
Connected to Indigo Server v7.5.0, api v2.4 (localhost:1176)
Started Plugin BMW Connected Drive v1.0.2
>>> Traceback (most recent call last):
  File "./wrapper.py", line 103, in <module>
    asyncio.run(main(sys.argv))
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "./wrapper.py", line 76, in main
    status = vehicle.remote_services.trigger_remote_door_unlock()
  File "/Library/Application Support/Perceptive Automation/Indigo 7.5/Plugins/BMW ConnectedDrive.indigoPlugin/Contents/Server Plugin/bimmer_connected/remote_services.py", line 174, in trigger_remote_door_unlock
    result = self._block_until_done(_Services.REMOTE_DOOR_UNLOCK)
  File "/Library/Application Support/Perceptive Automation/Indigo 7.5/Plugins/BMW ConnectedDrive.indigoPlugin/Contents/Server Plugin/bimmer_connected/remote_services.py", line 217, in _block_until_done
    status = self._get_remote_service_status(service)
  File "/Library/Application Support/Perceptive Automation/Indigo 7.5/Plugins/BMW ConnectedDrive.indigoPlugin/Contents/Server Plugin/bimmer_connected/remote_services.py", line 237, in _get_remote_service_status
    response = self._account.send_request(url)
  File "/Library/Application Support/Perceptive Automation/Indigo 7.5/Plugins/BMW ConnectedDrive.indigoPlugin/Contents/Server Plugin/bimmer_connected/account.py", line 156, in send_request
    raise IOError(msg)
OSError: The BMW Connected Drive portal returned an error: TOO_MANY_REQUESTS (received status code 429 and expected 200).


Posted on
Sat Apr 17, 2021 1:50 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: New Plugin - BMW Connected Drive

The too many requests is a bug in the library, IMO. It retries too many times and then the server errors out. I'm going to trap that error so that it doesn't kill the process.

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

Posted on
Sat Apr 17, 2021 2:19 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: New Plugin - BMW Connected Drive

Try this one: https://github.com/FlyingDiver/Indigo-B ... /tag/1.0.4

It should handle those library retry errors a little better.

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

Posted on
Sat Apr 17, 2021 3:56 pm
ryanbuckner offline
Posts: 1074
Joined: Oct 08, 2011
Location: Northern Virginia

Re: New Plugin - BMW Connected Drive

FlyingDiver wrote:
Try this one: https://github.com/FlyingDiver/Indigo-B ... /tag/1.0.4

It should handle those library retry errors a little better.


1.0.4 seems to be pretty stable. I'll keep playing with it

Posted on
Sat Apr 17, 2021 5:41 pm
ryanbuckner offline
Posts: 1074
Joined: Oct 08, 2011
Location: Northern Virginia

Re: New Plugin - BMW Connected Drive

Just noticed that the status of the BMW turned to "plugin stopped" and this in the event log:

The Account device is also in error.

Code: Select all
   BMW Connected Drive Error       BMW Account: [u'The BMW Connected Drive portal returned an error: TOO_MANY_REQUESTS (received status code 429 and expected 200).']


I haven't sent any commands. This is just from updates.

Posted on
Sat Apr 17, 2021 6:02 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: New Plugin - BMW Connected Drive

Are the updates still working? IOW, is the plugin actually stopped or is it just the status that's wrong?

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

Posted on
Sat Apr 17, 2021 7:54 pm
ryanbuckner offline
Posts: 1074
Joined: Oct 08, 2011
Location: Northern Virginia

Re: New Plugin - BMW Connected Drive

FlyingDiver wrote:
Are the updates still working? IOW, is the plugin actually stopped or is it just the status that's wrong?


Updates completely stopped. I get the error every 5 minutes now. and the only device attribute is status = UNLOCKED which is the key I chose in plugin preferences.

Posted on
Sat Apr 17, 2021 7:56 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: New Plugin - BMW Connected Drive

Disable the plugin so it stops attempting to update. Then re-enable it tomorrow and see how long it works.

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

Posted on
Sun Apr 18, 2021 9:38 am
ryanbuckner offline
Posts: 1074
Joined: Oct 08, 2011
Location: Northern Virginia

Re: New Plugin - BMW Connected Drive

so far it's working today. I haven't tried sending commands tho

Posted on
Sun Apr 18, 2021 9:40 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: New Plugin - BMW Connected Drive

I think you got locked out because of the too many retries error. I'm working on fixes for that now.

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

Posted on
Sun Apr 18, 2021 4:21 pm
ryanbuckner offline
Posts: 1074
Joined: Oct 08, 2011
Location: Northern Virginia

Re: New Plugin - BMW Connected Drive

Added a fun section to my control page dashboard.
BMW Control.png
BMW Control.png (123.51 KiB) Viewed 25381 times

Who is online

Users browsing this forum: No registered users and 2 guests