hon icon indicating copy to clipboard operation
hon copied to clipboard

Log warning using async_write_ha_state

Open albertinizao opened this issue 1 year ago • 4 comments

Is your feature request related to a problem? Please describe. I see a warning recurrent log

WARNING (Dummy-15) [homeassistant.helpers.frame] 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 849: self.async_write_ha_state(), please report it to the author of the 'hon' custom integration

albertinizao avatar Sep 04 '24 17:09 albertinizao

MQTT message handler is running in separated thread, so this warning occur every time message is received.

I'm fixing this (and much more issues) in fork, but at the moment it is quite unstable: https://github.com/IoTLabs-pl/hon

kubasaw avatar Sep 08 '24 21:09 kubasaw

Log from HA: hOn ver 0.14.0.

Logger: homeassistant.helpers.frame
Source: helpers/frame.py:188
First occurred: 9:09:46 AM (42 occurrences)
Last logged: 10:04:34 AM

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 849: self.async_write_ha_state(), please report it to the author of the 'hon' custom integration

szczukot avatar Oct 28 '24 09:10 szczukot

@Andre0512 is this repo is out of date ? And better when we use the new one (@kubasaw etc)?

szczukot avatar Oct 28 '24 09:10 szczukot

Same warnings and errors in my Home Assistant. Should we expect any update? Thanks!

WladyTee avatar Nov 03 '24 09:11 WladyTee