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

Dimmer Switch loosing conection with Local Tuya integration #299

Open
2 of 3 tasks
claudio-mp opened this issue Jul 5, 2024 · 20 comments
Open
2 of 3 tasks

Dimmer Switch loosing conection with Local Tuya integration #299

claudio-mp opened this issue Jul 5, 2024 · 20 comments
Labels
bug Something isn't working

Comments

@claudio-mp
Copy link

LocalTuya Version

2024.6.0

Home Assistant Version

2024.7.1

Environment

  • Does the device work using the Home Assistant Tuya Cloud component?
  • Is this device connected to another local integration, including Home Assistant and any other tools?
  • The devices are within the same HA subnet, and they get discovered automatically when I add them

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

@claudio-mp claudio-mp added the bug Something isn't working label Jul 5, 2024
@xZetsubou
Copy link
Owner

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

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
Copy link
Author

claudio-mp commented Jul 7, 2024

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
Copy link

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
Copy link

They were working fine with the original loca tuya.

@claudio-mp
Copy link
Author

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
Copy link
Owner

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
Copy link

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
Copy link

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
Copy link
Owner

xZetsubou commented Jul 16, 2024

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
Copy link

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
Copy link
Author

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

Copy link

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the stale label Jul 31, 2024
@webjester0
Copy link

The issue is still present.

@claudio-mp
Copy link
Author

The problem persists. Is @xZetsubou trying any solution for this?

@github-actions github-actions bot removed the stale label Aug 1, 2024
@Gustavofd2
Copy link

same here

@bobloadmire
Copy link

Yeah super odd behavior. It's the same switches too, only 2 of my I don't work, but it's always the same 2. All 8 work fine in the tuya app though. I've power cycled the switches, nothing helps.

@xZetsubou
Copy link
Owner

xZetsubou commented Aug 16, 2024

Can you give more scenarios how is the issues starts to show up if there is something triggering it, Also enable the debug for both integration and devices that disconnect, then post FULL logs it may give us an insight of what causing this issue!

@bobloadmire
Copy link

So I deleted the device from local tuya and tuya app. Readded to tuya app, killed app and blocked tuya via DNS. Trying to add it again with localtuya gives "Connection to device succeeded but no datapoints could be found. Please try set-up again. If problem persists, create a new issue (including debug logs)."

@xZetsubou
Copy link
Owner

blocked tuya via DNS

It's been many cases where people said that blocking devices DNS will make the devices goes into zombie state.
I didn't block my devices from internet so I can't give much information but

Upstream quote:

NOTE 2: If you plan to integrate these devices on a network that has internet and blocking their internet access, you must also block DNS requests (to the local DNS server, e.g. 192.168.1.1). If you only block outbound internet, then the device will sit in a zombie state; it will refuse / not respond to any connections with the localkey. Therefore, you must first connect the devices with an active internet connection, grab each device localkey, and implement the block

More:

Once everything was in order (devices working correctly), I added the tuya device to my blocklist to disable internet access to the spotlight and disabled cloud API in localtuya config

Block Your Device(from internet access) in your Router, just in case they have/want to live their own life, and don’t “snap up” a forsed-push-update(if such exist for specific Devices/Brands)
And if they have a HA-Auto-Update_entity associated with a Device, Disable it as-well

@bobloadmire
Copy link

Unblocking DNS didn't help either

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants