pymazda icon indicating copy to clipboard operation
pymazda copied to clipboard

Not all functions work for all cars

Open NicolaiVdS opened this issue 4 years ago • 3 comments

I have a 2021 CX-5 (Belgium EU) and i dont have the Start engine function

so when trying to run the client.start_engine() function it errors out Traceback (most recent call last): File "C:/Users/n.vanderstorm/Documents/mazda.py", line 28, in <module> loop.run_until_complete(test()) File "C:\Users\n.vanderstorm\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete return future.result() File "C:/Users/n.vanderstorm/Documents/mazda.py", line 21, in test await client.start_engine(vehicle_id) File "C:\Users\n.vanderstorm\AppData\Local\Programs\Python\Python39\lib\site-packages\pymazda\client.py", line 175, in start_engine await self.controller.engine_start(vehicle_id) File "C:\Users\n.vanderstorm\AppData\Local\Programs\Python\Python39\lib\site-packages\pymazda\controller.py", line 111, in engine_start response = await self.connection.api_request("POST", "remoteServices/engineStart/v4", body_dict=post_body, needs_keys=True, needs_auth=True) File "C:\Users\n.vanderstorm\AppData\Local\Programs\Python\Python39\lib\site-packages\pymazda\connection.py", line 158, in api_request return await self.__api_request_retry(method, uri, query_dict, body_dict, needs_keys, needs_auth, num_retries=0) File "C:\Users\n.vanderstorm\AppData\Local\Programs\Python\Python39\lib\site-packages\pymazda\connection.py", line 173, in __api_request_retry return await self.__send_api_request(method, uri, query_dict, body_dict, needs_keys, needs_auth) File "C:\Users\n.vanderstorm\AppData\Local\Programs\Python\Python39\lib\site-packages\pymazda\connection.py", line 245, in __send_api_request raise MazdaException("Request failed: " + response_json["error"]) pymazda.exceptions.MazdaException: Request failed: Please wait for a while and try again.When an error continues, please contact the call center.[E400002]

would it be possible to probe what functions are available to each car ?

NicolaiVdS avatar Jul 14 '21 06:07 NicolaiVdS

Hi @NicolaiVdS

When you log into the MyMazda app on your phone, do you see the "start engine" function there? If so, what happens when you try it? Just trying to narrow down how the app is detecting what functions are available to your car.

bdr99 avatar Jul 15 '21 02:07 bdr99

Hi @NicolaiVdS

When you log into the MyMazda app on your phone, do you see the "start engine" function there? If so, what happens when you try it? Just trying to narrow down how the app is detecting what functions are available to your car.

@bdr99 in the app i only get the lock/unlock and locate features

NicolaiVdS avatar Jul 15 '21 13:07 NicolaiVdS

@NicolaiVdS I may have figured out how the app determines which features are available for your car. I've created a new branch in this repo called available_service. It adds a new endpoint called get_available_service() which takes a vehicle ID and returns info about the services available. It is documented in the readme on that branch.

Would you mind giving this a try and letting me know what response you get from calling that endpoint?

bdr99 avatar Jul 21 '21 01:07 bdr99