Not sure this is helpful, but mine is working again. I updated to 2020.2.3 a few days ago. That didn’t immediately resolve it, but today after an unrelated update to HASS OS 5.12 everything came back online. For those just coming across this thread, maybe try another restart.
Same here! Now I just need to get the powerwall automations I had working again…
anyone else seeing this starting today? Unexpected error fetching tesla data: tuple index out of range
Yes, I also get
IndexError: tuple index out of range
I’m on 2021.2.3
seems to have sorted itself out, odd.
Hi Is this generally fixed as mine is still showing unavailable. Is there something I can do to reconnect?
I deleted and readded the integration with a restart in between. No issues.
THanks - Did the trick
Deleted Tesla, restarted, now Tesla integration refuses login credentials.
I just tried to set up the Tesla integration for the first time, but after entering my e-mail address and password I get an error. The log shows:
Logger: aiohttp.server
Source: components/tesla/config_flow.py:159
First occurred: 18:55:44 (2 occurrences)
Last logged: 18:56:11
Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
resp = await self._request_handler(request)
File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 119, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 56, in security_filter_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 18, in request_context_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 74, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 135, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 131, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 155, in post
return await super().post(request, flow_id)
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 60, in wrapper
result = await method(view, request, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 107, in post
result = await self._flow_mgr.async_configure(flow_id, data)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 156, in async_configure
result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 214, in _async_handle_step
result: dict = await getattr(flow, method)(user_input)
File "/usr/src/homeassistant/homeassistant/components/tesla/config_flow.py", line 57, in async_step_user
info = await validate_input(self.hass, user_input)
File "/usr/src/homeassistant/homeassistant/components/tesla/config_flow.py", line 159, in validate_input
(config[CONF_TOKEN], config[CONF_ACCESS_TOKEN]) = await controller.connect(
File "/usr/local/lib/python3.8/site-packages/teslajsonpy/controller.py", line 268, in connect
cars = await self.get_vehicles()
File "/usr/local/lib/python3.8/site-packages/backoff/_async.py", line 133, in retry
ret = await target(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/teslajsonpy/controller.py", line 357, in get_vehicles
return (await self.__connection.get("vehicles"))["response"]
File "/usr/local/lib/python3.8/site-packages/teslajsonpy/connection.py", line 78, in get
return await self.post(command, "get", None)
File "/usr/local/lib/python3.8/site-packages/teslajsonpy/connection.py", line 96, in post
self.code = await self.get_authorization_code(
File "/usr/local/lib/python3.8/site-packages/teslajsonpy/connection.py", line 372, in get_authorization_code
code_url = URL(resp.history[-1].url)
IndexError: tuple index out of range
So that looks like the error mentioned before. I have set-ups two-factor authentication on my Tesla account. Perhaps this integration can’t handle that?
Tesla wasn’t working for me either.
Removed integration, tried adding, restart, tried adding, but no success.
I don’t have MFA enabled. But I would understand that the integration can’t handle MFA.
At the bottom of the stacktrace: tuple index out of range
Edit: Known issue at Unable to add Tesla integration · Issue #46397 · home-assistant/core · GitHub
Same error here.
I even added a dedicated account (because the integration sadly doesn‘t support 2fa) - and still „unknown error“.
Exactly the same errors in logs here
I have same error, so I subscribe.
Thanks
Same here
same here.
I took a quick look and the integration is using teslajsonpy
0.11.5, I updated it to 0.18.0 and still doesnt work. I think the underlaying teslajsonpy
is the issue.
I have an integration that changes mode in the powerwall and also has to go through the public API. It uses teslapy
1.1.0 and it works.
Changing the integration to use teslapy
will be a big change… I think we need to figure out why teslajsonpy
doesnt work and can use teslapy
as reference.
The callstack when using 0.18.0 is:
File "/config/custom_components/tesla/config_flow.py", line 57, in async_step_user
info = await validate_input(self.hass, user_input)
File "/config/custom_components/tesla/config_flow.py", line 159, in validate_input
(config[CONF_TOKEN], config[CONF_ACCESS_TOKEN]) = await controller.connect(
File "/usr/local/lib/python3.8/site-packages/teslajsonpy/controller.py", line 288, in connect
cars = await self.get_vehicles()
File "/usr/local/lib/python3.8/site-packages/backoff/_async.py", line 133, in retry
ret = await target(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/teslajsonpy/controller.py", line 407, in get_vehicles
return (await self.__connection.get("vehicles"))["response"]
File "/usr/local/lib/python3.8/site-packages/teslajsonpy/connection.py", line 90, in get
return await self.post(command, "get", None)
File "/usr/local/lib/python3.8/site-packages/teslajsonpy/connection.py", line 112, in post
self.code = await self.get_authorization_code(
File "/usr/local/lib/python3.8/site-packages/teslajsonpy/connection.py", line 405, in get_authorization_code
html = await resp.text()
TypeError: 'str' object is not callable
Fixed in 2021.5.0 for me.
+1 for 2021.5.0
Yippee! Me too.