tesla_custom.api throws an UnknownError
See original GitHub issueVersion of the custom_component
1.2.0
Configuration
service: tesla_custom.api
data:
command: CHANGE_CLIMATE_TEMPERATURE_SETTING
parameters:
path_vars:
vehicle_id: '786889216'
driver_temp: 23.0
passenger_temp: 23.0
wake_if_asleep: true
or
service: tesla_custom.api
data:
command: REMOTE_SEAT_HEATER_REQUEST
parameters:
path_vars:
vehicle_id: '786889216'
heater: 1
level: 1
wake_if_asleep: true
Describe the bug
Can’t seem to get any tesla_custom.api service calls to work.
Both the above examples return an UnknownError immediately. I imagine i’m doing something wrong, but not sure what. I grabbed the vehicle_id from teslafi - it should always be the same, right?
Logger: homeassistant.components.websocket_api.http.connection Source: custom_components/tesla_custom/services.py:89 Integration: Home Assistant WebSocket API (documentation, issues) First occurred: 4:13:54 PM (3 occurrences) Last logged: 4:24:49 PM
[281473288586144] Error handling message: Unknown error
Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py”, line 26, in _handle_async_response await func(hass, connection, msg) File “/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py”, line 525, in handle_execute_script await script_obj.async_run(msg.get(“variables”), context=context) File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 1219, in async_run await asyncio.shield(run.async_run()) File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 353, in async_run await self._async_step(log_exceptions=False) File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 371, in _async_step await getattr(self, handler)() File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 571, in _async_call_service_step await service_task File “/usr/src/homeassistant/homeassistant/core.py”, line 1491, in async_call task.result() File “/usr/src/homeassistant/homeassistant/core.py”, line 1526, in _execute_service await handler.job.target(service_call) File “/config/custom_components/tesla_custom/services.py”, line 43, in async_call_tesla_service await api(service_call) File “/config/custom_components/tesla_custom/services.py”, line 89, in api return await controller.api(name=command, path_vars=path_vars, **parameters) File “/usr/local/lib/python3.9/site-packages/teslajsonpy/controller.py”, line 166, in wake_up result = await wrapped(*args, **kwargs) File “/usr/local/lib/python3.9/site-packages/teslajsonpy/controller.py”, line 1180, in api return await self.__connection.post( File “/usr/local/lib/python3.9/site-packages/teslajsonpy/connection.py”, line 167, in post return await self.__open( File “/usr/local/lib/python3.9/site-packages/teslajsonpy/connection.py”, line 218, in __open raise TeslaException(resp.status_code) teslajsonpy.exceptions.TeslaException
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (9 by maintainers)
Top GitHub Comments
Hi, i also get the same error. But can can see a very strange behavior. The Integration is installed fine in Home Assistant and I can control the car via the switches. I just cannot call the Tesla API via the service for example to change the amps. My ID in HASS ends with a 10. But if the integration makes a get request I get an id with 11 at the end. Rest is identical.
Therefore I results in an unknown error I guess:
Thats a get command in the logs (charger switch in HASS)
Does his matter in which location the car is? I guess is should not important if its a US car or EU. Firmware is 2021.44.30.2
This is intended to be direct access to the underlying api. Adding a translation layer defeats the point of direct access.
Since every attribute get logged in HA at each update, this is not advisable. You’re welcome to submit a PR for a sensor that does this if you want but it must be default off and I won’t be maintaining it.