For those that have a Tesla Car & HA integration or similar

I feel bad for you, but somewhat good for me that it may not be something I did wrong.
This is the log

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:239
integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 5:59:54 PM (1 occurrences)
Last logged: 5:59:54 PM

[547085914176] 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 "/usr/src/homeassistant/homeassistant/components/number/__init__.py", line 116, in async_set_value
    await entity.async_set_native_value(native_value)
  File "/config/custom_components/tesla_custom/number.py", line 91, in async_set_native_value
    await self._car.set_charging_amps(value)
  File "/usr/local/lib/python3.12/site-packages/teslajsonpy/car.py", line 897, in set_charging_amps
    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 1367, in api
    response = await self.__post_with_retries(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  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 1390, in __post_with_retries
    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

Something to do with authentication, inserting an e key via Tessie. It hasn’t worked for me yet.

Has anyone been able to adjust the heater setting for recycle/fresh? We have a road tunnel where you get a lot of diesel fumes if you leave it on “fresh”. Love to be able to use GPS to automatically switch to recycle just before we enter the tunnel, but that setting doesn’t seem to be exposed in the API.

I created an automation to automatically stop charging and unlock the charger port when the car is fully charged, is at home and the front door of the house is opened.

I don’t have a Tesla charger so it lacks the button on top to disconnect the charger by pressing it. Meaning that you have to use the tesla display or app to disconnect the charger. Also, there is no native option to unlock the charger cable when it is fully charged. So now, as long as the location is “home” and the battery raw SoC is 100, the charger disconnects when the front door is opened.

This is mostly a WAF initiated automation to accept the car as part of the family :slight_smile:

Hi @Kvessen how are you connecting HA to your Tesla? The reason I am asking is because my Tesla Integration doesn’t allow me to send commands to the car or to Tesla. It only reads car’s stuff. I can see many Car’s sensors but I can’t send commands back to the car.

1 Like

yes that is my case as well. For the past few months I can on only READ data from the car.

1 Like

There is a new authentication method for the Tesla API.

& @EndUser I assume you are using the Tessie integration. If so you need to add an authentication virtual key to Tessie.com

I did not know that Tessie integration but I am not inclined to pay $ 150/yr

Tessie is the home assistant integration for Tesla cars. What are you using?

If you are using this GitHub - alandtse/tesla: Tesla custom integration for Home Assistant. This requires a refresh token be generated by third-party apps to login. there are instructions for using the fleet API right there.

Hi there,

I use this integration. Works great and I can push these kind of commands to the car perfectly fine. Releases · alandtse/tesla · GitHub

Hey, i did an automation in that sends a notification to my wife’s phone when I’m on my way home, including the estimated arrival time. you could also set the condition, when you leave the work zone.

alias: "Benachrichtigung: Bin auf Heimweg"
description: ""
trigger:
  - platform: state
    entity_id:
      - device_tracker.tesla_destination_location_tracker
    to: home
condition: []
action:
  - service: notify.mobile_app_nadine
    metadata: {}
    data:
      title: Bin bald da
      message: >
        Hallo Schatz 😘, ich bin auf dem Weg nach Hause. 🏡 Meine
        voraussichtliche Ankunftszeit ist {{
        states('sensor.tesla_arrival_time') }}. ⏰
      data:
        importance: high
        priority: high
mode: single
1 Like

What did you do to make the Tesla Integration connect to your Tesla ? In my case, the Integration “reads” from my Tesla but does not “write” to it.
I have seen some solutions but they seem pretty complicated (to me).

Really? Try reading the instructions! GitHub - alandtse/tesla: Tesla custom integration for Home Assistant. This requires a refresh token be generated by third-party apps to login.

Hi @nickrout I actually started to install the Tesla Fleet Api but the problem is I don’t have a domain name (FQDN) with a valid SSL certificate (as needed in the tesla-http-proxy-addon) … my HA is not actually being exposed to the internet - it only works from inside my LAN or using NabuCasa if I want to access from the outside.

So, just to double check: you have a Domain Name and SSL right?

Thank you

No I use Tessie, which has its own way to access the fleet as API.

Be aware that a native Tesla integration is apparently due in 2024.8. So maybe wait to see how that works.

Edit, see Reinstate Tesla integration - #20 by Brett_Adams

3 Likes

Ouh ! Ok … I did see the Tessie and it’s amazing :slight_smile: Now I don’t have money but it is in my list !

Thanks

Hi everyone,
I was looking for automation ideas with my tesla. Thought I would share 2 of mine.

  1. I don’t like having to open the app and find the button and press it to open the frunk. So, I stuck a small NFC sticker under the driver side wing mirror. All I have to do is to bring my phone under the wing mirror and the frunk will pop open.:slight_smile:

  2. Again, I am annoyed that there is no button in unlock the charging port once plugged in. You have to use the app to unlock the port. This is only applicable to 3rd party chargers. If you are using Tesla wall charger or supercharger, you can simply press the button the plug to unlock the port. I now have created an automation, that if the car is at home and plugged in, when I open the front door, the charge port will unlock and I can simply pull the cable out. Please note, I am not taking about the charge port door.

What I am still trying to find a reliable solution to, is to open my gate when I arrive home. Currently I use the phone location which is hit and miss. I tried to use the tesla location but as it is polling every 11 mins it is not going to help as my usual commute is under 10 mins. I tried to force to poll every 60 seconds but still not working great. Any suggestions for this automation would be appreciated.

Cheers

1 Like

Would you mind sharing your automation. Keen to know how you sorted the polling issue