Closed arjanvroege closed 1 month ago
What version of the integration are you running?
1.4.2
Thanks for your logs. There is a few issues in there we already have identified, but also a few new ones we need to address. :+1:
I suspect the MQTT code is eagerly retrying to parse an event again and again when the parsing fails and this is causing extra load and unresponsiveness. I've seen something similar with the cli but haven't had a chance to look into it yet.
Something certainly is looping, when you put the integration in debug, logs are huge
Maybe related to this error:
Logger: homeassistant Source: /usr/src/homeassistant/homeassistant/runner.py:147 First occurred: 10:52:33 (6714 occurrences) Last logged: 12:00:31
Within 1 hour and 10 minutes 6714 occurrences of the error.
Most likely this amount of logging would slow down HA, yes. What is the log message that is appearing so often?
Also, have a look to make sure your disk isnt full by now.
I didn't had any other messages as already described in the first post on these issues. This was the error I got 6714 times:
Logger: homeassistant Source: /usr/src/homeassistant/homeassistant/runner.py:147 First occurred: 10:52:33 (6714 occurrences) Last logged: 12:00:31
Error doing job: Exception in callback Client.loop_read() (None) Traceback (most recent call last): File "", line 15, in mashumaro_from_dict File "/usr/local/lib/python3.12/enum.py", line 757, in call return cls.new(cls, value) ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/enum.py", line 1171, in new raise ve_exc ValueError: 'manual' is not a valid ChargeMode
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "", line 26, in mashumaro_from_dict File "", line 17, in mashumaro_from_dict mashumaro.exceptions.InvalidFieldValue: Field "mode" of type ChargeMode in ServiceEventChargingData has invalid value 'manual'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/usr/local/lib/python3.12/site-packages/paho/mqtt/client.py", line 1556, in loop_read rc = self._packet_read() ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/paho/mqtt/client.py", line 2439, in _packet_read rc = self._packet_handle() ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/paho/mqtt/client.py", line 3033, in _packet_handle return self._handle_publish() ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/paho/mqtt/client.py", line 3327, in _handle_publish self._handle_on_message(message) File "/usr/local/lib/python3.12/site-packages/paho/mqtt/client.py", line 3570, in _handle_on_message on_message(self, self._userdata, message) File "/usr/local/lib/python3.12/site-packages/myskoda/mqtt.py", line 320, in _on_message self._emit(EventCharging(vin, user_id, data)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/myskoda/event.py", line 65, in init self.event = ServiceEventCharging.from_dict(payload) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 28, in mashumaro_from_dict mashumaro.exceptions.InvalidFieldValue: Field "data" of type ServiceEventChargingData in ServiceEventCharging has invalid value {'mode': 'manual', 'state': 'notReadyForCharging', 'soc': '34', 'chargedRange': '142', 'timeToFinish': '0', 'userId': 'bc326dbe-db2e-456c-a24b-1a69dc7fbdf7', 'vin': ''}
Thanks. We've identified this in skodaconnect/myskoda#55 and are working on fixing it.
Parsing error will be fixed under skodaconnect/myskoda#55
MQTT flood issue can be looked at under this issue. I'll try to take a look today.
When I enable this integration after several hours my HA instance become very unstable and slow. When checking the logs I always see the same events. Disabling the integration and restarting HA fixes the issue until I enable the integration again. I see the following events from the integration:
This error originated from a custom integration.
Logger: custom_components.myskoda.coordinator Source: helpers/debounce.py:137 integration: MySkoda (documentation, issues) First occurred: 10:53:56 (4 occurrences) Last logged: 11:58:56
Unexpected exception from <bound method MySkodaDataUpdateCoordinator._update_vehicle of <custom_components.myskoda.coordinator.MySkodaDataUpdateCoordinator object at 0x7f77243f16a0>> Traceback (most recent call last): File "/config/custom_components/myskoda/coordinator.py", line 183, in _update_vehicle self.set_updated_vehicle(vehicle) File "/config/custom_components/myskoda/coordinator.py", line 157, in set_updated_vehicle self.async_set_updated_data(self.data) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 489, in async_set_updated_data self.async_update_listeners() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 168, in async_update_listeners update_callback() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 533, in _handle_coordinator_update self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1005, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1130, in _async_write_ha_state self.async_calculate_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1067, in async_calculate_state state = self._stringify_state(available) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1011, in _stringify_state if (state := self.state) is None: ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/device_tracker/config_entry.py", line 238, in state if self.latitude is not None and self.longitude is not None: ^^^^^^^^^^^^^ File "/config/custom_components/myskoda/device_tracker.py", line 66, in latitude position = self._vehicle_position() ^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/myskoda/device_tracker.py", line 54, in _vehicle_position return next( ^^^^^ StopIteration
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/debounce.py", line 137, in _handle_timer_finish await task RuntimeError: coroutine raised StopIteration
Logger: homeassistant Source: /usr/src/homeassistant/homeassistant/runner.py:147 First occurred: 10:52:33 (6714 occurrences) Last logged: 12:00:31
Error doing job: Exception in callback Client.loop_read() (None) Traceback (most recent call last): File "", line 15, in mashumaro_from_dict
File "/usr/local/lib/python3.12/enum.py", line 757, in call
return cls.new(cls, value)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/enum.py", line 1171, in new
raise ve_exc
ValueError: 'manual' is not a valid ChargeMode
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "", line 26, in mashumaro_from_dict
File "", line 17, in mashumaro_from_dict
mashumaro.exceptions.InvalidFieldValue: Field "mode" of type ChargeMode in ServiceEventChargingData has invalid value 'manual'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/usr/local/lib/python3.12/site-packages/paho/mqtt/client.py", line 1556, in loop_read rc = self._packet_read() ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/paho/mqtt/client.py", line 2439, in _packet_read rc = self._packet_handle() ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/paho/mqtt/client.py", line 3033, in _packet_handle return self._handle_publish() ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/paho/mqtt/client.py", line 3327, in _handle_publish self._handle_on_message(message) File "/usr/local/lib/python3.12/site-packages/paho/mqtt/client.py", line 3570, in _handle_on_message on_message(self, self._userdata, message) File "/usr/local/lib/python3.12/site-packages/myskoda/mqtt.py", line 320, in _on_message self._emit(EventCharging(vin, user_id, data)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/myskoda/event.py", line 65, in init self.event = ServiceEventCharging.from_dict(payload) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 28, in mashumaro_from_dict
mashumaro.exceptions.InvalidFieldValue: Field "data" of type ServiceEventChargingData in ServiceEventCharging has invalid value {'mode': 'manual', 'state': 'notReadyForCharging', 'soc': '34', 'chargedRange': '142', 'timeToFinish': '0', 'userId': 'bc326dbe-db2e-456c-a24b-1a69dc7fbdf7', 'vin': ''}
Logger: myskoda.rest_api Source: /usr/local/lib/python3.12/site-packages/myskoda/rest_api.py:43 First occurred: 12:01:54 (1 occurrences) Last logged: 12:01:54
Failed to load data from url /v2/air-conditioning/. Return value was '{"estimatedDateTimeToReachTargetTemperature":"2024-10-02T10:01:54.223977733Z","state":"OFF","runningRequests":[],"targetTemperature":{"temperatureValue":21.0,"unitInCar":"CELSIUS"},"airConditioningAtUnlock":true,"windowHeatingEnabled":true,"steeringWheelPosition":"LEFT","seatHeatingActivated":{"frontLeft":true,"frontRight":true},"windowHeatingState":{"front":"OFF","rear":"OFF","unspecified":"INVALID"},"timers":[{"id":1,"enabled":false,"time":"00:00","type":"ONE_OFF","selectedDays":["SATURDAY"]},{"id":2,"enabled":false,"time":"00:00","type":"ONE_OFF","selectedDays":["SATURDAY"]}],"carCapturedTimestamp":"2024-10-02T10:01:26Z","errors":[{"type":"UNAVAILABLE_CHARGING_INFORMATION","description":"APIs for obtaining power cable connection/lock information are not available"}]}'
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/myskoda/rest_api.py", line 41, in _make_get_request
data = deserialize(response_text)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 25, in mashumaro_from_json
mashumaro.exceptions.MissingField: Field "charger_connection_state" of type ConnectionState is missing in AirConditioning instance
This error originated from a custom integration.
Logger: custom_components.myskoda.coordinator Source: helpers/debounce.py:137 integration: MySkoda (documentation, issues) First occurred: 12:01:54 (1 occurrences) Last logged: 12:01:54
Unexpected exception from <bound method MySkodaDataUpdateCoordinator._update_vehicle of <custom_components.myskoda.coordinator.MySkodaDataUpdateCoordinator object at 0x7f77243f16a0>> Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/debounce.py", line 137, in _handle_timer_finish await task File "/config/custom_components/myskoda/coordinator.py", line 182, in _update_vehicle vehicle = await self.myskoda.get_vehicle(self.vin) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/myskoda/myskoda.py", line 213, in get_vehicle vehicle.air_conditioning = await self.get_air_conditioning(vin) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/myskoda/myskoda.py", line 171, in get_air_conditioning return await self.rest_api.get_air_conditioning(vin) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/myskoda/rest_api.py", line 67, in get_air_conditioning return await self._make_get_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/myskoda/rest_api.py", line 41, in _make_get_request data = deserialize(response_text) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 25, in mashumaro_from_json
mashumaro.exceptions.MissingField: Field "charger_connection_state" of type ConnectionState is missing in AirConditioning instance
Logger: myskoda.mqtt Source: runner.py:189 First occurred: 12:00:31 (7 occurrences) Last logged: 12:49:01
Failed to connect to MQTT.
Logger: homeassistant Source: /usr/src/homeassistant/homeassistant/runner.py:147 First occurred: 12:00:45 (7 occurrences) Last logged: 12:50:10
Error doing job: Task exception was never retrieved (None) Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/asyncio_paho/client.py", line 348, in _loop_misc self.reconnect() File "/usr/local/lib/python3.12/site-packages/paho/mqtt/client.py", line 1088, in reconnect return self._send_connect(self._keepalive) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/paho/mqtt/client.py", line 2819, in _send_connect return self._packet_queue(command, packet, 0, 0) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/paho/mqtt/client.py", line 3018, in _packet_queue self._call_socket_register_write() File "/usr/local/lib/python3.12/site-packages/paho/mqtt/client.py", line 2247, in _call_socket_register_write on_socket_register_write( File "/usr/local/lib/python3.12/site-packages/asyncio_paho/client.py", line 318, in _on_socket_register_write_asyncio self._event_loop.add_writer(sock, client.loop_write) File "/usr/local/lib/python3.12/asyncio/selector_events.py", line 357, in add_writer self._add_writer(fd, callback, *args) File "/usr/local/lib/python3.12/asyncio/selector_events.py", line 317, in _add_writer self._selector.modify(fd, mask | selectors.EVENT_WRITE, File "/usr/local/lib/python3.12/selectors.py", line 380, in modify self._selector.modify(key.fd, selector_events) FileNotFoundError: [Errno 2] No such file or directory