BMW ConnectedDrive component

I got no update from @m1n3rva as well after the issues from a few months ago.

What you can try in the meanwhile to see if your PR fixes the open_tilt issue is adding the component as custom component to your HA.
In the manifest.json you can replace

"requirements": [
    "bimmer_connected==0.5.3"
  ]

with

"requirements": [
    "https://github.com/robthebold/bimmer_connected/archive/master.zip#bimmer_connected==0.5.5"
  ]

You have to make a release on your Github first with v0.5.5. I am not sure if referring to your Github like this works with manifest.json, but it used to work when the requirements where part of the py file so you can give it a shot.

1 Like

Well regarding a custom component, after a little looking around got me to the ā€œDevelopmentā€ section of the HA documentation, I didnā€™t get past the 2nd paragraph: ā€œBefore you start, make sure that you have read up on the Home Assistant architecture so that you are familiar with the concepts that make up Home Assistant.ā€

Iā€™m afraid that learning a projectā€™s architecture to make a one-liner code change isnā€™t very good ROI given my finite time on this mortal coil and the other demands life has of me.

I have managed to test the bimmer_connected library itself from the command line, and now I can confirm the addition of OPEN_TILT to the LidState Enums no longer causes account.update_vehicle_states to throw an error when the sunroof is tilted open.

Iā€™ve had lots of issues recently, 99 times out of a 100 it will fail with the following

18

I see there was an earlier comment about Error 500 in the UK (where I live).

No worries, you donā€™t have to make the custom component your self :slight_smile:

Just do the following:

  • Copy the files from here to config\custom_components\bmw_connected_drive of your HA installation.
  • Make a release on your Github for the bimmer_connected library with version 0.5.5.
  • Make the changes to the requirements part in manifest.json as mentioned in the post above.

That should be all. No need to get into the Development section of HA :wink:

Give it a try and definitely when your changes will solve the error when the sunroof is opened.

1 Like

Sign in to your Connected Drive account on https://www.bmw-connecteddrive.se/app/index.html#/portal and accept the updated terms, and it will start working again in Home Assistant.

2 Likes

Thanks all working now :slight_smile:

Other than adding the directories, copying the files, editing the manifest and creating a github release, what besides a restart is necessary to get home assistant to use the custom component? I wondered if I should edit the name of the component in configuration.yaml, but I couldnā€™t find any documentation for that.

Thereā€™s the customize entities section of the docs about assigning friendlier names (and the section of configuration.yaml where that can be done with nano), and thereā€™s a ā€œCustomizationā€ section in the hassbian section which doesnā€™t apply to my system . . .

Obviously since this is my first waffle Iā€™m either gonna burn it or have it come out raw, but Iā€™m not sure what the next step is. I skipped something, but donā€™t know what.

Iā€™d sure like to be able to test it out. Iā€™ve also pulled in some other uncommitted changes in the code that get sending POIs to work. Iā€™ve been testing that out from the command line ā€“ itā€™s kind of a shame that BMW removed that from their website. Be nice to do that in HA.

Your list contains all the steps you need to do :grinning: You donā€™t need to change any config items. The custom component, if correctly placed in the right folder, will override the standard component.

After a restart of HA check if you can find this in your log:
2019-07-22 16:17:58 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for bmw_connected_drive which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.

If thatā€™s the case then you are using the custom component. If not, then you can post a screen shot of the folder directory so we can check if thatā€™s all okay.

And here is some HA documentation regarding custom components.

Curious if the POIs PR are working, but letā€™s first get your custom component working.
And it will work, as I am using it as a custom component myself as well, as I did some small local changes to the code :sunglasses:

1 Like

Ok, a filename error in ā€œmanifest.jsonā€ prevented HA from trying to go further. Fixing that gets me some actual errors in the log:

2019-07-23 14:32:57 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for bmw_connected_drive which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-07-23 14:32:57 WARNING (MainThread) [homeassistant.components.http] Configuring api_password via the http component has been deprecated. Use the legacy api password auth provider instead. For instructions, see https://www.home-assistant.io/docs/authentication/providers/#legacy-api-password
2019-07-23 14:32:57 WARNING (MainThread) [homeassistant.components.http.auth] legacy_api_password support has been enabled.
2019-07-23 14:33:27 ERROR (SyncWorker_8) [homeassistant.util.package] Unable to install package https://github.com/robthebold/bimmer_connected/archive/master.zip#bimmer_connected==0.5.5: ERROR: Complete output from command python setup.py egg_info:
    ERROR: ERROR:root:Error parsing
    Traceback (most recent call last):
      File "/usr/local/lib/python3.7/site-packages/pbr/core.py", line 96, in pbr
        attrs = util.cfg_to_args(path, dist.script_args)
      File "/usr/local/lib/python3.7/site-packages/pbr/util.py", line 260, in cfg_to_args
        pbr.hooks.setup_hook(config)
      File "/usr/local/lib/python3.7/site-packages/pbr/hooks/__init__.py", line 25, in setup_hook
        metadata_config.run()
      File "/usr/local/lib/python3.7/site-packages/pbr/hooks/base.py", line 27, in run
        self.hook()
      File "/usr/local/lib/python3.7/site-packages/pbr/hooks/metadata.py", line 26, in hook
        self.config['name'], self.config.get('version', None))
      File "/usr/local/lib/python3.7/site-packages/pbr/packaging.py", line 849, in get_version
        name=package_name))
    Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. It's also possible that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo. Project name bimmer_connected was given, but was not able to be found.
    error in setup command: Error parsing /tmp/pip-req-build-_y2uaxqs/setup.cfg: Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. It's also possible that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo. Project name bimmer_connected was given, but was not able to be found.
    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-req-build-_y2uaxqs/
WARNING: You are using pip version 19.1.1, however version 19.2.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
2019-07-23 14:33:27 ERROR (MainThread) [homeassistant.requirements] Not initializing bmw_connected_drive because could not install requirement https://github.com/robthebold/bimmer_connected/archive/master.zip#bimmer_connected==0.5.5
2019-07-23 14:33:27 ERROR (MainThread) [homeassistant.setup] Setup failed for bmw_connected_drive: Could not install all requirements.
2019-07-23 14:33:38 WARNING (MainThread) [homeassistant.components.sensor] Setup of platform epsonworkforce is taking over 10 seconds.
2019-07-23 14:33:42 WARNING (MainThread) [homeassistant.setup] Setup of hassio is taking over 10 seconds.

OK, I see that the link to the github project release I made is actually

https://github.com/robthebold/bimmer_connected/archive/v0.5.5.zip

instead of master.zip . . . . A SWAG tells me to change the line in manifest.json. But thatā€™s not it either. I still think Iā€™m getting the URL wrong but am not exactly sure what itā€™s expecting

2019-07-23 14:16:56 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for bmw_connected_drive which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-07-23 14:16:56 WARNING (MainThread) [homeassistant.components.http] Configuring api_password via the http component has been deprecated. Use the legacy api password auth provider instead. For instructions, see https://www.home-assistant.io/docs/authentication/providers/#legacy-api-password
2019-07-23 14:16:56 WARNING (MainThread) [homeassistant.components.http.auth] legacy_api_password support has been enabled.
2019-07-23 14:17:25 ERROR (SyncWorker_0) [homeassistant.util.package] Unable to install package https://github.com/robthebold/bimmer_connected/archive/v0.5.5.zip#bimmer_connected==0.5.5: ERROR: Complete output from command python setup.py egg_info:
    ERROR: ERROR:root:Error parsing
    Traceback (most recent call last):
      File "/usr/local/lib/python3.7/site-packages/pbr/core.py", line 96, in pbr
        attrs = util.cfg_to_args(path, dist.script_args)
      File "/usr/local/lib/python3.7/site-packages/pbr/util.py", line 260, in cfg_to_args
        pbr.hooks.setup_hook(config)
      File "/usr/local/lib/python3.7/site-packages/pbr/hooks/__init__.py", line 25, in setup_hook
        metadata_config.run()
      File "/usr/local/lib/python3.7/site-packages/pbr/hooks/base.py", line 27, in run
        self.hook()
      File "/usr/local/lib/python3.7/site-packages/pbr/hooks/metadata.py", line 26, in hook
        self.config['name'], self.config.get('version', None))
      File "/usr/local/lib/python3.7/site-packages/pbr/packaging.py", line 849, in get_version
        name=package_name))
    Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. It's also possible that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo. Project name bimmer_connected was given, but was not able to be found.
    error in setup command: Error parsing /tmp/pip-req-build-1usn88d6/setup.cfg: Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. It's also possible that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo. Project name bimmer_connected was given, but was not able to be found.
    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-req-build-1usn88d6/
WARNING: You are using pip version 19.1.1, however version 19.2.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
2019-07-23 14:17:25 ERROR (MainThread) [homeassistant.requirements] Not initializing bmw_connected_drive because could not install requirement https://github.com/robthebold/bimmer_connected/archive/v0.5.5.zip#bimmer_connected==0.5.5
2019-07-23 14:17:25 ERROR (MainThread) [homeassistant.setup] Setup failed for bmw_connected_drive: Could not install all requirements.

I will check it. It used to work when requirements where part of the py file (so before manifest.json existed).

If that is not working I can upload your library to PyPi and then it should definitely work.

We are almost there :smile:

For fun I removed that fragment at the end of the github url in manifest.json, and that was not the right thing to do. HA does not fully restart. Had to restore this morningā€™s snapshot before I could use it again.

Oh, thatā€™s not good. Removing the BMW folder and restarting didnā€™t help?

Let me put the library on PyPi and see if we get it working. I will send you a DM so we can continue the chat there.

Oh, no. I never tried removing the folder . . . I knew I had a good snapshot that would save me some time to restore. I was able to return to a state just before I found that Iā€™d mis-typed the manifest.json filename.

I tried the same and get the same error. Can you help me as well?

@roborob, cc @deluxestyle
I have added the updated library to Pypi and itā€™s working now :grinning:
I donā€™t have a sunroof so canā€™t test the LidState, that honour is up to you :wink:

Change the requirements part in manifest.json as follows:

"requirements": [
    "bimmer-connected-drive==0.5.5"
  ],

I made the change and restarted and nothing broke, so so far so good. Hopefully tomorrow will be a suitable day to test the sunroof tilted open and I can add to this. Forecast looks not bad, so we will see . . .

Hi,

New to this site here. Having been using BMW connected drive official HA component since last year. Until recently sometimes I found all its sensors are gone completely, and my custom lovelace appeared errors of course as they are all depending on them. Anyone has the same issue?

Are we supposed to be following https://github.com/robthebold/bimmer_connected/ as custom component instead of the official one due to lack of support?

PS: I am in Australia

Thank you guys

Been trying to follow the discussion to get this up and running again, but Iā€™m facing a new error.

This is probably due to me, but Iā€™m not sure how to proceed.

Unable to install package bimmer_connected==0.5.5: ERROR: Could not find a version that satisfies the requirement bimmer_connected==0.5.5 (from versions: 0.0.1, 0.0.3, 0.0.4, 0.1.0, 0.2.0, 0.3.0, 0.4.0.dev0, 0.4.0, 0.4.1, 0.5.0, 0.5.1, 0.5.2, 0.5.3)
ERROR: No matching distribution found for bimmer_connected==0.5.5

Not initializing bmw_connected_drive because could not install requirement bimmer_connected==0.5.5

I restarted my HA instance on the weekend and had the same issue. I had to restart three times before it worked again. Iā€™m not sure if it was a coincidence, but before the third, successful reboot, I opened the ConnectedDrive app and signed into the ConnectedDrive website.