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

Unable to Control Variable Charging Amps #1042

Open
2 tasks done
pwhitea opened this issue Sep 13, 2024 · 1 comment
Open
2 tasks done

Unable to Control Variable Charging Amps #1042

pwhitea opened this issue Sep 13, 2024 · 1 comment
Labels
car For items that relate to Tesla vehicles triage New issues raised that need initial attention

Comments

@pwhitea
Copy link

pwhitea commented Sep 13, 2024

Is there an existing issue for this?

  • I have searched both the existing open issues & recently closed issues and did not find a duplicate of this issue.

I have read about the Fleet API and understand I may need to use it

  • I understand issues relating to read only commands will be auto closed if not using the Fleet API.

Version of the Tesla component

V3.24.1

Version of the Tesla car software

2024.32.3

Model

Model 3

Current Behavior

I am trying to control charging amps on my M3. My Tesla wall connector shares a 32A circuit with other devices (washing machine) currently. I want to be able to vary the charging to take advantage of the 32A when other devices not in use. I have been trying to use the following for this and it does not work - see debug log.

data:
email: xxxxxxxx.com
command: CHARGING_AMPS
parameters:
path_vars:
vehicle_id: "XXXXX"
wake_if_asleep: true
charging_amps: '10'
action: tesla_custom.api

I am finding that a wake up call does work OK, so there is nothing fundamentally wrong with setup, the following call wakes up the vehicle just fine.

data:
email: xxxxxxxx.com
command: WAKE_UP
parameters:
path_vars:
vehicle_id: "XXXXXXX"
wake_if_asleep: true
action: tesla_custom.api

Expected Behavior

Expecting that the following will change the charging amps on vehicle when executed

data:
email: xxxxxxxx.com
command: CHARGING_AMPS
parameters:
path_vars:
vehicle_id: "XXXXX"
wake_if_asleep: true
charging_amps: '10'
action: tesla_custom.api

Testing this in the Developer Tools results in following error, plus logs -

Failed to perform the action tesla_custom.api. Unknown error

Debug logs

Logger: homeassistant.helpers.script.websocket_api_script
Source: helpers/script.py:525
First occurred: 10:15:55 (17 occurrences)
Last logged: 12:08:12

websocket_api script: Error executing script. Unexpected error for call_service at pos 1:
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 525, in _async_step
    await getattr(self, handler)()
  File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 763, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 726, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/homeassistant/core.py", line 2761, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/homeassistant/core.py", line 2804, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tesla_custom/services.py", line 56, in async_call_tesla_service
    response = await api(service_call)
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tesla_custom/services.py", line 116, in api
    response = await controller.api(name=command, path_vars=path_vars, **parameters)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/teslajsonpy/controller.py", line 1375, in api
    return await self.__post_with_retries_except_unavailable(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  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 314, in iter
    return fut.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 1407, in __post_with_retries_except_unavailable
    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

Anything else?

No response

@pwhitea pwhitea added car For items that relate to Tesla vehicles triage New issues raised that need initial attention labels Sep 13, 2024
@wesback
Copy link

wesback commented Sep 19, 2024

I am seeing the same behavior, however I am also no longer able to change the amps using my mobile app so I am wondering if the problem goes deeper that just the integration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
car For items that relate to Tesla vehicles triage New issues raised that need initial attention
Projects
None yet
Development

No branches or pull requests

2 participants