Tesla integration not working

FWIW, 2021.10.0 (and 1 and 2) all work with the Tesla Custom Integration for me (for now???). Yahoo!

1 Like

I’m struggling to get the Tesla custom component integration working. Running core-2021.10.6. It installs but the integration option doesn’t show up.

I have the custom integration installed in HACS:

I can see the files in custom_components/

I have rebooted HA fully, even the entire host, yet the integration still doesn’t show up:

Try posting here:

What happens if you re-install or uninstall/install in HACS? Which version is installed?

Hard refresh your browser.

That fixed it. Uninstall in HACS and reinstall, then reboot of HA did it. Nothing like the off again, on again approach…

I haven’t looked at this for a while, after it stopped working following my last update. I knew there was a custom_component option, but I’d struggled to get an earlier version of that working too.

Got things running first time with v1.3.1 via HACS and using Auth for Tesla on iOS, so big thanks to @alandtse for making this work.

1 Like

Stopped working for me after HA 2021.12.4 install. HACS remove/install didn’t help. The ‘Tesla Custom Integration’ - Delete didn’t work (seemed to have no effect). Numerous core reboots - no help.

Any ideas?

From the log:

Logger: aiohttp.server
Source: custom_components/tesla_custom/__init__.py:9
Integration: Tesla Custom Integration (documentation, issues)
First occurred: December 24, 2021, 9:42:51 AM (2 occurrences)
Last logged: December 24, 2021, 6:14:45 PM

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 92, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 78, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 181, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 137, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 71, in delete
    result = await hass.config_entries.async_remove(entry_id)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 831, in async_remove
    await entry.async_remove(self.hass)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 487, in async_remove
    component = integration.get_component()
  File "/usr/src/homeassistant/homeassistant/loader.py", line 522, in get_component
    cache[self.domain] = importlib.import_module(self.pkg_path)
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/config/custom_components/tesla_custom/__init__.py", line 9, in <module>
    from homeassistant.const import (
ImportError: cannot import name 'HTTP_UNAUTHORIZED' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)

I’m running 2021.12.2 and it’s working as usual. There is a 2021.12.5 you might try. YMMV Updates seem to break things, so I don’t update unless really necessary.

I’m on 2021.12.5 and the integration is working. I vaguely recall having deleted and (re)installed the Tesla integration recently, including creating a new token and having a not-so-smooth-remove-integration-reinstall-integration-flow.

I installed fresh from 2022.1.2 or something and the official integration has worked without problem through all upgrades to 2022.4.7 now. Core support seems fine to me

Hi all. I recently got a Tesla and added this custom component about 2 weeks ago. Been working great, but it stopped working last night and is unable to communicate with Tesla servers. Does the token need to be refreshed occasionally? I am attempting to uninstall/reinstall now with a new token, but I keep getting an “Unknown Error”. Any ideas? Is anyone else experiencing an outage?

Hi, I changed password on account tesla, and of course the integration stopped working.

Now I changed again the password, deleted the integrtaion, restarted HA, changed toklen, added the integration with new token … but still
Failed to set up: could not authenticate

any hint?

EDIT, ok the Andorid app weas giving me the same token (which was not working), so I used Chrome addon token generator which gave a different token, and with this token it started working

2 Likes