Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bmw_connected_drive - provide position of HA installation - WIP #14464

Closed

Conversation

ChristianKuehnel
Copy link
Contributor

@ChristianKuehnel ChristianKuehnel commented May 14, 2018

Description:

This solves issues with some vehicles as discussed in
bimmerconnected/bimmer_connected#62

These vehicles require the client to upload it's current position to the server. Only if this position is within some range (e.g. 2km) of the vehicle, you will get data from the vehicle.

This feature is configurable, so you only need to disclose the location if your car requires it. See example below

⚠️ This is work in progress and needs some testing by someone with a car affected by the problem.
⚠️ This also requires a new release from the underlying bimmer_connected library, once it was tested successfully.

Related issue (if applicable): fixes bimmerconnected/bimmer_connected#62

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.github.io#<home-assistant.github.io PR number goes here>

Example entry for configuration.yaml (if applicable):

⚠️ This feature is only activated if you set send_location: True

bmw_connected_drive:
  5er:
    username: <connected drive username>
    password: <connected drive password>
    region: <your region (as before)>
    send_location: True

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@@ -84,6 +87,12 @@ def setup_account(account_config: dict, hass, name: str) \
region = account_config[CONF_REGION]
_LOGGER.debug('Adding new account %s', name)
cd_account = BMWConnectedDriveAccount(username, password, region, name)
if account_config[CONF_SEND_LOCATION]:
_LOGGER.debug('Account %s is configured to upload the location of your '

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (80 > 79 characters)

@@ -14,19 +14,22 @@
from homeassistant.helpers.event import track_utc_time_change
import homeassistant.helpers.config_validation as cv

REQUIREMENTS = ['bimmer_connected==0.5.0']
# TODO: replace with new release when available
REQUIREMENTS = ['https://github.com/m1n3rva/bimmer_connected/archive/master.zip#bimmer_connected==0.5.1']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (105 > 79 characters)

@ajmm
Copy link

ajmm commented May 25, 2018

Hi @ChristianKuehnel
this somehow does not work for me.
If I don't provide send_location: True it gives me the old error:

{
"error" : {
"code" : 500,
"description" : "(SmartPhoneUtil-A-101) Mandatory parameter(s) missed or blank: dlat and dlon are required for BMW vehicles!"
}
}

If I set send_location: True then I get:

Error during setup of component bmw_connected_drive

Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/homeassistant/setup.py", line 145, in _async_setup_component
component.setup, hass, processed_config)
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/bmw_connected_drive/init.py", line 62, in setup
accounts.append(setup_account(account_config, hass, name))
File "/config/custom_components/bmw_connected_drive/init.py", line 95, in setup_account
cd_account.account.set_observer_position(latitude, longitude)
AttributeError: 'ConnectedDriveAccount' object has no attribute 'set_observer_position'

so maybe REQUIREMENTS = ['https://github.com/m1n3rva/bimmer_connected/archive/master.zip#bimmer_connected==0.5.1'] is loading a wrong version without the set_observer_position?
As I understant that was added to the master?

@ajmm
Copy link

ajmm commented Jun 5, 2018

@ChristianKuehnel : I had to replace REQUIREMENTS = ['https://github.com/m1n3rva/bimmer_connected/archive/master.zip#bimmer_connected==0.5.1'] with REQUIREMENTS = ['https://github.com/m1n3rva/bimmer_connected/archive/master.zip#bimmer_connected==0.5.2'] to force pip to take the newest version of bimmer_connected from the master branch.
Seems to be working ok now.

@balloob
Copy link
Member

balloob commented Sep 21, 2018

Going to close this. You can open it again if a new bimmer release has happened.

@balloob balloob closed this Sep 21, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Feb 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BMW 5 Series 2014 F10
5 participants