[BUG] Can only set up one car out of two
Closed this issue ยท 14 comments
Before you post a new issue - you must first check the following (and check the boxes with an "X" below)
- 1.) Can you login using the smartphone app Volkswagen/Volkswagen Connect and interact with your car?
- 2.) Please make sure that you can login into https://vwid.vwgroup.io/ and make sure that any "Terms and Conditions" are all checked
- 3.) I do not have MFA enabled.
Environment
- Volkswagencarnet release with the issue: 4.6.1
- Last working homeassistant-volkswagencarnet release (if known): 2024.4.5
- Home Assistant Core release with the issue: 2024.5.0
- Operating environment (Home Assistant OS/Supervised/Container/Core/venv): Home Assistant OS
- Car model and year: e-Golf & Passat GTE
- Country where the car was bought: Norway
- Valid VW Connect subscription: Yes
- Have you verified that the We Connect service works via VWยดs portal?: Yes
Describe the bug
It seems that the integration can retrieve data for only one car. After restarting HA, sometimes e-Golf is OK , but all data for GTE is missing. And somtimes the other way, Passat GTE is OK, but e-Golf data is missing.
Steps to Reproduce
Expected behavior
Screenshots
Traceback/Error logs
2024-05-02 08:03:27.825 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up volkswagencarnet platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 356, in _async_setup_platform
await asyncio.shield(awaitable)
File "/config/custom_components/volkswagencarnet/sensor.py", line 31, in async_setup_entry
data = hass.data[DOMAIN][entry.entry_id][DATA]
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: 'c8a6b6ad8exxxxxxxxxxxx749c666764c'
2024-05-02 08:03:27.827 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up volkswagencarnet platform for binary_sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 356, in _async_setup_platform
await asyncio.shield(awaitable)
File "/config/custom_components/volkswagencarnet/binary_sensor.py", line 29, in async_setup_entry
data = hass.data[DOMAIN][entry.entry_id][DATA]
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: 'c8a6b6ad8exxxxxxxxxxxxxxx749c666764c'
2024-05-02 08:03:27.829 ERROR (MainThread) [homeassistant.components.number] Error while setting up volkswagencarnet platform for number
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 356, in _async_setup_platform
await asyncio.shield(awaitable)
File "/config/custom_components/volkswagencarnet/number.py", line 27, in async_setup_entry
data = hass.data[DOMAIN][entry.entry_id][DATA]
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: 'c8a6b6ad8exxxxxxxxxxxxxxx749c666764c'
2024-05-02 08:03:27.830 ERROR (MainThread) [homeassistant.components.device_tracker] Error while setting up volkswagencarnet platform for device_tracker
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 356, in _async_setup_platform
await asyncio.shield(awaitable)
File "/config/custom_components/volkswagencarnet/device_tracker.py", line 20, in async_setup_entry
data = hass.data[DOMAIN][entry.entry_id][DATA]
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: 'c8a6b6ad8exxxxxxxxxxxxxxx749c666764c'
2024-05-02 08:03:27.831 ERROR (MainThread) [homeassistant.components.switch] Error while setting up volkswagencarnet platform for switch
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 356, in _async_setup_platform
await asyncio.shield(awaitable)
File "/config/custom_components/volkswagencarnet/switch.py", line 23, in async_setup_entry
data = hass.data[DOMAIN][entry.entry_id][DATA]
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: 'c8a6b6ad8exxxxxxxxxxxx749c666764c'
Debug information - all JSON responses from logfile
Additional context
Note
Issues lacking sufficient details or context may be subject to closure without prior notice. Detailed bug reports are essential for effective issue resolution. Thank you for your cooperation.
Same here, since this morning. (as far as I can tell)
At first both cars were missing all data, but after a restart one car has data, the other one not
Same here
Hi All,
Yes, there is a known issue with the multiple vehicles under one account.
I am aware of it, I just need to find some time to debug it.
Just updated to 4.6.2 along with an update of core to 2024.5.1 and did a restart.
Same issue still applies, though it is now the car that did not work before that works and the one that worked that does not, like in the bug description, I imagine.
@kl1127 with all the different combinations of the accounts that I can think of, I was not able to reproduce it anymore.
Please enable and share the debug logging following this guidance: https://github.com/robinostlund/homeassistant-volkswagencarnet/wiki/Enabling-Debug-Logging-in-Home-Assistant
I've managed to reproduce this issue and this is a new one.
I've fixed another issue with multiple vehicles, not this one.
Something has been changed in HA 2024.5.x that I am not aware of... Not sure how to fix it yet.
It seems to be related to this change: https://developers.home-assistant.io/blog/2024/04/30/store-runtime-data-inside-config-entry
It seems to be related to this change: https://developers.home-assistant.io/blog/2024/04/30/store-runtime-data-inside-config-entry
@stickpin But this is a new feature as far as I understand, so it should not break the existing use of the ConfigEntry to store the data.
Documentation is still poor, unfortunately.
@virtualdj yes.. have no clue yet what is breaking it.
Found the issue. :) I have to run now... Spend too much time on something that stupid. :)
I will release the fix tonight or tomorrow morning. :)