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

Connection failed when sending command to Tesla #861

Closed
zapccu opened this issue Feb 20, 2024 · 4 comments
Closed

Connection failed when sending command to Tesla #861

zapccu opened this issue Feb 20, 2024 · 4 comments

Comments

@zapccu
Copy link

zapccu commented Feb 20, 2024

Version of the custom_component

Latest version

Describe the bug

Car is awake and querying information from Tesla works as expected. When sending a command, a connection error appears after some seconds. The log below is a result of sending a stop loading command to Tesla.

Debug log


2024-02-20 11:52:06.124 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140257780111168]
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 240, in handle_call_service
response = await hass.services.async_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2279, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2316, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 892, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 962, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/config/custom_components/tesla_custom/switch.py", line 119, in async_turn_off
await self._car.stop_charge()
File "/usr/local/lib/python3.12/site-packages/teslajsonpy/car.py", line 1122, in stop_charge
data = await self._send_command("STOP_CHARGE", wake_if_asleep=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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 1318, in api
return await self.__post_with_retries_except_unavailable(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/_asyncio.py", line 88, in async_wrapped
return await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/_asyncio.py", line 47, in __call__
do = self.iter(retry_state=retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/__init__.py", line 325, in iter
raise retry_exc.reraise()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/__init__.py", line 158, 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 50, in __call__
result = await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/teslajsonpy/controller.py", line 1350, 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 165, 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 217, in __open
raise TeslaException(resp.status_code)
teslajsonpy.exceptions.TeslaException


@tugakufi
Copy link

same here

@BillRocker
Copy link

Same problem. It loads all the data correctly, but when I want to change something, after a moment of inactivity, a message appears: unknown error. I have a new model 3

@rantanpe
Copy link

Same problem here.

@skipishere
Copy link
Collaborator

Duplicate of #774 and part of #743

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

No branches or pull requests

5 participants