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

Volvo integration #61785

Closed
MikaelHoogen opened this issue Dec 14, 2021 · 219 comments
Closed

Volvo integration #61785

MikaelHoogen opened this issue Dec 14, 2021 · 219 comments

Comments

@MikaelHoogen
Copy link

The problem

Hello

I'm trying to use the Volvo integration. It doesn't work for me. When i'm reading the api documentation there is a OAuth 2.0 authorization with tokens. The only thing you can use in the integration is user and password. I don't understand how that is supposed to work?

https://developer.volvocars.com/volvo-api/connected-vehicle/

What version of Home Assistant Core has the issue?

2021.12

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

Volvo On Call

Link to integration documentation on our website

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

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@probot-home-assistant
Copy link

Hey there @molobrakos, @decompil3d, 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!
(message by CodeOwnersMention)


volvooncall documentation
volvooncall source
(message by IssueLinks)

@decompil3d
Copy link
Contributor

I believe that's a different API than what this integration uses. See molobrakos/volvooncall#71 for details. The volvooncall package uses the same API that the Volvo mobile apps use. If your auth is not working you may need to add region: na to your yaml configuration if you're in North America.

@MikaelHoogen
Copy link
Author

I believe that's a different API than what this integration uses. See molobrakos/volvooncall#71 for details. The volvooncall package uses the same API that the Volvo mobile apps use. If your auth is not working you may need to add region: na to your yaml configuration if you're in North America.

Interesting. As far as I know Volvo has shut down the Volvo on call app. My car is new and i wonder if you can access new cars in the old API.

@decompil3d
Copy link
Contributor

Not sure what to tell you -- I have a 2018 XC60 and it works just fine. Try the region: na thing and see if that helps. If you have additional trouble, consider reaching out in https://github.com/molobrakos/volvooncall since that package is what handles the connection to Volvo's API. At least other users of the package might have some insight.

@MikaelHoogen
Copy link
Author

MikaelHoogen commented Dec 14, 2021

Not sure what to tell you -- I have a 2018 XC60 and it works just fine. Try the region: na thing and see if that helps. If you have additional trouble, consider reaching out in https://github.com/molobrakos/volvooncall since that package is what handles the connection to Volvo's API. At least other users of the package might have some insight.

I'm in Sweden. But the thing is that the authorization works. But there is no data.

Thx for your help. I will dig a bit deeper in this.

@jonare77
Copy link

Im in norway, using the user/password integration. Car is XC40, works as expected.

@tanordheim
Copy link

@jonare77 which version of XC40 do you have? This seems to be a problem that affects only newer versions (like the Recharge) as far as I've been able to tell.

@MikaelHoogen
Copy link
Author

@jonare77 which version of XC40 do you have? This seems to be a problem that affects only newer versions (like the Recharge) as far as I've been able to tell.

Yeah I have C40 recharge. So that's a theory.

@jonare77
Copy link

@jonare77 which version of XC40 do you have? This seems to be a problem that affects only newer versions (like the Recharge) as far as I've been able to tell.

Yeah I have C40 recharge. So that's a theory.

Im sorry but i have to debunk it. I have the XC40 hybrid rechargable. I have never had any problems with the integration.

@forzaKGB
Copy link

I understand "it works for me" is not that helpful, however for me it works (V60 CC -21).

I did see this note on the Volvo API page you linked:
This API is a Beta release, and as such can be tested against your own vehicle but not published for general release. This API works for all connected cars up to model year 2021, excluding the XC40 Recharge BEV.

Looks like there is a difference between BEV and PHEV.

@tanordheim
Copy link

@jonare77 which version of XC40 do you have? This seems to be a problem that affects only newer versions (like the Recharge) as far as I've been able to tell.

Yeah I have C40 recharge. So that's a theory.

Im sorry but i have to debunk it. I have the XC40 hybrid rechargable. I have never had any problems with the integration.

That's super odd, I have the same here that is not available via the API. It's available in-app and on the Volvo ID webpage, just not via the API used by the volvooncall-library that HomeAssistant uses - regardless of region (which was mentioned earlier in the discussion). What year model is it?

@jonare77
Copy link

@jonare77 which version of XC40 do you have? This seems to be a problem that affects only newer versions (like the Recharge) as far as I've been able to tell.

Yeah I have C40 recharge. So that's a theory.

Im sorry but i have to debunk it. I have the XC40 hybrid rechargable. I have never had any problems with the integration.

That's super odd, I have the same here that is not available via the API. It's available in-app and on the Volvo ID webpage, just not via the API used by the volvooncall-library that HomeAssistant uses - regardless of region (which was mentioned earlier in the discussion). What year model is it?

18 months since I got the car. They may be linking newer cars up againt a new api.

@MikaelHoogen
Copy link
Author

@jonare77 which version of XC40 do you have? This seems to be a problem that affects only newer versions (like the Recharge) as far as I've been able to tell.

Yeah I have C40 recharge. So that's a theory.

Im sorry but i have to debunk it. I have the XC40 hybrid rechargable. I have never had any problems with the integration.

That's super odd, I have the same here that is not available via the API. It's available in-app and on the Volvo ID webpage, just not via the API used by the volvooncall-library that HomeAssistant uses - regardless of region (which was mentioned earlier in the discussion). What year model is it?

18 months since I got the car. They may be linking newer cars up againt a new api.

Yeah I have that feeling to. I picked up my C40 Recharge 2022 this monday

@JRFabbi
Copy link

JRFabbi commented Dec 24, 2021

I was having some issues with this integration but now everything is working fine, just replaced my Volvo ID to my e-mail (was my phone number)

Mine is XC40 Recharge (PHEV) MY2022

@tgambee
Copy link

tgambee commented Jan 1, 2022

Mine is XC40 Recharge (PHEV) MY2022

Can you confirm it is working with the XC40 Recharge (all electric) with no issue? Did you have to tweak any settings besides your id?

@rrlevy
Copy link

rrlevy commented Jan 3, 2022

I have a XC40 Recharge (all electric) in Brazil, I can use the Volvo Cars app and I can see the car in the EU volvo account website (https://volvoid.eu.volvocars.com/Account/landing-page)

image

However, this integration does not work for me. I get an error 500 when trying to use it on Home Assistant:

2022-01-01 02:48:10 WARNING (MainThread) [volvooncall.volvooncall] Failure when communcating with the server: 500, message='Internal Server Error', url=URL('https://vocapi.wirelesscar.net/customerapi/rest/v3.0/customeraccounts')
2022-01-01 02:48:10 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/volvooncall/__init__.py", line 172, in update
    if not await connection.update(journal=True):
  File "/usr/local/lib/python3.9/site-packages/volvooncall/volvooncall.py", line 105, in update
    user = await self.get("customeraccounts")
  File "/usr/local/lib/python3.9/site-packages/volvooncall/volvooncall.py", line 91, in get
    return await self._request(METH_GET, self._make_url(url, rel))
  File "/usr/local/lib/python3.9/site-packages/volvooncall/volvooncall.py", line 76, in _request
    response.raise_for_status()
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 500, message='Internal Server Error', url=URL('https://vocapi.wirelesscar.net/customerapi/rest/v3.0/customeraccounts')

Doing further investigations, when I do an HTTP GET request with my username and password to the address used by the integration (https://vocapi.wirelesscar.net/customerapi/rest/v3.0/customeraccounts), I can get my account info but no cars are shown in the response. I get an empty array on accountVehicleRelation:

{
    "username": "<<REDACTED>>",
    "firstName": "Rafael",
    "lastName": "<<REDACTED>>",
    "accountId": "<<REDACTED>>",
    "account": "https://vocapi.wirelesscar.net/customerapi/rest/v3.0/customeraccounts/<<REDACTED>>",
    "accountVehicleRelations": []
}

I'm not sure if this is related to the XC40 Recharge all electric, or if it really doesn't work in Brazil.

@decompil3d
Copy link
Contributor

@rrlevy did you set the region config? I know for North America we have to set to na so maybe you need to set to sa or latam or something for South America?

@rrlevy
Copy link

rrlevy commented Jan 3, 2022

@rrlevy did you set the region config? I know for North America we have to set to na so maybe you need to set to sa or latam or something for South America?

@decompil3d I don't think there is a different region for South America. I've tried multiple variations (sa, br, latam, la, etc) but they don't exist. The requests to the API work only at vocapi.wirelesscar.net and vocapi-na.wirelesscar.net, but both shows no cars in the list. However, since I use the web address volvoid.eu.volvocars.com for my authentication from the Brazilian Volvo website, I believe they should use the european API.

@JRFabbi
Copy link

JRFabbi commented Jan 3, 2022

Hello @rrlevy, I think the problem is the pure electric because I'm from Brazil and have an R-D MY2022 working using the standard region.

@rrlevy
Copy link

rrlevy commented Jan 3, 2022

Hello @rrlevy, I think the problem is the pure electric because I'm from Brazil and have an R-D MY2022 working using the standard region.

That's sad... I believe it's because the pure electric uses Android Automotive and is therefore has a completely different OS.

I wrote to Volvo anyway to learn more about it. I noticed that the car also won't work with the new API ( https://developer.volvocars.com/volvo-api/connected-vehicle )

@decompil3d
Copy link
Contributor

@rrlevy does your car appear on Volvo's mobile app? Perhaps that can be investigated to see if there is some new API to use.

@rrlevy
Copy link

rrlevy commented Jan 3, 2022

@rrlevy does your car appear on Volvo's mobile app? Perhaps that can be investigated to see if there is some new API to use.

Yes, it does. It allows me to open/close the car, turn on or schedule the air conditioning, and to check charging status:

image

@github-actions
Copy link

github-actions bot commented Apr 3, 2022

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Apr 3, 2022
@Avd888
Copy link

Avd888 commented Apr 6, 2022

Unfortunately the bug is still there in version 2022.3:

Logger: homeassistant
Source: components/volvooncall/__init__.py:174
First occurred: 14:42:50 (2 occurrences)
Last logged: 14:50:55

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/volvooncall/__init__.py", line 174, in update
    if not await connection.update(journal=True):
  File "/usr/local/lib/python3.9/site-packages/volvooncall/volvooncall.py", line 117, in update
    await vehicle.update(journal=journal)
  File "/usr/local/lib/python3.9/site-packages/volvooncall/volvooncall.py", line 158, in update
    await self._connection.update_vehicle(self, journal)
  File "/usr/local/lib/python3.9/site-packages/volvooncall/volvooncall.py", line 125, in update_vehicle
    self._state[url].update(await self.get("status", rel=url))
  File "/usr/local/lib/python3.9/site-packages/volvooncall/volvooncall.py", line 91, in get
    return await self._request(METH_GET, self._make_url(url, rel))
  File "/usr/local/lib/python3.9/site-packages/volvooncall/volvooncall.py", line 76, in _request
    response.raise_for_status()
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 500, message='Internal Server Error', url=URL('https://vocapi.wirelesscar.net/customerapi/rest/v3.0/vehicles/YV***********7/status'

&

Logger: volvooncall.volvooncall
Source: /usr/local/lib/python3.9/site-packages/volvooncall/volvooncall.py:305
First occurred: 15:52:03 (2 occurrences)
Last logged: 15:52:04

Failure to execute: 500, message='Internal Server Error', url=URL('https://vocapi.wirelesscar.net/customerapi/rest/v3.0/vehicles/Y********************7/unlock')

Apparently the unlock endpoint in changed in the api:

https://api.volvocars.com/connected-vehicle/v1/vehicles/{vin}/commands/unlock

https://developer.volvocars.com/apis/connected-vehicle/endpoints/doors-windows-locks/#lock-doors

@github-actions github-actions bot removed the stale label Apr 6, 2022
@decompil3d
Copy link
Contributor

Apparently the unlock endpoint in changed in the api:

The underlying volvooncall library does not use the new API. Newer vehicles seem to have issues with the older API though. Someone who has a newer Volvo should investigate building a new base library and integrating here. I have a 2018 and am getting a new Lincoln soon, so I will not be able to continue maintaining this integration nor underlying library soon.

@chinmayjade
Copy link

chinmayjade commented Apr 9, 2022

Hello @rrlevy, I think the problem is the pure electric because I'm from Brazil and have an R-D MY2022 working using the standard region.

I have the same issue with my 19 S60. I stumbled across this integration last weekend and it works partially for me.
The integration is able to pull odometer data, lock/unlock status and door closed/open status etc. However it fails with the same Failure to execute: 500, message='Internal Server Error' when I try to lock/unlock from HA.

I am in the US and using region na in the config.

Screen Shot 2022-04-08 at 10 23 21 PM

@timknowlden
Copy link

I have a my22 xc60 which works in the Volvo cars app. I’m from the UK and the car uses the new android automotive platform. I have set up the Volvo on call integration with username and password but nothing shows in the integrations page on home assistant and nothing in the log except that Volvooncall is taking longer than 10seconds to start.

@JoaquimPinto
Copy link

i followed this link - https://www.homeautomationguy.io/blog/docker-tips/configuring-the-mosquitto-mqtt-docker-container-for-use-with-home-assistant - to make my container, i tried with and without password, but last step always with connection failed

@JoaquimPinto
Copy link

Screenshot 2024-01-28 at 10 10 48
this is all what i have a the moment

@Renko72
Copy link

Renko72 commented Jan 28, 2024

I cannot see the MQTT integration on your screenshot

One question did you try to connect to your MQTT Docker Container over the MQTT Explorer to check if the connection works
https://mqtt-explorer.com/

@JoaquimPinto
Copy link

Thanks,
Once the connection of the MQTT intregation between the MQTT broker Mosquitto is always failing, the integration doesnt "stay" on the installed.
I will try to tomorow this MQTT Explorer, to try to understatnd the issue, and maybe start over to understand the issues. I will bring updates.

@JoaquimPinto
Copy link

Hello all,
Just an update.
After several lost trying to reconfigure the Mosquitto Broker, i just create a new one from scratch, and it work out. than i went back to the old one, and it seems the problem was the user/pass wrong confirgure.
Now its working, just need to clean the all mess/tries i created, without destroing the working on. eheh
Thanks for the support. The MQTT Explorer tip was very important to understand the issue. Thanks

@acoutts
Copy link

acoutts commented Feb 3, 2024

Looks like USA is not supported: https://developer.volvocars.com/terms-and-conditions/apis-supported-locations/

I had an old api key I generated last year. I tried the addon today and was getting 404 on every request. I deleted and generated a new api key and now i simply get "Error getting vehicles: 401. Access denied due to invalid VCC-API-KEY. Make sure to provide a valid key for an active application."

I guess volvo has turned off the api for US.. bummer

@mim212
Copy link

mim212 commented Feb 3, 2024

Looks like USA is not supported: https://developer.volvocars.com/terms-and-conditions/apis-supported-locations/

I had an old api key I generated last year. I tried the addon today and was getting 404 on every request. I deleted and generated a new api key and now i simply get "Error getting vehicles: 401. Access denied due to invalid VCC-API-KEY. Make sure to provide a valid key for an active application."

I guess volvo has turned off the api for US.. bummer

Same deal in Australia unfortunately, was working well even 6 months ago but now getting 404 errors. Very disappointed to see this closed off and no comms other than 'its coming'.

@IceBotYT
Copy link
Contributor

IceBotYT commented Feb 3, 2024

no comms other than 'its coming'.

I've sent several emails to their dev support email, radio silence...

@d1nd141
Copy link

d1nd141 commented Feb 12, 2024

While my old XC60 worked fine with the Volvo integration, my new C40 is still shown in the On-call App, but no entities are reported to HA, and no errors in log.
Region: Luxembourg

@JoaquimPinto
Copy link

It took some time, but now the first version should be usable. Take a look at here: https://github.com/Dielee/volvo2mqtt. Feel free to open feature requests and issues if something does not work!

While my old XC60 worked fine with the Volvo integration, my new C40 is still shown in the On-call App, but no entities are reported to HA, and no errors in log. Region: Luxembourg

Hi,

it's a know issue, there are several projects to bypass that issue, try this one from @Dielee:
Its work out for me.

It took some time, but now the first version should be usable. Take a look at here: https://github.com/Dielee/volvo2mqtt. Feel free to open feature requests and issues if something does not work!

@canoben
Copy link

canoben commented Apr 10, 2024

While my old XC60 worked fine with the Volvo integration, my new C40 is still shown in the On-call App, but no entities are reported to HA, and no errors in log. Region: Luxembourg

I'm in the same situation.

@Renko72
Copy link

Renko72 commented Apr 10, 2024

While my old XC60 worked fine with the Volvo integration, my new C40 is still shown in the On-call App, but no entities are reported to HA, and no errors in log. Region: Luxembourg

I'm in the same situation.

Hello was the old XC60 with Sensus ? Because regrading your post you are using this HA Integration
I think your new C40 is with Google AAOS and when the old one was with Sensus then you have to change to this integration
https://github.com/Dielee/volvo2mqtt.

The Volvo on Call app is the same but behind with aaos its a different API and they switch in the background to this communication so you think its the same but its not the same .

@canoben
Copy link

canoben commented Apr 10, 2024

It's a car with AAOS. I've tried now with Volvo2MQTT and got that one working. Thanks!

@maczekg
Copy link

maczekg commented May 30, 2024

@JoaquimPinto could you please be so kind and explain how you managed to install volvo2mqtt on Synology? I don't have too much experience with docker on Synoloy, however use 12 different containers :) This time I have no ide - shall I add github repo somehow? Please excuse if the answer is obvious - rookie level here :)

@JoaquimPinto
Copy link

@JoaquimPinto could you please be so kind and explain how you managed to install volvo2mqtt on Synology? I don't have too much experience with docker on Synoloy, however use 12 different containers :) This time I have no ide - shall I add github repo somehow? Please excuse if the answer is obvious - rookie level here :)

Hi,
Frist you need to creat an account at the web site Volvo Cars Developer Portal
https://developer.volvocars.com/

need to creat API aplication ( i don't remember all the steps), to generate the KEYS for the docker configuration

You have to activate the SSH service:
https://kb.synology.com/en-uk/DSM/tutorial/How_to_login_to_DSM_with_root_permission_via_SSH_Telnet

Then you must connect to your Synology throw SSH service( same linkk should work):
https://kb.synology.com/en-uk/DSM/tutorial/How_to_login_to_DSM_with_root_permission_via_SSH_Telnet

Run the command to install the docker Full Credits to @Dielee - describe at middle the page - SETUP:
https://github.com/Dielee/volvo2mqtt
You have to change some configuration details on this comand with your private/car details, you can change some details later if need, but is better to insert all here.

Than as Synology you go to the Container Manager to confirm the result.

The rest depends your configuration:
HA installed on a container - you need to create/installer a mqtt broker contaneir, i used mosquitto, once again you have to be caurefull with the configuration details, this was the most dificult part for me, to make the containers - HA / Mosquitto / Volvo2mqtt - to speak together, if i remember, was due wrong installation/configuration of Mosquitto.

I did all based on @Dielee info, and a lot of google for Mosquitto Broker configuration.

@wixoff
Copy link

wixoff commented May 31, 2024

There's a lengthy and detailed thread about this (non-core!) volvo2mqtt add-on and its configuration over in the Home Assistant Community message board. I'd encourage people to post their questions there rather than in this bug thread which was originally about the built-in Volvo On-Call integration.

https://community.home-assistant.io/t/volvo2mqtt-connect-your-aaos-volvo/585699

@maczekg
Copy link

maczekg commented May 31, 2024 via email

@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@MrAdam
Copy link

MrAdam commented Aug 29, 2024

I've tried emailing developer.portal@volvocars.com multiple times asking if they will allow access to the new API without having to publish an app, but haven't been able to get a reply from them.

At the moment you can only access the new Volvo API with either a test token created at https://developer.volvocars.com/apis/docs/test-access-tokens/ which is not really feasible, as it's temporary, or by using client credentials which can only be acquired after publishing an application, and they note: Please also be aware that it can take some time (14-21 days) to review each publication since the process currently is manual.

If you want progress on this, try sending them an email like I did - maybe they will update the authorisation process to allow access to unpublished applications at some point, which would make this a lot easier.

@HWiese1980
Copy link

Yeah, I've tried to register an App with them before and it not only can take 14 - 21 days, it might also happen that they never respond. It's a real pity how Volvo (and other old-established companies) treat their APIs.

@MrAdam
Copy link

MrAdam commented Aug 29, 2024

Yeah, I've tried to register an App with them before and it not only can take 14 - 21 days, it might also happen that they never respond. It's a real pity how Volvo (and other old-established companies) treat their APIs.

Have you tried emailing them?
Maybe if more people do it and shows interest, they will eventually look into better auth mechanisms 😄

@HWiese1980
Copy link

Not yet. Can surely do so.

@Da-Art-76
Copy link

Hello,
My 2025 XC40 (mild hybrid) is not visible in the Volvo on Call integration. After entering email address and password, no enities are detected.
What can I do about this?

image

Thanks in advance.

@IceBotYT
Copy link
Contributor

You should be able to use this add-on https://github.com/Dielee/volvo2mqtt

@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@issue-triage-workflows issue-triage-workflows bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests