Skip to content

Cant remote start the engine #32

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

Closed
lagge78 opened this issue Jan 10, 2025 · 6 comments
Closed

Cant remote start the engine #32

lagge78 opened this issue Jan 10, 2025 · 6 comments
Labels
problem Something isn't working volvo api issue The issue is caused by a problem with the Volvo API

Comments

@lagge78
Copy link

lagge78 commented Jan 10, 2025

What happened?

Hello!
I try to start the engine on a XC60 PHEV MY24 with the remote start button from the integration but I get an error all the time.
I get an popup in the button of Home Assistant that states:
"Couldn't perform the action button/press, unknown error"

I saw this in the debug log (complete below):
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url='https://api.volvocars.com/connected-vehicle/v2/vehicles/YV1UZH5V3R1793016/commands/engine-start'

I have the latest 1.0.2 release of the integration and Home Assistant is on 25.1.2.

Any ideas? All other entities works, like the climatization start has no problem.

Br
Fredrik

API availability

OK

Car connection

Available

Installed integration version

1.0.2

Additional information

No response

Diagnostics

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:245
integration: Home Assistant WebSocket API (documentation, items)
First instance: 11:57:21 (2 instances)
Latest log: 11:58:27

[140078507941392] Unexpected exception
[140076383414608] Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/volvo_cars/volvo/api.py", line 219, in _async_request
    response.raise_for_status()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/client_reqrep.py", line 1161, in raise_for_status
    raise ClientResponseError(
    ...<5 lines>...
    )
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url='https://api.volvocars.com/connected-vehicle/v2/vehicles/YV1UZH5V3R1793016/commands/engine-start'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/config/custom_components/volvo_cars/button.py", line 154, in async_press
    result = await self.coordinator.api.async_execute_command(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        self.entity_description.api_command, data
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/config/custom_components/volvo_cars/volvo/api.py", line 145, in async_execute_command
    body = await self._async_post(
           ^^^^^^^^^^^^^^^^^^^^^^^
        _API_CONNECTED_ENDPOINT, f"commands/{command}", body
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/config/custom_components/volvo_cars/volvo/api.py", line 177, in _async_post
    return await self._async_request(hdrs.METH_POST, endpoint, operation, body=body)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/volvo_cars/volvo/api.py", line 228, in _async_request
    raise VolvoAuthException from ex
custom_components.volvo_cars.volvo.models.VolvoAuthException

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<7 lines>...
    )
    ^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2795, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2838, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1006, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
        hass, entity, func, data, call.context
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1078, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/button/__init__.py", line 132, in _async_press_action
    await self.async_press()
  File "/config/custom_components/volvo_cars/button.py", line 173, in async_press
    raise HomeAssistantError from ex
homeassistant.exceptions.HomeAssistantError
@lagge78 lagge78 added the problem Something isn't working label Jan 10, 2025
@thomasddn
Copy link
Owner

It's a shortcoming of the public Volvo API. We need to use a certain scope, but we're not allowed to use that scope. I mailed to Volvo mid December, but no response so far.

@thomasddn thomasddn added the volvo api issue The issue is caused by a problem with the Volvo API label Jan 10, 2025
thomasddn added a commit that referenced this issue Jan 11, 2025
@thomasddn
Copy link
Owner

Engine buttons will be removed in the next release.

@thomasddn thomasddn closed this as not planned Won't fix, can't repro, duplicate, stale Jan 11, 2025
thomasddn added a commit that referenced this issue Jan 13, 2025
@thomasddn thomasddn pinned this issue Jan 14, 2025
@snp88
Copy link

snp88 commented Feb 16, 2025

Hi
Is this issue impact also climate star/stop button
I don't have this buttons on my XC60

@thomasddn
Copy link
Owner

@snp88 Your car probably doesn't support the climate endpoint.

@gacopl
Copy link

gacopl commented Feb 28, 2025

can you give more details, i could swore volvo2mqtt had ability to start, also developer api docs mention engine start stop

@thomasddn
Copy link
Owner

The API indeed mentions the start/stop engine, but it requires the use of a certain scope. However, the API user I’m using (the same as volvo2mqtt) is not allowed to use that scope. This means we’re unable to use that endpoint.

MichaelPihlblad added a commit to MichaelPihlblad/ha-volvo-cars that referenced this issue Mar 14, 2025
MichaelPihlblad added a commit to MichaelPihlblad/ha-volvo-cars that referenced this issue Mar 14, 2025
@thomasddn thomasddn unpinned this issue May 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem Something isn't working volvo api issue The issue is caused by a problem with the Volvo API
Projects
None yet
Development

No branches or pull requests

4 participants