Closed Nessy1970 closed 1 month ago
Do these debug logs correspond to the same time period when the exception happened? I don’t see any errors in the log you posted.
If this recently broke without any changes from you, I would guess it’s because Tesla is now requiring the Fleet API for your vehicle. Read the documentation about setting that up.
Yes the debug log comes from when I reproduced the problem (but it was too big for Github, I had to take it only from the end of the file). On the other hand I had the following in HA's diary
Enregistreur: homeassistant.components.websocket_api.http.connection Source: components/websocket_api/commands.py:239 intégration: Home Assistant WebSocket API (documentation, problèmes) S'est produit pour la première fois: 14:31:16 (2 occurrences) Dernier enregistrement: 14:32:32
[546798003392] Unexpected exception Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 239, in handle_call_service response = await hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2738, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2779, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 975, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1047, in _handle_entity_call result = await task ^^^^^^^^^^ File "/config/custom_components/tesla_custom/switch.py", line 158, in async_turn_off await self._car.set_sentry_mode(False) File "/usr/local/lib/python3.12/site-packages/teslajsonpy/car.py", line 1094, in set_sentry_mode data = await self._send_command( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/teslajsonpy/car.py", line 775, in _send_command raise ex File "/usr/local/lib/python3.12/site-packages/teslajsonpy/car.py", line 760, in _send_command data = await self._controller.api( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/teslajsonpy/controller.py", line 1375, in api return await self.post_with_retries_except_unavailable( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/tenacity/_asyncio.py", line 142, in async_wrapped return await fn(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/tenacity/_asyncio.py", line 58, in call do = await self.iter(retry_state=retry_state) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/tenacity/_asyncio.py", line 110, in iter result = await action(retry_state) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/tenacity/_asyncio.py", line 78, in inner return fn(args, **kwargs) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/tenacity/init.py", line 410, in exc_check raise retry_exc.reraise() ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/tenacity/init.py", line 183, in reraise raise self.last_attempt.result() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 449, in result return self.get_result() ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result raise self._exception File "/usr/local/lib/python3.12/site-packages/tenacity/_asyncio.py", line 61, in call result = await fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/teslajsonpy/controller.py", line 1407, in post_with_retries_except_unavailable return await self.connection.post(command, method=method, data=data, url=url) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/teslajsonpy/connection.py", line 166, in post return await self.open(url, method=method, headers=self.head, data=data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/teslajsonpy/connection.py", line 218, in open raise TeslaException(resp.status_code) teslajsonpy.exceptions.TeslaException
the complete log and attached! home-assistant_tesla_custom_2024-05-27T12-34-22.313Z.log
I also have the same issue and have the fleet API configured
same here from yesterday, I can update the data but any command doesn't work.
Same
Please do not add "same" or "me too" like comments, it makes issues far longer & harder to navigate and doesn't help anyone unless you're adding in additional details to help narrow down or replicate.
If you are interested in the issue, please use the subscribe to issue button to be notified of any updates.
@Nessy1970 the error is clearly stated in your log file:
2024-05-27 14:32:17.880 DEBUG (MainThread) [teslajsonpy.connection] 403: {"response":null,"error":"Tesla Vehicle Command Protocol required, please refer to the documentation here: https://developer.tesla.com/docs/fleet-api#2023-10-09-rest-api-vehicle-commands-endpoint-deprecation-warning","error_description":""}
Additionally, when opening this issue you ticked the box saying:
I have read about the Fleet API and understand I may need to use it I understand issues relating to read only commands will be auto closed if not using the Fleet API.
@Nessy1970 the error is clearly stated in your log file:
2024-05-27 14:32:17.880 DEBUG (MainThread) [teslajsonpy.connection] 403: {"response":null,"error":"Tesla Vehicle Command Protocol required, please refer to the documentation here: https://developer.tesla.com/docs/fleet-api#2023-10-09-rest-api-vehicle-commands-endpoint-deprecation-warning","error_description":""}
Additionally, when opening this issue you ticked the box saying:
I have read about the Fleet API and understand I may need to use it I understand issues relating to read only commands will be auto closed if not using the Fleet API.
Therefore even for those who have always worked until last week they have discontinued the possibility of sending commands via integration. The use of the fleet API method seems imho to be a rather complex solution, I deduce that this add on no longer makes much sense to have, also because there are no clear guides on how to apply the fleet API other than just links that refer to unclear and complex instructions. Thank you.
@Disincentivato unfortunately we know it's a complex setup, and is not something we have control over because Tesla want this to be used by Fleets and not for individual consumers (something that many people have raised with Tesla).
If your vehicle is affected by this (most likely), you'll need to install the Tesla HTTP Proxy add-on and configure this component to use it. This requires a complex setup; see here for details. After configuring the add-on, tick the box for "Fleet API Proxy" in this component, and the config flow will autofill your Client ID, Proxy URL, and SSL certificate.
If you can figure out a way to either make it less complicated or the instructions clearer, then please submit a PR, as this is all community driven and people have other jobs/commitments that make it hard to put lots of time into.
@skipishere thanks for your reply, I read the instructions to configure the proxy and unfortunately it is beyond my skills. I stukked at the first row :) I really appreciate the work that the community does during their free time to make the add on as functional as possible. At the moment I will wait to see if alternative solutions come out.
I configured Fleet API, and everything works again. Except sending a destination address in the car.
@skipishere thanks for your reply, I read the instructions to configure the proxy and unfortunately it is beyond my skills. I stukked at the first row :) I really appreciate the work that the community does during their free time to make the add on as functional as possible. At the moment I will wait to see if alternative solutions come out.
@skipishere thanks for your reply, I read the instructions to configure the proxy and unfortunately it is beyond my skills. I stukked at the first row :) I really appreciate the work that the community does during their free time to make the add on as functional as possible. At the moment I will wait to see if alternative solutions come out.
I have a step-by-step tutorial, but it is in French https://forum.hacf.fr/t/lintegration-tesla-et-automatisation/7572/218?page=10
@Nessy1970 thanks a lot!
Hi, is this the only solution now with fleets? Why is the other option then still available? Best,
@traveler6666 its still available because (A) Tesla has not given a clear cutoff date when it will completely stop working; it seems to be a gradual rollout. And (B) the old method still works fine for reading sensor data, not sending commands.
@traveler6666 at the moment some cars pre2024 still work on the old way but "at some point" will be forced to use the fleet API. Also from docs
Pre-2021 Model S/X are excluded from these changes.
ok. Understood. Thank you.
@traveler6666 its still available because (A) Tesla has not given a clear cutoff date when it will completely stop working; it seems to be a gradual rollout. And (B) the old method still works fine for reading sensor data, not sending commands.
Till today I have been using TeslaMate to retrieve data and the Fleet API for commands (for solar charging), and this worked well, but now seems to be rate limited (with Tesla suggesting 5 minute poll). I had therefore turned polling to once a day, assuming this might contribute to the 50 commands per day limit, as I can usually just live under that limit.
Could someone please confirm:-
@abreingan please open up a separate discussion
Is there an existing issue for this?
I have read about the Fleet API and understand I may need to use it
Version of the Tesla component
3.21.0
Version of the Tesla car software
2024.14.6
Model
Model 3 - 2022
Current Behavior
Commanding an action from HA to the car no longer works. (ex: switch.turn_on sentry mode) Service call failed! On the other hand, from the Tesla application, the information on the status of the sentinel is sent correctly to HA.
Expected Behavior
Can send commands to the car as before.
Debug logs
Anything else?
No response