xZetsubou / hass-localtuya

🔹 A Home Assistant integration to handle Tuya devices locally "fork from localtuya"
https://xzetsubou.github.io/hass-localtuya/
GNU General Public License v3.0
315 stars 31 forks source link

Dimmer Switch loosing conection with Local Tuya integration #299

Open claudio-mp opened 2 weeks ago

claudio-mp commented 2 weeks ago

LocalTuya Version

2024.6.0

Home Assistant Version

2024.7.1

Environment

What happened?

I'm starting to use Local Tuya integration and I've already identified at least 2 devices that disconnect for no apparent reason (1 dimmer switch and 1 IR remote control). Even disconnected from Local Tuya, they work normally in the Tuya Cloud integration. To get the devices working again (at least for a while) I need to unplug them and plug them to the power.

Steps to reproduce.

the problem occurs randomly

Relevant log output

No response

Diagnostics information.

localtuya-c66281edf107979133eaa22f6a3217d8-IR escri-173b10c3457ca32d08831de53cd0f4f7.json localtuya-c66281edf107979133eaa22f6a3217d8-D2moes-92d372c4595d286a2010608913313466.json

xZetsubou commented 1 week ago

Can you test the master version and see if there's any improvements

Install Master Version

Go HACS -> Local Tuya -> On top right corner click on the ⋮ and choose redownload and select master ![image](https://github.com/xZetsubou/hass-localtuya/assets/46300268/e326b0b6-74cf-49e0-9696-3b444178083b) And restart HA then re-add your device

Ensure that the connection is stable between Home Assistant and the device it self you could ping to the device for sometime to test it, the cloud will works as long the device reach the internet unlike local need to have stability connection for both device and home assistant with the routers.

claudio-mp commented 1 week ago

Hi! How do I know if I installed the master version? As soon as I select the “master” version, the “2024.6.0” version reappears on the screen even before I click the “download” button. Is that how it really works? Capture

webjester0 commented 1 week ago

I have the same issue with two Feit dimmer switches.

Logger: custom_components.localtuya.coordinator Source: custom_components/localtuya/core/pytuya/init.py:298 integration: LocalTuya (documentation, issues) First occurred: 18:25:26 (11 occurrences) Last logged: 18:26:00

[011...19c - Dining Room ] Failed to connect to 192.168.50.237: [Errno 104] Connect call failed ('192.168.50.237', 6668)
[801...2c7 - Kitchen Table] Disconnected: waiting for discovery broadcast
[801...2c7 - Kitchen Table] Failed to connect to 192.168.50.238: [Errno 104] Connect call failed ('192.168.50.238', 6668)
[011...19c - Dining Room ] Disconnected: waiting for discovery broadcast
webjester0 commented 1 week ago

They were working fine with the original loca tuya.

claudio-mp commented 1 week ago

If reinstallation of LocalTuya I did was correct (as I mentioned above), then the issues continues. This issue occurs with dimmers, IR transmitters, and some smart plugs.

xZetsubou commented 1 week ago

HACS has a bug sometimes that If you select master it's actually reject and revert to old version, either way I'll push new update soon if the bug remains keep in mind that with new changes the devices needs to reboot "from the power" then it should at least be stabilized and reconnect better.

bobloadmire commented 5 days ago

Just confirming I'm also having the same issue with 3 if 9 of my tuya devices. All available in the app, but 3 not available in the integration. Integration doesn't see any new devices to add, also rebooting the dimmer switch doesn't help me

webjester0 commented 5 days ago

Some more strange data points to this issue. I found that the two mentioned devices intermittently reconnect and drop out again. And while they work flawlessly in the Tuya Smart app, they are the only two devices that produce a "Network Error" when I perform a "Check Device Network" in the Tuya app (click on the device, then the "edit" button in the top right corner, then "Check Device Network".

xZetsubou commented 3 days ago

Does the losing connection behavior still occurs in 2024.7.0 update? I'm kinda sure this isn't and not sure if it fixable since it more like network issue then integration issue

webjester0 commented 3 days ago

Yes, no change. I agree that it is a strange issue but, again, it was working flawlessly for months in the original Local Tuya integration. I also deleted both (original and fork) and then reinstalled the fork only. And, like others have mentioned, then it can't find those two items as well as two others in the configuration ("...no datapoints found"). Also tried to switch from standard to DP instruction set in the TUYA IOT platform. Made no difference.

claudio-mp commented 3 days ago

Same issue remains in 2024.7.0. The devices disconnect and reconnect from time to time.