home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.87k stars 30.95k forks source link

Volvo On Call does not map 'sunroof' #117850

Open KeningGruttePier opened 6 months ago

KeningGruttePier commented 6 months ago

The problem

Volvo API reports in its specification also state and last update date of entity sunroof is available next to each individual car window. This is not reported by the integration of my MY19 V60 volvo. I think the value is not mapped in the integration, could this be fixed?

Volvo specs mention: 'sunroof' as attribute in the response of the API. https://developer.volvocars.com/apis/connected-vehicle/v2/specification/

What version of Home Assistant Core has the issue?

core-2024.5.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

volvooncall

Link to integration documentation on our website

https://www.home-assistant.io/integrations/volvooncall

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

{
  "frontLeftWindow": {
    "value": "string",
    "unit": "string",
    "timestamp": "string"
  },
  "frontRightWindow": {
    "value": "string",
    "unit": "string",
    "timestamp": "string"
  },
  "rearLeftWindow": {
    "value": "string",
    "unit": "string",
    "timestamp": "string"
  },
  "rearRightWindow": {
    "value": "string",
    "unit": "string",
    "timestamp": "string"
  },
  "sunroof": {
    "value": "string",
    "unit": "string",
    "timestamp": "string"
  }
}

Additional information

No response

home-assistant[bot] commented 6 months ago

Hey there @molobrakos, mind taking a look at this issue as it has been labeled with an integration (volvooncall) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `volvooncall` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign volvooncall` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


volvooncall documentation volvooncall source (message by IssueLinks)

jongdesteven commented 4 months ago

Can we get this fixed, It seems an easy fix?

Getslow6 commented 2 months ago

I’d be interested in this being implemented as well!

crocobau commented 2 months ago

I cannot detect on Github code where sensors are defined. Most probably all are retrived automatically at setup time of the Oncall account.

Does it means that the “sunroof” is not advertised as response by the cloud?

Where did you get that log from?

Getslow6 commented 2 months ago

I cannot detect on Github code where sensors are defined. Most probably all are retrived automatically at setup time of the Oncall account.

Does it means that the “sunroof” is not advertised as response by the cloud?

Where did you get that log from?

I’ve scanned the code as well (but not a Python expert myself) and couldn’t find anything either.

You can find the ‘log’ in the API specification link that is in the opening post under the endpoint ‘/vehicles/{vin}/windows’.

crocobau commented 2 months ago

I can retrive same result from Volvo Developer account. On their sandbox I am using below code which I will translate-it on Home Assistant config.yaml as a rest_command

curl -X 'GET' \ 'https://api.volvocars.com/connected-vehicle/v2/vehicles/VINNUMBERHERE/windows' \ -H 'accept: application/json' \ -H 'vcc-api-key: afb9e77cbb9b40e2df2a4b92011119d3' \ -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIpImtpZCI6ImFpUGxPY0VLaWlzU1p1bHR0blpxNEZXWTAzV

crocobau commented 2 months ago

The problem is on Volvo side. Their “Reaource-List” is adevertising all accesories invluding “sunRoofOpen” buy when tried “Resource-Values” for this element I receive below:

{ "exveErrorId": "404", "exveErrorMsg": "resource not available for VIN or accessing party" }

The test id one using below URL:

https://api.volvocars.com/extended-vehicle/v1/vehicles/VINNUMBERHERE/resources/sunRoofOpen

Tuxie commented 2 months ago

Do you have the 3.2.5 update installed? It lists "support for the panoramic sunroof" as its only feature over 3.2.4 and it's not an OTA update.

crocobau commented 2 months ago

Do you have the 3.2.5 update installed? It lists "support for the panoramic sunroof" as its only feature over 3.2.4 and it's not an OTA update.

What do you mean? Which software?

Tuxie commented 2 months ago

What do you mean? Which software?

The Volvo system software. https://www.volvocars.com/uk/support/car/xc60/software-release-notes

The pre-Google cars also got an update in August 2024 that added panoramic roof support. https://www.volvocars.com/uk/support/car/v60/18w46/software-release-notes

crocobau commented 2 months ago

I see but the update for roof is for models newer than 2022. Mine is 2020.

Anyhow I am not sure what version I have on the car. I hope is visible on the display.

Thanks a lot for the information!

Tuxie commented 2 months ago

I edited that comment to add a second link so you may have missed it. Older Volvo models also got a system update in August 2024 that added panoramic roof support. Example link for a 2019 V60: https://www.volvocars.com/uk/support/car/v60/18w46/software-release-notes

crocobau commented 1 month ago

I understand your point but regardless software version of car app, the Volvo sandbox (and rest_command from HA) advertises the sunroof. The only problem/question is why HA Integration is not mapping it.

I will check this evening if this entity is showing not only “Closed” but also “Opened” when is really opened. If yes then we have an workaround.

crocobau commented 1 month ago

I confirm. The Volvo Cars app and HA rest_command detect correct statuses of Sunroof. In HA I still have to see why authentication expires after a while. ( I do not understand 100% this 2 steps: authentication and authorization)

Frank071 commented 1 month ago

The HA implementation of Volvo On Call uses the library volvooncall made by @molobrakos (https://github.com/molobrakos/volvooncall). That library does not use the (newer) VCC api, but calls a url in the wirelesscar.net domain. I can't find any reference to sunroof status in the output of raw calls to that service.

crocobau commented 1 month ago

The HA implementation of Volvo On Call uses the library volvooncall made by @molobrakos (https://github.com/molobrakos/volvooncall). That library does not use the (newer) VCC api, but calls a url in the wirelesscar.net domain. I can't find any reference to sunroof status in the output of raw calls to that service.

You are right. I opened an Issue to Github. Is a security matter.