rospogrigio / localtuya

local handling for Tuya devices
GNU General Public License v3.0
2.9k stars 556 forks source link

Autodiscovery of devices not working #1029

Open noob4722019 opened 2 years ago

noob4722019 commented 2 years ago

Hi all,

I believe I've configured the cloud credentials correct, however no devices appear when attempting to use the auto discovery feature. The devices work fine if I manually add them in.

Could it because my Tuya devices are on a different subnet to Home Assistant? And if so, is it possible to have home assistant scan other networks? Thanks.

image

SpudGB commented 2 years ago

Unfortunatly I also have the same issue... :(

L4rryFisherman commented 2 years ago

Same issue, tuya devices are also on a different subnet, which has internet access.

HA traffic is forwarded to that subnet, with masquerading enabled. (which fixes a similar issue for xiaomi integrations)

nfacha commented 2 years ago

Also having this issue, also on a different subnet

trauf0 commented 2 years ago

Same issue, no subnet. Which data centers do you use? I am wondering if the datacenter mit be wrong - local tuya only knows one data center as EU. In Tuya IoT i chose central europe, while there is western europe as second option... Need to try if my local tuya app account needs a change too.

noob4722019 commented 2 years ago

I'm using the Western Europe DC.

chrisvball commented 2 years ago

same as above... i'm sure its mdns, because when they are on same vlan it works. I did a whole network upgrade, and auto-discovery and vlans don't play nice. going to play around with igmp snooping and will report back

trauf0 commented 2 years ago

Same problem was reported in case #936

sarahmva commented 2 years ago

I hope there will be a solution soon for this issue. Or at least a better description of how to use the manual configuration.

warren-axiell commented 2 years ago

no devices detected. My devices are also on a separate vlan

leonardochaia commented 2 years ago

Same issue. IoT devices are in a separate subnet and vlan. With firewall disabled still does not work.

Is there any fix whatsoever?

raimangsxr commented 1 year ago

Same issue, any news?

hazelement commented 1 year ago

I figured it out. I had the same issue and opened 6666 and 6667 on my firewall and all devices now show up. see comment here https://community.home-assistant.io/t/no-devices-found-in-ha-by-localtuya/392656/2

drew-hill commented 1 year ago

I figured it out. I had the same issue and opened 6666 and 6667 on my firewall and all devices now show up. see comment here https://community.home-assistant.io/t/no-devices-found-in-ha-by-localtuya/392656/2

Do you mean to say that those ports were closed or did you somehow link them between VLAN and LAN subnets? I'm trying to figure out what to do here to make this work with an OPNsense firewall. I already have an mDNS repeater, but perhaps I have these ports blocked on either subnet.

Update: I ended up using UDP Broadcast Relay and broadcasting ports 6666 and 6667 between my LAN and VLANs with simple UDPBR rules that only added the ports (one rule that simply has port 6666 filled out and one port that simply has port 6667 filled out). Seemed to work! More info on OPN Sense UDPBR here: https://forum.opnsense.org/index.php?topic=15721.0.

AngelouDi commented 1 year ago

I managed to solve it.

I was running HA dockerized in bridge mode. I changed it to host and it worked.

This guy explains how the discovery works.

https://www.youtube.com/watch?v=t933eJ8Iezc

On my host machine I could see the broadcasts using sudo tcpdump -i eth0 -n udp port 6667 but because docker was on a different subnet it wouldn't receive them.

Hope it helps!