Skip to content
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

Nothing work after update 2024.3.1 #89

Open
goodsale opened this issue Mar 19, 2024 · 6 comments
Open

Nothing work after update 2024.3.1 #89

goodsale opened this issue Mar 19, 2024 · 6 comments

Comments

@goodsale
Copy link

After the update at 2024.3.1 no device is able to work.

By downgrading to the previous version everything works perfectly.

Any idea to solve?

Registratore: custom_components.localtuya.common
Fonte: custom_components/localtuya/pytuya/init.py:330
integration: LocalTuya integration (documentazione, problemi)
Prima occorrenza: 12:35:30 (11 occorrenze)
Ultima registrazione: 14:39:31

[a4c...ac0] Not connected to device 1
[a4c...030] Not connected to device 2
[a4c...f92] Not connected to device 3
[385...c69] Not connected to device 4

@goodsale
Copy link
Author

Also with 2024.3.2 and 2024.3.3

@djk314
Copy link

djk314 commented Mar 31, 2024

same here....

@goodsale
Copy link
Author

I believe this integration has come to an end.

I'm trying a new repository even if it's still unstable:

https://github.com/xZetsubou/hass-localtuya

@alexualbu
Copy link

fwiw, seems to be working again in 2024.4

@gian72
Copy link

gian72 commented Oct 21, 2024

Maybe it can be helpful for someone..
this is the error I got after have updated to latest available version today (2024/1/21):
2024-10-21 22:03:36.794 ERROR (SyncWorker_2) [homeassistant.util.logging] Exception in _handle_gateway_event when dispatching 'localtuya_subdevice_a4c1385ae1d684ea': ({'event': 'event_connected', 'event_data': None},) Traceback (most recent call last): File "/config/custom_components/localtuya/common.py", line 614, in _handle_gateway_event self._dispatch_status() File "/config/custom_components/localtuya/common.py", line 690, in _dispatch_status async_dispatcher_send(self._hass, signal, self._status) File "/usr/src/homeassistant/homeassistant/helpers/dispatcher.py", line 214, in async_dispatcher_send hass.verify_event_loop_thread("async_dispatcher_send") File "/usr/src/homeassistant/homeassistant/core.py", line 462, in verify_event_loop_thread frame.report_non_thread_safe_operation(what) File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 229, in report_non_thread_safe_operation report( File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 163, in report _report_integration(what, integration_frame, level, error_if_integration) File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 201, in _report_integration raise RuntimeError( RuntimeError: Detected that custom integration 'localtuya' calls async_dispatcher_send 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_dispatcher_send at custom_components/localtuya/common.py, line 690: async_dispatcher_send(self._hass, signal, self._status). Please report it to the author of the 'localtuya' custom integration.

I tried to ask chat gpt, sending the above stack trace and this is the relevant reply, that for me worked :-)

  1. Temporary Code Fix
    If you're comfortable with Python, you can attempt a temporary code fix:
  • Open the common.py file at line 690.
  • Replace the code that calls async_dispatcher_send with a thread-safe version. Here's an example of how to safely invoke async_dispatcher_send from the main event loop:
    self._hass.loop.call_soon_threadsafe(async_dispatcher_send, self._hass, signal, self._status)

This modification ensures that async_dispatcher_send is called from the main event loop, making it safe.

@icerrate
Copy link

icerrate commented Nov 17, 2024

It's working in 2024.5.5
Last time I tried 2024.11.2 and wasn't working. Be careful

Update:
I applied the change @gian72 commented and it's working now with 2024.11.2 Feel safe to update and apply it! Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants