device_traker not working
the device tracker item no longer appears after the update
Can you provide logs? It's working for me.
this is what I have on mine:
2024-03-26 15:46:09.310 ERROR (MainThread) [custom_components.audiconnect.audi_connect_account] Unable to update the vehicle position of chasis_number: 'carCapturedTimestamp' Traceback (most recent call last): File "/config/custom_components/audiconnect/audi_connect_account.py", line 492, in update_vehicle_position "timestamp": resp["data"]["carCapturedTimestamp"], ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^ KeyError: 'carCapturedTimestamp'
Adding the response:
'carCapturedTimestamp': datetime.datetime(2024, 3, 25, 19, 48, 34, tzinfo=datetime.timezone.utc)
Need to have a deeper look into: https://github.com/audiconnect/audi_connect_ha/blob/f0b48c3059a339220e32ae71e88c47ea2c4c773b/custom_components/audiconnect/audi_connect_account.py#L482
Do you have this issue quite often? Had it once and I guess restarting helped to get it back running. As self.support_position ist set to True again.
Need to have a deeper look into:
https://github.com/audiconnect/audi_connect_ha/blob/f0b48c3059a339220e32ae71e88c47ea2c4c773b/custom_components/audiconnect/audi_connect_account.py#L482
Do you have this issue quite often? Had it once and I guess restarting helped to get it back running. As self.support_position ist set to True again.
It wasn't working for a while (since last update, at least) and today, it just started working out of the blue, go figure...
@alfry82 still not working on your side?
` Logger: homeassistant.components.device_tracker Source: helpers/entity_platform.py:576 integration: Device Tracker (documentation, issues) First occurred: 08:04:22 (5 occurrences) Last logged: 13:01:31
Error adding entity None for domain device_tracker with platform audiconnect Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 576, in _async_add_entities await coro File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 725, in _async_add_entity device = dev_reg.async_get(self.hass).async_get_or_create( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/device_registry.py", line 561, in async_get_or_create raise HomeAssistantError( homeassistant.exceptions.HomeAssistantError: Can't link device to unknown config entry 00exx9f5xxab `
I updated to the latest version overnight - I am getting no device tracker now, and this entry in the log.
Great work everyone, I hope this helps.
As the Audi API had some issues yesterday, just to confirm: This issue still remains with latest version?
As the Audi API had some issues yesterday, just to confirm: This issue still remains with latest version?
@Kolbi yes, the problem still exists on my installation, even today after the Audi API problem it still returns the same error on device tracker with the latest version.
I have just reverted back to 1.0.3 and device_tracker works in that version.
Still curious because I'm not aware of any changes regarding device_tracker since 1.0.3 - I'm pretty sure if you now update to 1.1.0 again it will work?
Still curious because I'm not aware of any changes regarding device_tracker since 1.0.3 - I'm pretty sure if you now update to 1.1.0 again it will work?
I have now installed 1.1.0 again from 1.0.3 and it works! Bizzare - OK I'll put that down to experience!
@alfry82 can you provide an update if this is working in recent versions?
Same here.
Since a couple of days no position is available for my car. Tried rollback/ update as requested. The Audi app shows the correct location information for my car.
Steps I have taken to get the device_tracker object back:
- removed the configuration from home-assistant.
- restart home-assistant.
- removed integration.
- restart home-assistant
- added integration (version 1.3.1)
- restart home-assistant.
- added my car.
- restart home-assistant
The device-overview reports no device_tracker object at all anymore. All other info is up-to-date and correct.
Same here. Two Audi's, one reports correct location other not. Both show correctly in Audi app.
Any interesting in the logs (debug log)?
Edit:
[removed wait till redacted PR is integrated]
Wait till https://github.com/audiconnect/audi_connect_ha/pull/354 is implemented.
I find uninstalling it or replacing with an earlier version then reinstalling the latest version resolves the problem. For now its working for me. I can try the debug log version if you need more people to try it?
Same here.
Since a couple of days no position is available for my car. Tried rollback/ update as requested. The Audi app shows the correct location information for my car.
Steps I have taken to get the device_tracker object back:
- removed the configuration from home-assistant.
- restart home-assistant.
- removed integration.
- restart home-assistant
- added integration (version 1.3.1)
- restart home-assistant.
- added my car.
- restart home-assistant
The device-overview reports no device_tracker object at all anymore. All other info is up-to-date and correct.
Overnight, the device_tracker entity for my car showed up again... (version 1.3.1) For me the problem is solved atm
Is Audi messing with us? ;)
2024-04-11 13:58:30.133 ERROR (MainThread) [homeassistant.components.device_tracker] Error adding entity device_tracker.audi_a6_avant_tfsi_e_position for domain device_tracker with platform audiconnect Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 580, in _async_add_entities await coro File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 890, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1334, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 998, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1119, in _async_write_ha_state state, attr, capabilities, shadowed_attr = self.__async_calculate_state() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1056, in __async_calculate_state state = self._stringify_state(available) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1004, in _stringify_state if (state := self.state) is None: ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/device_tracker/config_entry.py", line 259, in state zone_state = zone.async_active_zone( ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/zone/init.py", line 129, in async_active_zone zone_dist := distance( ^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/util/location.py", line 71, in distance result = vincenty((lat1, lon1), (lat2, lon2)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/util/location.py", line 94, in vincenty U1 = math.atan((1 - FLATTENING) * math.tan(math.radians(point1[0]))) ^^^^^^^^^^^^^^^^^^^^^^^ TypeError: must be real number, not str
Please try version >= 1.4.0 and enable debug mode if you encounter the issue and provide us the specific lines from the logfile.
Currently I get:
2024-04-12 14:09:54.323 DEBUG (MainThread) [custom_components.audiconnect.audi_connect_account] Starting update_vehicle_position for VIN: ************* 2024-04-12 14:09:54.323 DEBUG (MainThread) [custom_components.audiconnect.audi_connect_account] Attempting to retrieve stored position for VIN: ************* 2024-04-12 14:09:54.706 DEBUG (MainThread) [custom_components.audiconnect.audi_connect_account] Position currently not available for VIN: *************. Received 204 status.
I am getting errors since the latest release (1.5.2):
2024-04-12 17:19:31.642 DEBUG (MainThread) [custom_components.audiconnect.audi_connect_account] Starting update_vehicle_position for VIN: *************9894 2024-04-12 17:19:31.642 DEBUG (MainThread) [custom_components.audiconnect.audi_connect_account] Attempting to retrieve stored position for VIN: *************9894 2024-04-12 17:19:32.144 ERROR (MainThread) [custom_components.audiconnect.audi_connect_account] An unexpected error occurred while updating vehicle position for VIN: *************9894. Error: 'carCapturedTimestamp'
hmm seems like your car isn't providing the timestamp it was last parked. Is your location still updated in HA regardless of this error?
hmm seems like your car isn't providing the timestamp it was last parked. Is your location still updated in HA regardless of this error?
Nope. I have not had an update since last night
Apologies, just to clarify, has the car moved location and the updates aren't coming through on the tracker?
Only changes to device tracker are more logging to show exceptions/warnings in PR #354 . Its possible this issue was already occurring, but the error was never logged, so we're only just seeing it now.
API seems to be returning intermittent/mixed responses for the tracker, can you let us know if you continue to see the issue. Others seem to have the tracker coming in and out.
edit: I'll keep thinking about it though. Could be something in the code. I appreciate you reporting!
Apologies, just to clarify, has the car moved location and the updates aren't coming through on the tracker?
That is correct. Movements do not generate any updates to the position. In HA, the position is just stated as "Unknown"
Thank you for confirming! In a matter of minutes, i had my car turned on and received 204 error:
Position currently not available for VIN: *************. Received 204 status.
I also had no timestamp reported and unknown entity state.
I've submitted a PR #374 to gracefully handle no timestamp or parktime. Its working for me. Hopefully this fixes it.
Can you please test with latest v1.6.0 if issue still remaining?
Can you please test with latest v1.6.0 if issue still remaining?
Hey, the issue seems to have been resolved with the new update. Thanks for fixing!
closing as the issue seems resolved. Please report any new (or old) issues you see!