-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RuntimeError: 'hon' calls async_write_ha_state #269
Comments
same here, and the status of appliance is not being update, only on reload
|
Same. I have an automation that reloads the integration every X minutes. I am not sure though how good it is for the system. |
Could you share the automation, I don't know how to reload whole integration and reloading just entity does not work well. e.g. phase which fails with:
yet another issue is:
|
@gio-dzilla I managed with help of AI to enable updating. I have created a pull request you can overwrite the custom_components/hon with this branch: https://github.com/galvani/hon/tree/fix/fix-updating-entity |
Amazing! You are a star! Thanks for working on this. |
I can't open this link, "try again error" |
works just fine at my end, it's github |
Works fine for me too |
I currently don't have any hOn integrations installed (because they all had problems). If I wanted to install one directly with your fix, which repository should I download it from? |
Unfortunately it doesn't work, it's the usual problems and limitations imposed by Haier some time ago. (failed to set up error) |
It’s working for me. It doesn’t resolve the other issues with the integration, but at least now the info are updated regularly and reliably I just downloaded the file that @galvani edited and upload it to the custom_component/hon folder. |
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):
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
dw_10067.zip
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:
The text was updated successfully, but these errors were encountered: