fars-fede-fire / volvoaaos Goto Github PK
View Code? Open in Web Editor NEWHome Assistant custom component for Volvo AAOS vehicles
License: MIT License
Home Assistant custom component for Volvo AAOS vehicles
License: MIT License
Hi, I would like to test this integration with my Volvo XC60 Hybrid. I am in Region Europe.
I have very good programming skills, but a bit newbee in the Home Assistant environment and programming languages used. I would be also happy to contribute with a good guideline documentation on how to install. Could you give me some initial guidance on the first baby steps?
Test this integration with my XC60 Hybrid
Search a different integration, like the Volvo2MQTT. But I see here an opportunity to learn and help this integration growing.
Nothing else to add.
version | core-2023.10.3 |
---|---|
installation_type | Home Assistant Container |
dev | false |
hassio | false |
docker | true |
user | root |
virtualenv | false |
python_version | 3.11.5 |
os_name | Linux |
os_version | 4.4.302+ |
arch | x86_64 |
timezone | Europe/Tallinn |
config_dir | /config |
GitHub API | ok |
---|---|
GitHub Content | ok |
GitHub Web | ok |
GitHub API Calls Remaining | 4976 |
Installed Version | 1.33.0 |
Stage | running |
Available Repositories | 1396 |
Downloaded Repositories | 21 |
HACS Data | ok |
logged_in | true |
---|---|
subscription_expiration | November 13, 2023 at 02:00 |
relayer_connected | true |
relayer_region | eu-central-1 |
remote_enabled | true |
remote_connected | true |
alexa_enabled | false |
google_enabled | true |
remote_server | eu-central-1-14.ui.nabu.casa |
certificate_status | ready |
can_reach_cert_server | ok |
can_reach_cloud_auth | ok |
can_reach_cloud | ok |
dashboards | 1 |
---|---|
resources | 7 |
views | 13 |
mode | storage |
oldest_recorder_run | October 29, 2023 at 20:15 |
---|---|
current_recorder_run | November 1, 2023 at 10:28 |
estimated_db_size | 929.42 MiB |
database_engine | sqlite |
database_version | 3.41.2 |
In Volvo Cars app everything works for my XC40 Recharge Pure Electric MY2024 but I'm unable to complete the setup of this HACS integration. I've properly entered username, password and VCC API key in HA and even see the count of API calls increasing for the application I created on https://developer.volvocars.com/account/ but in HA the integration status is "Failed to set up" and I see an error messages in logs every time I reload the integration.
This error originated from a custom integration.
Logger: homeassistant
Source: custom_components/volvoaaos/volvo.py:130
Integration: Volvo AAOS (documentation, issues)
First occurred: 10:29:25 (13 occurrences)
Last logged: 10:41:26
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/volvoaaos/coordinator.py", line 71, in update_coordinator_data
energy = await update_energy(self.energy, access_token, vcc_api_key, vin)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/volvoaaos/coordinator.py", line 89, in update_energy
energy_data = await energy_call.get_recharge_status()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/volvoaaos/volvo.py", line 130, in get_recharge_status
return RechargeModel.parse_obj(response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "pydantic/main.py", line 526, in pydantic.main.BaseModel.parse_obj
File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 5 validation errors for RechargeModel
data -> batteryChargeLevel
field required (type=value_error.missing)
data -> electricRange
field required (type=value_error.missing)
data -> estimatedChargingTime
field required (type=value_error.missing)
data -> chargingConnectionStatus
field required (type=value_error.missing)
data -> chargingSystemStatus
field required (type=value_error.missing)
Logger: homeassistant.config_entries
Source: config_entries.py:399
First occurred: 10:28:29 (2 occurrences)
Last logged: 10:41:40
Error setting up entry Volvo - XC40 for volvoaaos
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 399, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/volvoaaos/__init__.py", line 51, in async_setup_entry
energy_data = await energy.get_recharge_status()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/volvoaaos/volvo.py", line 130, in get_recharge_status
return RechargeModel.parse_obj(response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "pydantic/main.py", line 526, in pydantic.main.BaseModel.parse_obj
File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 5 validation errors for RechargeModel
data -> batteryChargeLevel
field required (type=value_error.missing)
data -> electricRange
field required (type=value_error.missing)
data -> estimatedChargingTime
field required (type=value_error.missing)
data -> chargingConnectionStatus
field required (type=value_error.missing)
data -> chargingSystemStatus
field required (type=value_error.missing)
No response
version | core-2024.4.2 |
---|---|
installation_type | Home Assistant OS |
dev | false |
hassio | true |
docker | true |
user | root |
virtualenv | false |
python_version | 3.12.2 |
os_name | Linux |
os_version | 6.6.20-haos |
arch | x86_64 |
timezone | Europe/Luxembourg |
config_dir | /config |
GitHub API | ok |
---|---|
GitHub Content | ok |
GitHub Web | ok |
GitHub API Calls Remaining | 5000 |
Installed Version | 1.34.0 |
Stage | running |
Available Repositories | 1399 |
Downloaded Repositories | 34 |
HACS Data | ok |
logged_in | true |
---|---|
subscription_expiration | 21 avril 2024 à 02:00 |
relayer_connected | true |
relayer_region | eu-central-1 |
remote_enabled | true |
remote_connected | true |
alexa_enabled | true |
google_enabled | true |
remote_server | eu-central-1-19.ui.nabu.casa |
certificate_status | ready |
instance_id | e7095691c70e428f9d3a1e216a4d93a0 |
can_reach_cert_server | ok |
can_reach_cloud_auth | ok |
can_reach_cloud | ok |
host_os | Home Assistant OS 12.1 |
---|---|
update_channel | stable |
supervisor_version | supervisor-2024.04.0 |
agent_version | 1.6.0 |
docker_version | 24.0.7 |
disk_total | 30.8 GB |
disk_used | 9.4 GB |
healthy | true |
supported | true |
board | ova |
supervisor_api | ok |
version_api | ok |
installed_addons | Node-RED (17.0.11), Studio Code Server (5.15.0), Advanced SSH & Web Terminal (17.2.0), ESPHome (2024.3.2), AirCast (4.2.1), Network UPS Tools (0.13.0), SQLite Web (4.1.2), TasmoAdmin (0.30.0), File editor (5.8.0), Zigbee2MQTT (1.36.1-1), Mosquitto broker (6.4.0), Z-Wave JS (0.4.5), Z-Wave JS UI (3.4.2), Piper (1.5.0), Whisper (2.0.0), openWakeWord (1.10.0) |
dashboards | 4 |
---|---|
resources | 27 |
views | 34 |
mode | storage |
oldest_recorder_run | 1 avril 2024 à 12:42 |
---|---|
current_recorder_run | 8 avril 2024 à 15:32 |
estimated_db_size | 183.70 MiB |
database_engine | sqlite |
database_version | 3.44.2 |
As neither the official Volvo Plugin nor the Volvo2MQTT one work with my car (XC40 P8) I wanted to try this integration. But trying to add it to my HA installation I get a "not valid repository" error.
don0t have logs
No dump as plugin not installed
Unfortunately, my joy didn't last for long. Later today I wanted to refresh the data manually and reloaded the integration but it failed to start up again. I was on phone and didn't have time to debug so I simply restarted HA, hoping it would resolve the issue but the integration still wouldn't start up. Unfortunately, I didn't capture the logs but I remember seeing a 404 message for some API v2 endpoint. I deleted the integration completely and reinstalled from scratch but I get an "unknown error occurred" message already when submitting username/password/VCC key. I get the following error message every time I try to add my car. Seems to be some issue with getting the VINs. Volvo stuff is at the bottom.
What could be the issue?
Logger: aiohttp.server
Source: /usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py:403
First occurred: 21:03:41 (1 occurrences)
Last logged: 21:03:41
Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 117, in impl
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 148, in handle
result = await handler(request, **request.match_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 63, in with_admin
return await func(self, request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 177, in post
return await super().post(request, flow_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
result = await method(view, request, data, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
result = await self._flow_mgr.async_configure(flow_id, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 293, in async_configure
result = await self._async_handle_step(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 389, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/volvoaaos/config_flow.py", line 75, in async_step_user
return await self.async_step_select_vin()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/volvoaaos/config_flow.py", line 99, in async_step_select_vin
response = await connected_vehicle.list_vehicles()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/volvoaaos/volvo.py", line 170, in list_vehicles
return GetVinModel.parse_obj(response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "pydantic/main.py", line 526, in pydantic.main.BaseModel.parse_obj
File "pydantic/main.py", line 341, in pydantic.main.BaseModel.init
pydantic.error_wrappers.ValidationError: 2 validation errors for GetVinModel
status
field required (type=value_error.missing)
operationId
field required (type=value_error.missing)
Originally posted by @rene-neimann in #20 (comment)
If I add multiple cars that are connected to my account, only one actually gets added. The correct VINs are listed but if another is selected, it seems to overwrite the previously added vehicle.
Allow multiple vehicles.
None
None
Unraid server running ha core inside docker
I use my volvo email address for user and the password. I've entered the vccapikey but i get an error when trying to add integration
...
None
No response
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.