core
core copied to clipboard
Add new Volvo integration
Proposed change
This new integration allows you to integrate your Volvo vehicle in Home Assistant.
There was already a Volvo integration, but the API used was deprecated and the integration is no longer maintained. I've chosen to make a completely new integration instead of rebuilding the existing one mainly because the deprecated integration uses the volvooncall domain. "On Call" is a reference to the marketing name of the deprecated Volvo API. This new integration uses volvo which is agnostic of any API marketing name.
Ideally, the old volvooncall integration is removed.
Type of change
- [ ] Dependency upgrade
- [ ] Bugfix (non-breaking change which fixes an issue)
- [x] New integration (thank you!)
- [ ] New feature (which adds functionality to an existing integration)
- [ ] Deprecation (breaking change to happen in the future)
- [ ] Breaking change (fix/feature causing existing functionality to break)
- [ ] Code quality improvements to existing code or addition of tests
Additional information
- This PR fixes or closes issue: fixes #
- This PR is related to issue: #139419
- Link to documentation pull request: home-assistant/home-assistant.io#38549
- Link to developer documentation pull request:
- Link to frontend pull request:
Checklist
- [x] The code change is tested and works locally.
- [x] Local tests pass. Your PR cannot be merged unless tests pass
- [x] There is no commented out code in this PR.
- [x] I have followed the development checklist
- [x] I have followed the perfect PR recommendations
- [x] The code has been formatted using Ruff (
ruff format homeassistant tests) - [x] Tests have been added to verify that the new code works.
If user exposed functionality or configuration variables are added/changed:
- [x] Documentation added/updated for www.home-assistant.io
If the code communicates with devices, web services, or third-party tools:
- [x] The manifest file has all fields filled out correctly.
Updated and included derived files by running:python3 -m script.hassfest. - [x] New or updated dependencies have been added to
requirements_all.txt.
Updated by runningpython3 -m script.gen_requirements_all. - [ ] For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
To help with the load of incoming pull requests:
- [ ] I have reviewed two other open pull requests in this repository.
Test is failing on an unrelated component: tests/components/esphome/test_dashboard.py
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks :+1:
I've marked it ready for review again, while knowing there are still two open questions/remarks:
- How to handle fuel consumption unit? Keep it in an option flow, or create a new device class in core? See my comment on how other core integrations are doing it.
- Should I use sub entries (for cases when the user has multiple vehicles under the same Volvo account)?
Pulled latest from dev and CI is failing on something unrelated (tests/components/esphome/test_manager.py).
Fantastic work @thomasddn! Just a question regarding car models supported. You mention in your documentation: - All car models starting from model year 2015 (although some might have fewer features available).
But in the API documentation it says: Car models This API is generally, with some exceptions, available for:
All cars with Volvo On Call add-on from model year 2010-2024 All cars with Google Built In from model year 2020 (some endpoints have limited availability) https://developer.volvocars.com/apis/connected-vehicle/v2/overview/#availability
Or am I looking in the wrong place?
@bohmandan Good catch! Apparently, they have done some changes to their API and documentation recently, and they now support more vehicles. See a previous version of that page on the wayback machine.
I will adapt the docs. Thanks for bringing this to my attention!
Just to be sure: the test is failing on some unrelated part
I'm but a mere user hoping this get merged in soon. Just wanted to say thanks for the effort on this.
Hi @thomasddn can you contact me on discord: gjohansson Just easier to discuss a few things.
Volvo released a new version of their energy endpoint, along with new scopes to use. While they mention the old version will still be accessible for 6 months, it appears we cannot sign in anymore with the previous scopes.
I have updated the integration to use the new endpoint version, here's a summary of what's changed:
- sensor: Added new and changed existing sensors (with their translations and icons)
- sensor: The new endpoint returns data that other endpoints also return, sometimes with a different name, sometimes under the same name. Therefore creating entities from the descriptions have become a little more complex. Only one entity should be created for the same value, and the preference goes to the coordinator that has the fastest interval.
- sensor: There is one sensor,
charging_power_status, which has no dedicated list of possible values documented, althoug the values I discovered so for look enum-ish:NO_POWER_AVAILABLEandPROVIDING_POWER. I just convert it to words. - init: Add coordinators from fastest to slowest
- coordinator: Simplified determining which API calls are eligible for this vehicle
Exited to try this. Kudos to @thomasddn @joostlek and all other reviewers/contributors.
One day away from computer and then this happens! 🚗💨
Is there already a chance that the new integration will be included in version 2025.08?
Is there already a chance that the new integration will be included in version 2025.08?
since it was merged before the beta cut (which happens tomorrow), it will be
@DeeJaWue Just know that this is a first version and is not as feature rich as my HACS integration yet.
@DeeJaWue Just know that this is a first version and is not as feature rich as my HACS integration yet.
Thanks again for pointing that out. It’s a good start, though. :)