tesla: Can't force data update anymore

Version of the custom_component




Describe the bug

I’ve been using this integration to connect to my Model S and charge it on solar power with the following script: https://github.com/flashg1/TeslaSolarCharger

It’s been working fine for a couple of months (with some errors on the script’s side) but since this morning I noticed the car not charging. I checked and all data from the integration were available, however I received an unknown error when clicking the force data update-button. As the script heavily relies on this button to be able to work this seems to be the issue at this point.

I checked the logs and there are multiple API errors (see logs). I tried reinstalling the integration, using a new refresh token. I can add the car without any issues but still the force data update-button isn’t working.

Any idea’s?

Debug log

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:238
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 10:37:42 (7 occurrences)
Last logged: 10:54:40

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 238, in handle_call_service
    response = await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 2149, in async_call
    response_data = await coro
  File "/usr/src/homeassistant/homeassistant/core.py", line 2186, in _execute_service
    return await target(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 272, in handle_service
    return await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 882, in entity_service_call
    single_response = await _handle_entity_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 952, in _handle_entity_call
    result = await task
  File "/usr/src/homeassistant/homeassistant/components/button/__init__.py", line 132, in _async_press_action
    await self.async_press()
  File "/config/custom_components/tesla_custom/button.py", line 84, in async_press
    await self.update_controller(wake_if_asleep=True, force=True)
  File "/config/custom_components/tesla_custom/base.py", line 82, in update_controller
    await self.coordinator.controller.update(
  File "/usr/local/lib/python3.11/site-packages/teslajsonpy/controller.py", line 734, in update
    cars = await self.get_vehicles()
  File "/usr/local/lib/python3.11/site-packages/teslajsonpy/controller.py", line 300, in get_vehicles
    return (await self.api("VEHICLE_LIST"))["response"]
  File "/usr/local/lib/python3.11/site-packages/teslajsonpy/controller.py", line 1319, in api
    return await self.__post_with_retries_except_unavailable(
  File "/usr/local/lib/python3.11/site-packages/tenacity/_asyncio.py", line 88, in async_wrapped
    return await fn(*args, **kwargs)
  File "/usr/local/lib/python3.11/site-packages/tenacity/_asyncio.py", line 47, in __call__
    do = self.iter(retry_state=retry_state)
  File "/usr/local/lib/python3.11/site-packages/tenacity/__init__.py", line 325, in iter
    raise retry_exc.reraise()
  File "/usr/local/lib/python3.11/site-packages/tenacity/__init__.py", line 158, in reraise
    raise self.last_attempt.result()
  File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
  File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.11/site-packages/tenacity/_asyncio.py", line 50, in __call__
    result = await fn(*args, **kwargs)
  File "/usr/local/lib/python3.11/site-packages/teslajsonpy/controller.py", line 1351, in __post_with_retries_except_unavailable
    return await self.__connection.post(command, method=method, data=data, url=url)
  File "/usr/local/lib/python3.11/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.11/site-packages/teslajsonpy/connection.py", line 216, in __open
    raise TeslaException(resp.status_code)
Logger: asyncio
Source: components/websocket_api/http.py:151
First occurred: 10:52:35 (4 occurrences)
Last logged: 10:52:35

socket.send() raised exception.
Deze fout is ontstaan door een aangepaste integratie.

Logger: custom_components.tesla_custom
Source: helpers/update_coordinator.py:332
Integration: Tesla Custom Integration (documentation, issues)
First occurred: 10:35:34 (2 occurrences)
Last logged: 10:46:10

Error fetching tesla_custom data: Error communicating with API:

About this issue

  • Original URL
  • State: closed
  • Created 5 months ago
  • Reactions: 11
  • Comments: 17 (1 by maintainers)

Most upvoted comments

Please refrain from posting generic “me too” type comments, if you want to watch for updates, click the subscribe button image

Seems like only ‘leasing’ cars have this issue.

I have one Y (owned) and 3 (leased).

Y works fine but issue with 3

Thanks for the info. Is there a way to fix this myself or do I have to wait for an official update?

If you’re happy to make a Pull Request to fix it then by all means, otherwise you’ll have to wait for someone else to get round to doing it

Sadly my coding skills are less than basic. Otherwise I’d be happy to do so. Let’s hope someone will come with a solution. If needed I’ll be available to test!