BMW ConnectedDrive component

@gerard33 could you please provide an example ?

I am not sure how the name: parameter is determined, but i found for my car ā€œ330iā€ worked but ā€œbmwā€ did not. This is important, as entities with names starting with numbers are handled differently. See:

In my case, I found this did not work:

    data:
      message: "{{ states.sensor.330i_remaining_range_fuel.state }} km"

Whereas this did:

    data:
      message: "{{ states.sensor['330i_remaining_range_fuel'].state }} km"

What are the rules on the name: parameter in the setup?

For the naming of the entities the name from the config is not used, but the type of car is used which is delivered by the bimmer_connected library.
When that type starts with an number, you indeed have to take the above into consideration, but thatā€™s a HA thingy and not something this component can change.
You can however change the BMW entity names easily by just clicking on the cog when you have opened a entity.

Anyone heard anything about progress on the sunroof OPEN_TILT bug? Whenever Iā€™ve got the sunroof popped open, I get a log full of critical component errors. Can anyone other than m1n3rva approve my pull request on github?

changed my car today
but hass still tries to get information of the old even if this is not longer in bmw connted drive
how to get hass to get the information about the new car?
Iā€™ve already restarted hass but no change so far

solved it. had to use a new name for the new car. now itā€™s working

1 Like

Has anyone heard anything about the whereabouts of m1n3rva (the maintainer of the bimmer_connected library that supports this component)? Iā€™m bumping this because Iā€™d asked four months ago if he/she had retired from the project, perhaps no longer has a BMW, maybe unavailable for other reasons . . . There are some outstanding issues to be solved and certainly other things will come up as time passes. Is there a succession plan? How does that work on github?

Locking doesnā€™t seem to be working and the state isnā€™t detected from the component and thereā€™s a lot of 500 errors at the moment, is this just me or a general issue?

Itā€™s not happening to me ā€“ what region are you in? And what kind of errors are you seeing? BMW has multiple regional servers.

Iā€™ve been seeing this for several days in the UK. A server restart seems to get it working but with quite a lot of 500 errors

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.