Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration pulls states but doesn't send commands #882

Closed
OMVMMG opened this issue Mar 6, 2024 · 2 comments
Closed

Integration pulls states but doesn't send commands #882

OMVMMG opened this issue Mar 6, 2024 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@OMVMMG
Copy link

OMVMMG commented Mar 6, 2024

Version v3.19.10

Configuration

Polling every 720 seconds
Always
Sync Data from TeslaMate via MQTT

Describe the bug

I can see all the current states and they update after polling but every time I send a command (eg. open door, modify charging amps, etc) I get 'Failed to call service number/set_value. unknown error'

Debug log

2024-03-06 23:37:35.301 DEBUG (MainThread) [teslajsonpy.controller] 62785: Wakeup took 0 seconds, state: online
2024-03-06 23:37:35.301 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 5:45:58
2024-03-06 23:37:35.302 DEBUG (MainThread) [teslajsonpy.connection] post: https://owner-api.teslamotors.com/api/1/vehicles/3744658249102283/command/set_temps {'driver_temp': 21.5, 'passenger_temp': 21.5}
2024-03-06 23:37:35.432 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update()
2024-03-06 23:37:35.432 DEBUG (MainThread) [teslajsonpy.controller] Get vehicles. Force: False Time: 46 Interval 60
2024-03-06 23:37:35.432 DEBUG (MainThread) [teslajsonpy.controller] 62785: online. Polling policy: normal. Update state: trying_to_sleep. Since last park: 1081. Since last wake up: 1112. Idle interval: 600. shift_state: None sentry: False climate: False, charging: Disconnected
2024-03-06 23:37:35.432 DEBUG (MainThread) [teslajsonpy.controller] 62785: online; Polling policy set to 'normal', trying to sleep; scan throttled to 720 seconds and will ignore updates for 340 seconds
2024-03-06 23:37:35.432 DEBUG (MainThread) [teslajsonpy.controller] 62785: Skipping update with state online. Polling: True. Last update: 380 ago. Last parked: 1081 ago. Last wake up 1112 ago.
2024-03-06 23:37:35.432 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.000 seconds (success: True)
2024-03-06 23:37:35.520 DEBUG (MainThread) [teslajsonpy.connection] 403: {"response":null,"error":"Tesla Vehicle Command Protocol required, please refer to the documentation here: https://developer.tesla.com/docs/fleet-api#2023-10-09-rest-api-vehicle-commands-endpoint-deprecation-warning","error_description":""}
2024-03-06 23:37:37.065 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 5:45:56
2024-03-06 23:37:37.065 DEBUG (MainThread) [teslajsonpy.connection] post: https://owner-api.teslamotors.com/api/1/vehicles/3744658249102283/command/set_temps {'driver_temp': 21.5, 'passenger_temp': 21.5}
2024-03-06 23:37:37.284 DEBUG (MainThread) [teslajsonpy.connection] 403: {"response":null,"error":"Tesla Vehicle Command Protocol required, please refer to the documentation here: https://developer.tesla.com/docs/fleet-api#2023-10-09-rest-api-vehicle-commands-endpoint-deprecation-warning","error_description":""}
2024-03-06 23:37:39.569 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update()
2024-03-06 23:37:39.569 DEBUG (MainThread) [teslajsonpy.controller] Get vehicles. Force: False Time: 51 Interval 60
2024-03-06 23:37:39.569 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.000 seconds (success: True)
2024-03-06 23:37:39.861 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 5:45:54
2024-03-06 23:37:39.861 DEBUG (MainThread) [teslajsonpy.connection] post: https://owner-api.teslamotors.com/api/1/vehicles/3744658249102283/command/set_temps {'driver_temp': 21.5, 'passenger_temp': 21.5}
2024-03-06 23:37:40.081 DEBUG (MainThread) [teslajsonpy.connection] 403: {"response":null,"error":"Tesla Vehicle Command Protocol required, please refer to the documentation here: https://developer.tesla.com/docs/fleet-api#2023-10-09-rest-api-vehicle-commands-endpoint-deprecation-warning","error_description":""}
2024-03-06 23:37:44.628 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 5:45:49
2024-03-06 23:37:44.628 DEBUG (MainThread) [teslajsonpy.connection] post: https://owner-api.teslamotors.com/api/1/vehicles/3744658249102283/command/set_temps {'driver_temp': 21.5, 'passenger_temp': 21.5}
2024-03-06 23:37:44.850 DEBUG (MainThread) [teslajsonpy.connection] 403: {"response":null,"error":"Tesla Vehicle Command Protocol required, please refer to the documentation here: https://developer.tesla.com/docs/fleet-api#2023-10-09-rest-api-vehicle-commands-endpoint-deprecation-warning","error_description":""}
2024-03-06 23:37:45.432 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update()
2024-03-06 23:37:45.433 DEBUG (MainThread) [teslajsonpy.controller] Get vehicles. Force: False Time: 56 Interval 60
2024-03-06 23:37:45.433 DEBUG (MainThread) [teslajsonpy.controller] 62785: online. Polling policy: normal. Update state: trying_to_sleep. Since last park: 1091. Since last wake up: 1122. Idle interval: 600. shift_state: None sentry: False climate: False, charging: Disconnected
2024-03-06 23:37:45.433 DEBUG (MainThread) [teslajsonpy.controller] 62785: online; Polling policy set to 'normal', trying to sleep; scan throttled to 720 seconds and will ignore updates for 330 seconds
2024-03-06 23:37:45.433 DEBUG (MainThread) [teslajsonpy.controller] 62785: Skipping update with state online. Polling: True. Last update: 390 ago. Last parked: 1091 ago. Last wake up 1122 ago.
2024-03-06 23:37:45.433 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.000 seconds (success: True)
2024-03-06 23:37:49.570 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update()
2024-03-06 23:37:49.570 DEBUG (MainThread) [teslajsonpy.controller] Get vehicles. Force: False Time: 61 Interval 60
2024-03-06 23:37:49.570 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 5:45:44
2024-03-06 23:37:49.570 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/products {}
2024-03-06 23:37:49.850 DEBUG (MainThread) [teslajsonpy.connection] 200:
2024-03-06 23:37:49.850 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.281 seconds (success: True)
2024-03-06 23:37:50.302 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 5:45:43
2024-03-06 23:37:50.302 DEBUG (MainThread) [teslajsonpy.connection] post: https://owner-api.teslamotors.com/api/1/vehicles/3744658249102283/command/set_temps {'driver_temp': 21.5, 'passenger_temp': 21.5}
2024-03-06 23:37:50.519 DEBUG (MainThread) [teslajsonpy.connection] 403: {"response":null,"error":"Tesla Vehicle Command Protocol required, please refer to the documentation here: https://developer.tesla.com/docs/fleet-api#2023-10-09-rest-api-vehicle-commands-endpoint-deprecation-warning","error_description":""}
2024-03-06 23:37:50.519 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140307190655424]
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 962, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 835, in async_service_temperature_set
await entity.async_set_temperature(**kwargs)
File "/config/custom_components/tesla_custom/climate.py", line 101, in async_set_temperature
await self._car.set_temperature(temp)
File "/usr/local/lib/python3.12/site-packages/teslajsonpy/car.py", line 1104, in set_temperature
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 1317, in api
response = await self.__post_with_retries(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/_asyncio.py", line 88, in async_wrapped
return await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/_asyncio.py", line 47, in call
do = self.iter(retry_state=retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/init.py", line 325, in iter
raise retry_exc.reraise()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/init.py", line 158, 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 50, in call
result = await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/teslajsonpy/controller.py", line 1340, 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 165, 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 217, in __open
raise TeslaException(resp.status_code)
teslajsonpy.exceptions.TeslaException
2024-03-06 23:37:55.432 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update()
2024-03-06 23:37:55.432 DEBUG (MainThread) [teslajsonpy.controller] Get vehicles. Force: False Time: 5 Interval 60
2024-03-06 23:37:55.432 DEBUG (MainThread) [teslajsonpy.controller] 62785: online. Polling policy: normal. Update state: trying_to_sleep. Since last park: 1101. Since last wake up: 1132. Idle interval: 600. shift_state: None sentry: False climate: False, charging: Disconnected
2024-03-06 23:37:55.432 DEBUG (MainThread) [teslajsonpy.controller] 62785: online; Polling policy set to 'normal', trying to sleep; scan throttled to 720 seconds and will ignore updates for 320 seconds
2024-03-06 23:37:55.432 DEBUG (MainThread) [teslajsonpy.controller] 62785: Skipping update with state online. Polling: True. Last update: 400 ago. Last parked: 1101 ago. Last wake up 1132 ago.
2024-03-06 23:37:55.432 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.000 seconds (success: True)
2024-03-06 23:37:59.568 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update()
2024-03-06 23:37:59.568 DEBUG (MainThread) [teslajsonpy.controller] Get vehicles. Force: False Time: 10 Interval 60
2024-03-06 23:37:59.568 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.000 seconds (success: True)
2024-03-06 23:38:05.432 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update()
2024-03-06 23:38:05.432 DEBUG (MainThread) [teslajsonpy.controller] Get vehicles. Force: False Time: 15 Interval 60
2024-03-06 23:38:05.432 DEBUG (MainThread) [teslajsonpy.controller] 62785: online. Polling policy: normal. Update state: trying_to_sleep. Since last park: 1111. Since last wake up: 1142. Idle interval: 600. shift_state: None sentry: False climate: False, charging: Disconnected
2024-03-06 23:38:05.432 DEBUG (MainThread) [teslajsonpy.controller] 62785: online; Polling policy set to 'normal', trying to sleep; scan throttled to 720 seconds and will ignore updates for 310 seconds
2024-03-06 23:38:05.432 DEBUG (MainThread) [teslajsonpy.controller] 62785: Skipping update with state online. Polling: True. Last update: 410 ago. Last parked: 1111 ago. Last wake up 1142 ago.
2024-03-06 23:38:05.433 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.000 seconds (success: True)
2024-03-06 23:38:09.568 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update()
2024-03-06 23:38:09.569 DEBUG (MainThread) [teslajsonpy.controller] Get vehicles. Force: False Time: 20 Interval 60
2024-03-06 23:38:09.569 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.000 seconds (success: True)
2024-03-06 23:38:15.432 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update()
2024-03-06 23:38:15.432 DEBUG (MainThread) [teslajsonpy.controller] Get vehicles. Force: False Time: 25 Interval 60
2024-03-06 23:38:15.433 DEBUG (MainThread) [teslajsonpy.controller] 62785: online. Polling policy: normal. Update state: trying_to_sleep. Since last park: 1121. Since last wake up: 1152. Idle interval: 600. shift_state: None sentry: False climate: False, charging: Disconnected
2024-03-06 23:38:15.433 DEBUG (MainThread) [teslajsonpy.controller] 62785: online; Polling policy set to 'normal', trying to sleep; scan throttled to 720 seconds and will ignore updates for 300 seconds
2024-03-06 23:38:15.433 DEBUG (MainThread) [teslajsonpy.controller] 62785: Skipping update with state online. Polling: True. Last update: 420 ago. Last parked: 1121 ago. Last wake up 1152 ago.
2024-03-06 23:38:15.433 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.000 seconds (success: True)
2024-03-06 23:38:19.569 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update()
2024-03-06 23:38:19.569 DEBUG (MainThread) [teslajsonpy.controller] Get vehicles. Force: False Time: 30 Interval 60
2024-03-06 23:38:19.569 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.000 seconds (success: True)
2024-03-06 23:38:25.432 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update()
2024-03-06 23:38:25.432 DEBUG (MainThread) [teslajsonpy.controller] Get vehicles. Force: False Time: 35 Interval 60
2024-03-06 23:38:25.432 DEBUG (MainThread) [teslajsonpy.controller] 62785: online. Polling policy: normal. Update state: trying_to_sleep. Since last park: 1131. Since last wake up: 1162. Idle interval: 600. shift_state: None sentry: False climate: False, charging: Disconnected
2024-03-06 23:38:25.432 DEBUG (MainThread) [teslajsonpy.controller] 62785: online; Polling policy set to 'normal', trying to sleep; scan throttled to 720 seconds and will ignore updates for 290 seconds
2024-03-06 23:38:25.432 DEBUG (MainThread) [teslajsonpy.controller] 62785: Skipping update with state online. Polling: True. Last update: 430 ago. Last parked: 1131 ago. Last wake up 1162 ago.
2024-03-06 23:38:25.432 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.000 seconds (success: True)

@tugakufi
Copy link

tugakufi commented Mar 7, 2024

Same here
see PR: #853 and #774

@skipishere skipishere added the duplicate This issue or pull request already exists label Mar 7, 2024
@skipishere
Copy link
Collaborator

Duplicate #774

@skipishere skipishere closed this as not planned Won't fix, can't repro, duplicate, stale Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants