AudiAPI icon indicating copy to clipboard operation
AudiAPI copied to clipboard

Current position

Open keesschollaart81 opened this issue 6 years ago • 5 comments

Thanks for the Api, nice work!

I'm trying to get the current location of my car, is that in any way supported? The CarFinderService throws:

Exception: API error: {'errorCode': 'CF.security.9007', 'description': 'MBB Roles and Rights responded: 404 - Not Found'}

keesschollaart81 avatar Jun 16 '18 10:06 keesschollaart81

The CarFinderService requires special permissions for your account. At least here in germany I can't get any data from it. But I guess it would be possible to get the last parked position of the car since the official app also shows these information.

davidgiga1993 avatar Jun 16 '18 11:06 davidgiga1993

@keesschollaart81 I'm able to run something like this:

cfs = CarFinderService(api,vehicle)
print(str(cfs.find()))

This will show coordinates and parking time so it is probably not "live" while moving, but the parking position as noted by @davidgiga1993 As a note i live in sweden.

djmoonshine avatar Nov 08 '18 07:11 djmoonshine

Hi davidgiga1993, I have tested it but some errors like below:

Traceback (most recent call last): File "test.py", line 46, in res = asyncio.get_event_loop().run_until_complete( task ) File "/usr/lib/python3.5/asyncio/base_events.py", line 466, in run_until_complete return future.result() File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result raise self._exception File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step result = coro.send(None) File "test.py", line 35, in main account = AudiConnectAccount (user, password) File "/home/pi/.homeassistant/custom_components/audiconnect/audi_connect_account.py", line 30, in init self.logon_service.login(username, password) File "/usr/local/lib/python3.5/dist-packages/audiapi/Services.py", line 190, in login token = self.__login_request(user, password) File "/usr/local/lib/python3.5/dist-packages/audiapi/Services.py", line 220, in __login_request reply = self._api.post(self.url('/token'), data, use_json=False) File "/usr/local/lib/python3.5/dist-packages/audiapi/API.py", line 62, in post return self.__handle_error(r.json()) File "/usr/local/lib/python3.5/dist-packages/audiapi/API.py", line 68, in __handle_error raise Exception('API error: ' + str(error) + '\n' + error_msg) Exception: API error: invalid_grant expectedTenant:zh-CN

and I had modified the COUNTRY from DE to CN in “/usr/local/lib/python3.5/dist-packages/audiapi/Services.py” , audiapi had been installed with “pip3 install audiapi” .

Thanks.

rangerzhou avatar May 28 '19 10:05 rangerzhou

In the UK, I can get the car's position when it is locked but not when it is being driven

jgardiner68 avatar Jul 15 '20 11:07 jgardiner68

@jgardiner68 That's the expected behavior. If you don't have the valet package you can't get the realtime position of the car. Only the parking position.

davidgiga1993 avatar Jul 15 '20 13:07 davidgiga1993