Regular errors in logs
2022-07-08 16:13:41 ERROR (MainThread) [custom_components.audiconnect.audi_connect_account] Unable to obtain the vehicle longTerm tripdata of XXXXXX: 'NoneType' object is not subscriptable 2022-07-08 16:13:42 ERROR (MainThread) [custom_components.audiconnect.audi_connect_account] support_preheater set to False: 502
@arjenvrh I have two Audis connected. I get this error as well. Additionally I get short-term data errors, which are continuous and are spamming the logs. Is it possible for you to fix that? I am running HA 2022.07 but theses errors were there before as well.
Kind regards
2022-07-09 07:05:57 ERROR (MainThread) [custom_components.audiconnect.audi_connect_account] Unable to obtain the vehicle longTerm tripdata of WAUZZZZZZZZZZZZZZ: 'NoneType' object is not subscriptable
2022-07-09 07:05:57 ERROR (MainThread) [custom_components.audiconnect.audi_connect_account] support_preheater set to False: 502
2022-07-09 07:05:58 ERROR (MainThread) [custom_components.audiconnect.audi_connect_account] Unable to obtain the vehicle longTerm tripdata of WAUZZZXXXXXXXXXXX: 'NoneType' object is not subscriptable
2022-07-09 07:05:58 ERROR (MainThread) [custom_components.audiconnect.audi_connect_account] support_preheater set to False: 502
2022-07-09 07:05:59 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform audiconnect
Traceback (most recent call last):
File "/usr/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 397, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 641, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 776, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 532, in async_write_ha_state
self._async_write_ha_state()
File "/usr/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 646, in _async_write_ha_state
self.hass.states.async_set(
File "/usr/lib/python3.10/site-packages/homeassistant/core.py", line 1438, in async_set
state = State(
File "/usr/lib/python3.10/site-packages/homeassistant/core.py", line 1099, in __init__
raise InvalidStateError(
homeassistant.exceptions.InvalidStateError: Invalid state encountered for entity ID: sensor.audi_e_tron_gt_shortterm_trip_data. State max length is 255 characters.
2022-07-09 07:07:03 ERROR (MainThread) [homeassistant.util.logging] Exception in async_schedule_update_ha_state when dispatching 'audiconnect.updated': ()
Traceback (most recent call last):
File "/usr/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 677, in async_schedule_update_ha_state
self.async_write_ha_state()
File "/usr/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 532, in async_write_ha_state
self._async_write_ha_state()
File "/usr/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 646, in _async_write_ha_state
self.hass.states.async_set(
File "/usr/lib/python3.10/site-packages/homeassistant/core.py", line 1438, in async_set
state = State(
File "/usr/lib/python3.10/site-packages/homeassistant/core.py", line 1099, in __init__
raise InvalidStateError(
homeassistant.exceptions.InvalidStateError: Invalid state encountered for entity ID: sensor.audi_a3_sportback_tfsi_e_shortterm_trip_data. State max length is 255 characters.
2022-07-09 07:14:27 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.10/site-packages/aioshelly/block_device.py", line 128, in _async_init
await self.initialize()
File "/usr/lib/python3.10/site-packages/aioshelly/block_device.py", line 98, in initialize
await self.update_settings()
File "/usr/lib/python3.10/site-packages/aioshelly/block_device.py", line 202, in update_settings
self._settings = await self.http_request("get", "settings")
File "/usr/lib/python3.10/site-packages/aioshelly/block_device.py", line 234, in http_request
resp_json = await resp.json()
File "/usr/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1098, in json
await self.read()
File "/usr/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1036, in read
self._body = await self.content.read()
File "/usr/lib/python3.10/site-packages/aiohttp/streams.py", line 375, in read
block = await self.readany()
File "/usr/lib/python3.10/site-packages/aiohttp/streams.py", line 397, in readany
await self._wait("readany")
File "/usr/lib/python3.10/site-packages/aiohttp/streams.py", line 304, in _wait
await waiter
aiohttp.client_exceptions.ClientPayloadError: Response payload is not completed
2022-07-09 07:14:33 ERROR (MainThread) [homeassistant.util.logging] Exception in async_schedule_update_ha_state when dispatching 'audiconnect.updated': ()
Traceback (most recent call last):
File "/usr/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 677, in async_schedule_update_ha_state
self.async_write_ha_state()
File "/usr/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 532, in async_write_ha_state
self._async_write_ha_state()
File "/usr/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 646, in _async_write_ha_state
self.hass.states.async_set(
File "/usr/lib/python3.10/site-packages/homeassistant/core.py", line 1438, in async_set
state = State(
File "/usr/lib/python3.10/site-packages/homeassistant/core.py", line 1099, in __init__
raise InvalidStateError(
homeassistant.exceptions.InvalidStateError: Invalid state encountered for entity ID: sensor.audi_e_tron_gt_shortterm_trip_data. State max length is 255 characters.
2022-07-09 07:14:41 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.10/site-packages/aioshelly/block_device.py", line 128, in _async_init
await self.initialize()
File "/usr/lib/python3.10/site-packages/aioshelly/block_device.py", line 98, in initialize
await self.update_settings()
File "/usr/lib/python3.10/site-packages/aioshelly/block_device.py", line 202, in update_settings
self._settings = await self.http_request("get", "settings")
File "/usr/lib/python3.10/site-packages/aioshelly/block_device.py", line 234, in http_request
resp_json = await resp.json()
File "/usr/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1098, in json
await self.read()
File "/usr/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1036, in read
self._body = await self.content.read()
File "/usr/lib/python3.10/site-packages/aiohttp/streams.py", line 375, in read
block = await self.readany()
File "/usr/lib/python3.10/site-packages/aiohttp/streams.py", line 397, in readany
await self._wait("readany")
File "/usr/lib/python3.10/site-packages/aiohttp/streams.py", line 304, in _wait
await waiter
aiohttp.client_exceptions.ClientPayloadError: Response payload is not completed
2022-07-09 07:15:37 ERROR (MainThread) [homeassistant.util.logging] Exception in async_schedule_update_ha_state when dispatching 'audiconnect.updated': ()
Traceback (most recent call last):
File "/usr/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 677, in async_schedule_update_ha_state
self.async_write_ha_state()
File "/usr/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 532, in async_write_ha_state
self._async_write_ha_state()
File "/usr/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 646, in _async_write_ha_state
self.hass.states.async_set(
File "/usr/lib/python3.10/site-packages/homeassistant/core.py", line 1438, in async_set
state = State(
File "/usr/lib/python3.10/site-packages/homeassistant/core.py", line 1099, in __init__
raise InvalidStateError(
homeassistant.exceptions.InvalidStateError: Invalid state encountered for entity ID: sensor.audi_e_tron_gt_shortterm_trip_data. State max length is 255 characters.
Seems to be a Python 3.10 Problem.
Got the Error after upgrading my HomeAssistant to use python 3.10
homeassistant.exceptions.InvalidStateError: Invalid state encountered for entity ID: sensor.audi_e_tron_gt_shortterm_trip_data. State max length is 255 characters.
I think I got it even before python 3.10
You're right!
I switch back to python 3.9 and the error is still present. Have the same problem.
Any update on this issue? I have the message about every minute in my logs
2022-09-20 11:57:09.874 ERROR (MainThread) [homeassistant.util.logging] Exception in async_schedule_update_ha_state when dispatching 'audiconnect.updated': () Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 678, in async_schedule_update_ha_state self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 533, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 647, in _async_write_ha_state self.hass.states.async_set( File "/usr/src/homeassistant/homeassistant/core.py", line 1463, in async_set state = State( File "/usr/src/homeassistant/homeassistant/core.py", line 1124, in init raise InvalidStateError( homeassistant.exceptions.InvalidStateError: Invalid state encountered for entity ID: sensor.q5_shortterm_trip_data. State max length is 255 characters.
Same here
same here
I digged a bit into this issue. The error pops up because the trip data is returned as a long JSON string with the multiple attributes combined in one sensor. The result is too long since HA limited the sensor state length to max. 255 chars.
Since there is no maintainer for this project anymore, you can fix it yourself doing the following changes:
In homeassistant\custom_components\audiconnect\audi_connect_account.py
search for async def update_vehicle_tripdata(self, kind: str): (around line 700)
comment out some of the following lines where all the attributes are mentioned.
Mine looks like this now:
(I added some more coding since I had another bug regarding the reset trip data sensor, you just need to add some # at the beginning of the lines you don't care about)
if td_cur is not None:
self._vehicle.state[kind.lower() + "_current"] = {
"tripID": td_cur.tripID,
# "averageElectricEngineConsumption": td_cur.averageElectricEngineConsumption,
# "averageFuelConsumption": td_cur.averageFuelConsumption,
# "averageSpeed": td_cur.averageSpeed,
"mileage": td_cur.mileage,
"startMileage": td_cur.startMileage,
# "traveltime": td_cur.traveltime,
"timestamp": td_cur.timestamp,
# "overallMileage": td_cur.overallMileage,
}
if td_rst is not None:
self._vehicle.state[kind.lower() + "_reset"] = {
"tripID": td_rst.tripID,
# "averageElectricEngineConsumption": td_rst.averageElectricEngineConsumption,
# "averageFuelConsumption": td_rst.averageFuelConsumption,
# "averageSpeed": td_rst.averageSpeed,
"mileage": td_rst.mileage,
"startMileage": td_rst.startMileage,
# "traveltime": td_rst.traveltime,
"timestamp": td_rst.timestamp,
# "overallMileage": td_rst.overallMileage,
}
This issue is stale because it has been open for 60 days with no activity. Are you still experiencing this issue?