Skip to content

wakepsx_on_bt' calls async_register from a thread other than the event loop #4

@federicogualdi

Description

@federicogualdi

Here's Home Assistant Logs

Logger: homeassistant.setup
Source: setup.py:425
First occurred: January 18, 2026 at 9:12:06 PM (1 occurrence)
Last logged: January 18, 2026 at 9:12:06 PM

Error during setup of component wakepsx_on_bt: Detected that custom integration 'wakepsx_on_bt' calls hass.services.async_register 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/#hassservicesasync_register at custom_components/wakepsx_on_bt/init.py, line 69: hass.services.async_register(. Please create a bug report at https://github.com/FreeTHX/wakepsx_on_bt-ha/issues
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 425, in _async_setup_component
result = await task
^^^^^^^^^^
File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/wakepsx_on_bt/init.py", line 69, in setup
hass.services.async_register(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
DOMAIN,
^^^^^^^
...<2 lines>...
schema=WAKEPSX_ON_BT_SEND_MAGIC_PACKET_SCHEMA,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/src/homeassistant/homeassistant/core.py", line 2595, in async_register
self._hass.verify_event_loop_thread("hass.services.async_register")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 428, in verify_event_loop_thread
frame.report_non_thread_safe_operation(what)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 417, in report_non_thread_safe_operation
report_usage(
~~~~~~~~~~~~^
f"calls {what} from a thread other than the event loop, "
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<6 lines>...
custom_integration_behavior=ReportBehavior.ERROR,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 218, in report_usage
future.result()
~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.13/concurrent/futures/_base.py", line 456, in result
return self.__get_result()
~~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.13/concurrent/futures/_base.py", line 401, in __get_result
raise self.exception
File "/usr/src/homeassistant/homeassistant/util/async
.py", line 67, in run_callback
future.set_result(callback(*args))
~~~~~~~~^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 266, in _report_usage
_report_usage_integration_frame(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
hass,
^^^^^
...<4 lines>...
integration_behavior is ReportBehavior.ERROR,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 366, in _report_usage_integration_frame
raise RuntimeError(
...<5 lines>...
)
RuntimeError: Detected that custom integration 'wakepsx_on_bt' calls hass.services.async_register 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/#hassservicesasync_register at custom_components/wakepsx_on_bt/init.py, line 69: hass.services.async_register(. Please create a bug report at https://github.com/FreeTHX/wakepsx_on_bt-ha/issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions