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

CLI: Set observer position only for vehicle finder #645

Merged
merged 3 commits into from
Aug 26, 2024

Conversation

rikroe
Copy link
Member

@rikroe rikroe commented Aug 3, 2024

Proposed change

Set observer position from positional arguments only for vehicle finder.

Type of change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality to this library)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works.

@rikroe
Copy link
Member Author

rikroe commented Aug 3, 2024

@jeterke could you try this out just from the code change? Cannot test it, don't have an EV.

@jeterke
Copy link

jeterke commented Aug 6, 2024

Tested. Charging start/stop now works fine. Great news!

However, I also tested vehiclefinder and discovered that there is a problem. See below.
Not an issue for me since I don't use it.

DEBUG:bimmer_connected.account:Getting vehicle list
DEBUG:bimmer_connected.account:Getting vehicle list
DEBUG:httpx._client:HTTP Request: POST https://cocoapi.bmwgroup.com/eadrax-vcs/v5/vehicle-list "HTTP/1.1 200 OK"
DEBUG:httpx._client:HTTP Request: GET https://cocoapi.bmwgroup.com/eadrax-vcs/v5/vehicle-data/profile "HTTP/1.1 200 OK"
DEBUG:httpx._client:HTTP Request: POST https://cocoapi.bmwgroup.com/eadrax-vcs/v5/vehicle-list "HTTP/1.1 200 OK"
DEBUG:httpx._client:HTTP Request: POST https://cocoapi.bmwgroup.com/eadrax-vcs/v5/vehicle-list "HTTP/1.1 200 OK"
DEBUG:bimmer_connected.vehicle.vehicle:Getting vehicle list
DEBUG:httpx._client:HTTP Request: GET https://cocoapi.bmwgroup.com/eadrax-vcs/v4/vehicles/state?apptimezone=0&appDateTime=1722932370640 "HTTP/1.1 200 OK"
DEBUG:httpx._client:HTTP Request: GET https://cocoapi.bmwgroup.com/eadrax-crccs/v2/vehicles?fields=charging-profile&has_charging_settings_capabilities=true "HTTP/1.1 200 OK"
DEBUG:httpx._client:HTTP Request: POST https://cocoapi.bmwgroup.com/eadrax-vrccs/v4/presentation/remote-commands/vehicle-finder "HTTP/1.1 200 OK"
DEBUG:bimmer_connected.vehicle.remote_services:getting remote service status for '9fdd4153-e2bb-4322-acd3-xxxxxxxxxx'
DEBUG:httpx._client:HTTP Request: POST https://cocoapi.bmwgroup.com/eadrax-vrccs/v3/presentation/remote-commands/eventStatus?eventId=9fdd4153-e2bb-4322-acd3-637abc970739 "HTTP/1.1 200 OK"
DEBUG:bimmer_connected.vehicle.remote_services:current state of '9fdd4153-e2bb-4322-acd3-xxxxxxxxxx' is: EXECUTED
DEBUG:httpx._client:HTTP Request: POST https://cocoapi.bmwgroup.com/eadrax-vrccs/v4/presentation/remote-commands/eventPosition?eventId=9fdd4153-e2bb-4322-acd3-637abc970739 "HTTP/1.1 400 Bad Request"
ERROR:bimmer_connected.api.client:MyBMWAPIError due to HTTPStatusError: Bad Request -
MyBMWAPIError: HTTPStatusError: Bad Request -

Switched back to version 0.16.1 and vehiclefinder works fine in that version:
DEBUG:bimmer_connected.account:Getting vehicle list
DEBUG:bimmer_connected.account:Getting vehicle list
DEBUG:httpx._client:HTTP Request: POST https://cocoapi.bmwgroup.com/eadrax-vcs/v5/vehicle-list "HTTP/1.1 200 OK"
DEBUG:httpx._client:HTTP Request: GET https://cocoapi.bmwgroup.com/eadrax-vcs/v5/vehicle-data/profile "HTTP/1.1 200 OK"
DEBUG:httpx._client:HTTP Request: POST https://cocoapi.bmwgroup.com/eadrax-vcs/v5/vehicle-list "HTTP/1.1 200 OK"
DEBUG:httpx._client:HTTP Request: POST https://cocoapi.bmwgroup.com/eadrax-vcs/v5/vehicle-list "HTTP/1.1 200 OK"
DEBUG:bimmer_connected.vehicle.vehicle:Getting vehicle list
DEBUG:httpx._client:HTTP Request: GET https://cocoapi.bmwgroup.com/eadrax-vcs/v4/vehicles/state?apptimezone=0&appDateTime=1722932567959 "HTTP/1.1 200 OK"
DEBUG:httpx._client:HTTP Request: GET https://cocoapi.bmwgroup.com/eadrax-crccs/v2/vehicles?fields=charging-profile&has_charging_settings_capabilities=true "HTTP/1.1 200 OK"
DEBUG:httpx._client:HTTP Request: POST https://cocoapi.bmwgroup.com/eadrax-vrccs/v4/presentation/remote-commands/vehicle-finder "HTTP/1.1 200 OK"
DEBUG:bimmer_connected.vehicle.remote_services:getting remote service status for '1f42e9af-4db4-48a8-9009-62e0b357287a'
DEBUG:httpx._client:HTTP Request: POST https://cocoapi.bmwgroup.com/eadrax-vrccs/v3/presentation/remote-commands/eventStatus?eventId=1f42e9af-4db4-48a8-9009-62e0b357287a "HTTP/1.1 200 OK"
DEBUG:bimmer_connected.vehicle.remote_services:current state of '1f42e9af-4db4-48a8-9009-xxxxxxxxxx' is: PENDING
DEBUG:bimmer_connected.vehicle.remote_services:getting remote service status for '1f42e9af-4db4-48a8-9009-62e0b357287a'
DEBUG:httpx._client:HTTP Request: POST https://cocoapi.bmwgroup.com/eadrax-vrccs/v3/presentation/remote-commands/eventStatus?eventId=1f42e9af-4db4-48a8-9009-62e0b357287a "HTTP/1.1 200 OK"
DEBUG:bimmer_connected.vehicle.remote_services:current state of '1f42e9af-4db4-48a8-9009-xxxxxxxxxxxx' is: EXECUTED
ERROR:bimmer_connected.vehicle.location:Error retrieving vehicle position. Unknown position: Set observer position to retrieve vehicle coordinates!
ExecutionState.EXECUTED
{'gps_position': GPSPosition(latitude=5x.xxxxxxxxxxxxxxxxxx, longitude=4.xxxxxxxxxxxxxxxxxx), 'heading': xxx}

@rikroe
Copy link
Member Author

rikroe commented Aug 6, 2024

Thanks for testing, this should not fail. I'll have another look!

@rikroe
Copy link
Member Author

rikroe commented Aug 8, 2024

Just tried it out myself - did you add the lat and lon parameters? They may be required for the new endpoint added with 0.16.0 and I see in your working example that the request is against v3 instead of v4.

@rikroe rikroe merged commit e30f346 into bimmerconnected:master Aug 26, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CLI requires lat/lon in params for charging
2 participants