Closed RobertD502 closed 6 months ago
Thank you for signaling..I cannot see the reason behind that (maybe performance) but..that's it, HA core devs know their stuff better ;)
I'm also seeing this. 152 occurrences in last set of debug logs. Don't know if related or not but all mss110 devices now taking several seconds to respond, if they respond at all (about 50% success rate). They all work fine from Apple Homekit and Meross App on IOS. All other Meross devices working fine. Only mss110 affected. They're on firmware v 7.3.37. Never had a problem with any Meross devices until now.
I have a msg100 (HW: 3.5.0, FW: 3.2.7) and getting same warnings since the update to HA 2024.5
2024-05-02 19:53:02.106 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to import_module inside the event loop by custom integration 'meross_lan' at custom_components/meross_lan/__init__.py, line 566: module = import_module( (offender: /config/custom_components/meross_lan/__init__.py, line 566: module = import_module(), please create a bug report at https://github.com/krahabb/meross_lan/issues
But other than the warning, I don't see any change in functionality...
The issue itself is 'not an issue' since this is just a warning (by the HA core devs) to 'speed up' a better approach to component initialization. The new implementation has already been integrated in current development and I hope to release a new version in the coming days. @psteemson : I dont' think this is related to the mss110 stalling you're experiencing..maybe that's another issue.
Thanks @krahabb, I guess so. No problems with any other Meross devices, only mss110 - all 16 of them. They all work fine in Apple Homekit but all my automations are managed in HASS so this is a pain. Happy to provide some log data if you might have any suggestions...?
me too, I have 4 MSS210s and 1 MSS210p. Running HASSOS 2024.5
2024-05-06 12:17:32.104 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to import_module inside the event loop by custom integration 'meross_lan' at custom_components/meross_lan/meross_device.py, line 472: module = import_module( (offender: /config/custom_components/meross_lan/meross_device.py, line 472: module = import_module(), please create a bug report at https://github.com/krahabb/meross_lan/issues
@krahabb
I think you should move long initialization steps on a separate thread to fix this problem, with something like:
await asyncio.to_thread(...)
The problem is that probably you are running time consuming activities in main loop and this is temporary blocking HA to complete other actions. I had the same issue on my integration SmartThinq sensors and I solved in this way.
I have the issue as well. Those are the log entries:
Detected blocking call to import_module inside the event loop by custom integration 'meross_lan' at custom_components/meross_lan/meross_device.py, line 472: module = import_module( (offender: /config/custom_components/meross_lan/meross_device.py, line 472: module = import_module(), please create a bug report at https://github.com/krahabb/meross_lan/issues
Detected blocking call to import_module inside the event loop by custom integration 'meross_lan' at custom_components/meross_lan/init.py, line 566: module = import_module( (offender: /config/custom_components/meross_lan/init.py, line 566: module = import_module(), please create a bug report at https://github.com/krahabb/meross_lan/issues
Version of the custom_component
5.0.4
Configuration
Describe the bug
Starting with Home Assistant 2024.5.0 beta, the warning seen above is being logged. It is referring to the following code in
meross_device.py
:Related Home Assistant Core PR
Debug log