Open SimonBeau opened 1 month ago
I'm also experiencing random hanging of HA since HA 2024.10.x.
I am getting this error after updating device configuration. The associated hanging of home assistant for me was far more easily seen when I had a misconfigured local tuya light
I have 4 entities supported by local tuya. On boot I get an exception for each entity with a pretty severe sounding warning:
RuntimeError: Detected that custom integration 'localtuya' calls async_dispatcher_send from a thread other than the event loop, which may cause Home Assistant to crash or data to corrupt. For more information, see https://developers.home-assistant.io/docs/asyncio_thread_safety/#async_dispatcher_send at custom_components/localtuya/common.py, line 351: async_dispatcher_send(self._hass, signal, self._status). Please report it to the author of the 'localtuya' custom integration.
I noticed this because I'm trying to track down why my HA instance hangs randomly about once a day. This may or may not be related.
The devices do become available after about 30 seconds and appear to function correctly.
Example log:
Exception in _new_entity_handler when dispatching 'localtuya_entity_XXXXXXXXX': ('switch.strip',) Traceback (most recent call last): File "/config/custom_components/localtuya/common.py", line 263, in _new_entity_handler self._dispatch_status() File "/config/custom_components/localtuya/common.py", line 351, in _dispatch_status async_dispatcher_send(self._hass, signal, self._status) File "/usr/src/homeassistant/homeassistant/helpers/dispatcher.py", line 214, in async_dispatcher_send hass.verify_event_loop_thread("async_dispatcher_send") File "/usr/src/homeassistant/homeassistant/core.py", line 462, in verify_event_loop_thread frame.report_non_thread_safe_operation(what) File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 229, in report_non_thread_safe_operation report( File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 163, in report _report_integration(what, integration_frame, level, error_if_integration) File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 201, in _report_integration raise RuntimeError( RuntimeError: Detected that custom integration 'localtuya' calls async_dispatcher_send from a thread other than the event loop, which may cause Home Assistant to crash or data to corrupt. For more information, see https://developers.home-assistant.io/docs/asyncio_thread_safety/#async_dispatcher_send at custom_components/localtuya/common.py, line 351: async_dispatcher_send(self._hass, signal, self._status). Please report it to the author of the 'localtuya' custom integration.