-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
Describe the bug
RuntimeError: Detected that custom integration 'hon' calls async_write_ha_state from a thread other than the event loop, which may cause Home Assistant to crash or data to corrupt.
Environment (please complete the following information):
- Core 2024.12.4
- Supervisor 2024.12.0
- hOn Integration Version 0.14.0
- pyhOn Version [e.g.
0.13.1, can be found in device log]
Home Assistant Logs
RuntimeError: Detected that custom integration 'hon' calls async_write_ha_state 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_write_ha_state at custom_components/hon/sensor.py, line 877: self.async_write_ha_state(). Please report it to the author of the 'hon' custom integration
Exception ignored in: <class 'RuntimeError'>
Traceback (most recent call last):
File "/usr/local/lib/python3.13/site-packages/awscrt/mqtt5.py", line 1471, in _on_publish
self._on_publish_cb(PublishReceivedData(publish_packet=publish_packet))
File "/usr/local/lib/python3.13/site-packages/pyhon/connection/mqtt.py", line 105, in _on_publish_received
self._hon.notify()
File "/usr/local/lib/python3.13/site-packages/pyhon/hon.py", line 130, in notify
self._notify_function(None)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 514, in async_set_updated_data
self.async_update_listeners()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 177, in async_update_listeners
update_callback()
File "/config/custom_components/hon/sensor.py", line 877, in _handle_coordinator_update
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1022, in async_write_ha_state
report_non_thread_safe_operation("async_write_ha_state")
File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 368, in report_non_thread_safe_operation
report(
File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 164, in report
report_usage(
File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 242, in report_usage
_report_integration_frame(
File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 340, in _report_integration_frame
raise RuntimeError( 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_write_ha_state at custom_components/hon/sensor.py, line 877: self.async_write_ha_state(). Please report it to the author of the 'hon' custom integration
Data Archive
For further analysis, please add your appliance data archive here (if available)
Navigate to Settings -> Device & Services -> Haier hOn -> your device and press the Create Data Archive button.
Then open notifications to download the data zip archive.
To attach the file:
- GitHub Web: Use the "Attach files by dragging & dropping, selecting or pasting them." function
- GitHub Mobile: Upload the zip archive as image