Installation method of hass (venv, docker, hassio,...)
hassio
Configuration
UI configuration
Describe the bug
When trying to set up the integration, for a car with ID software 2.4 and older, it errors out when trying to access the missing keys for bonnet, doors, etc., that were added in 3.0.
Debug log
2022-11-18 16:04:05.287 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform volkswagen_we_connect_id
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
state = self._stringify_state(available)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 551, in _stringify_state
if (state := self.state) is None:
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 669, in state
value = self.native_value
File "/config/custom_components/volkswagen_we_connect_id/sensor.py", line 351, in native_value
state = get_object_value(self.entity_description.value(self.data.domains))
File "/config/custom_components/volkswagen_we_connect_id/sensor.py", line 168, in <lambda>
value=lambda data: data["access"]["accessStatus"]
KeyError: 'bonnet'
2022-11-18 16:04:05.310 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up volkswagen_we_connect_id platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 289, in _async_setup_platform
await asyncio.gather(*pending)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
state = self._stringify_state(available)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 551, in _stringify_state
if (state := self.state) is None:
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 669, in state
value = self.native_value
File "/config/custom_components/volkswagen_we_connect_id/sensor.py", line 351, in native_value
state = get_object_value(self.entity_description.value(self.data.domains))
File "/config/custom_components/volkswagen_we_connect_id/sensor.py", line 168, in <lambda>
value=lambda data: data["access"]["accessStatus"]
KeyError: 'bonnet'
2022-11-18 16:04:05.796 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up volkswagen_we_connect_id platform for binary_sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 281, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/volkswagen_we_connect_id/binary_sensor.py", line 128, in async_setup_entry
await coordinator.async_config_entry_first_refresh()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 173, in async_config_entry_first_refresh
await self._async_refresh(log_failures=False, raise_on_auth_failed=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
self.async_update_listeners()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 110, in async_update_listeners
update_callback()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 348, in _handle_coordinator_update
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
state = self._stringify_state(available)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 551, in _stringify_state
if (state := self.state) is None:
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 669, in state
value = self.native_value
File "/config/custom_components/volkswagen_we_connect_id/sensor.py", line 351, in native_value
state = get_object_value(self.entity_description.value(self.data.domains))
File "/config/custom_components/volkswagen_we_connect_id/sensor.py", line 168, in <lambda>
value=lambda data: data["access"]["accessStatus"]
KeyError: 'bonnet'
2022-11-18 16:04:10.079 WARNING (MainThread) [homeassistant.components.number] Setup of number platform volkswagen_we_connect_id is taking over 10 seconds.
2022-11-18 16:04:10.081 WARNING (MainThread) [homeassistant.components.device_tracker] Setup of device_tracker platform volkswagen_we_connect_id is taking over 10 seconds.
2022-11-18 16:04:37.617 ERROR (MainThread) [homeassistant.components.device_tracker] Error while setting up volkswagen_we_connect_id platform for device_tracker
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 281, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/volkswagen_we_connect_id/device_tracker.py", line 29, in async_setup_entry
await coordinator.async_config_entry_first_refresh()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 173, in async_config_entry_first_refresh
await self._async_refresh(log_failures=False, raise_on_auth_failed=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
self.async_update_listeners()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 110, in async_update_listeners
update_callback()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 348, in _handle_coordinator_update
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
state = self._stringify_state(available)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 551, in _stringify_state
if (state := self.state) is None:
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 669, in state
value = self.native_value
File "/config/custom_components/volkswagen_we_connect_id/sensor.py", line 351, in native_value
state = get_object_value(self.entity_description.value(self.data.domains))
File "/config/custom_components/volkswagen_we_connect_id/sensor.py", line 168, in <lambda>
value=lambda data: data["access"]["accessStatus"]
KeyError: 'bonnet'
2022-11-18 16:04:39.046 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/volkswagen_we_connect_id/number.py", line 28, in async_setup_entry
await coordinator.async_config_entry_first_refresh()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 173, in async_config_entry_first_refresh
await self._async_refresh(log_failures=False, raise_on_auth_failed=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
self.async_update_listeners()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 110, in async_update_listeners
update_callback()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 348, in _handle_coordinator_update
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
state = self._stringify_state(available)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 551, in _stringify_state
if (state := self.state) is None:
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 669, in state
value = self.native_value
File "/config/custom_components/volkswagen_we_connect_id/sensor.py", line 351, in native_value
state = get_object_value(self.entity_description.value(self.data.domains))
File "/config/custom_components/volkswagen_we_connect_id/sensor.py", line 168, in <lambda>
value=lambda data: data["access"]["accessStatus"]
KeyError: 'bonnet'
2022-11-18 16:04:44.831 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 151, in _handle_refresh_interval
await self._async_refresh(log_failures=True, scheduled=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
self.async_update_listeners()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 110, in async_update_listeners
update_callback()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 348, in _handle_coordinator_update
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
state = self._stringify_state(available)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 551, in _stringify_state
if (state := self.state) is None:
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 669, in state
value = self.native_value
File "/config/custom_components/volkswagen_we_connect_id/sensor.py", line 351, in native_value
state = get_object_value(self.entity_description.value(self.data.domains))
File "/config/custom_components/volkswagen_we_connect_id/sensor.py", line 168, in <lambda>
value=lambda data: data["access"]["accessStatus"]
KeyError: 'bonnet'
For now i changed the release to prerelease, so that no other people will update to this issue.
Will take a look at your PR and the code later next week!
Version of the custom_component
v0.1.0.2
Installation method (hacs / manual)
hacs
Installation method of hass (venv, docker, hassio,...)
hassio
Configuration
UI configuration
Describe the bug
When trying to set up the integration, for a car with ID software 2.4 and older, it errors out when trying to access the missing keys for bonnet, doors, etc., that were added in 3.0.
Debug log