Tuya local

Ahhh… No. Also no ability to attach a WiFi plug after installing v3.2.2. Will have to dig deeper. Sorry to bother you with what appears to be my issue.
Thanks for all of your work on this BTW. Helped increase my privacy, and has a high geek quotient!
Paul

3.2.2 has solved my issue with devices on a separate VLAN.

Great to hear about separate vLANs working.

Can you share the hardware on your lan? Ubiquiti hardware? UDM Pro? Are using a UDP broadcast utility? Your previous message indicated that your vLAN did not block WAN access (which if I understood you correctly means your devices still are accessing Tuya servers).

This is what I have been trying to implement for some time, so thanks.

As long as you have IP connectivity between Home Assistant and the devices, it will work. That’s it basically.

I’ve got a UDM-Pro, US-16-XG, USW-24, a pair of AP-Lite’s and an AP-LR.
I did install a multicast relay on the UDM-Pro to attempt to allow the broadcast info through but couldn’t get it working.

I do allow my IoT VLAN full access to the internet. If somebody from China wants to see that I can turn on my lights, then so be it. If I were to have something more sensitive on there, then I may be more concerned about blocking access to the net. Although for that I also have a NoT network where it is blocked so I could just move the sensitive device onto there. But the IoT VLAN has no access to data or anything on other networks with the exception of the hole punched through to let them talk to HA.

The devices uses broadcast, not multicast, that’s why it doesn’t work. I think the easiest way to work around this is to write a script that listens to these broadcasts and just forwards them to another IP (unicast). Then run it on a node on the same network as the tuya devices and point it towards home assistant.


This is the one I was trying to get working which should do broadcast and multicast. I can get it loaded and running on the UDM-P, which is very simple to do. But by default it only relays broadcast packets on port 6969.

It should be configurable to relay 6666 and 6667 as well, but waiting on clarification on how to do actually configure that.

Is it normal that when I reboot home assistant, sometimes the tuya switches via localtuya will become unavailable? I have reboot home assistant a few times to get the switches back.

Happens here too. However, you don’t need to reboot HA a few times to get the switches back. Just go to

  • Settings --> Integrations --> Local Tuya Integrations.
  • There you choose the switches which haven’t loaded correctly.
  • Click the “Hamburger Menu” (three vertical dots).
  • Choose “Reload”
    Done

Thank for the tips, very useful.
Sometimes I had to restart couple times hopping the switches will show up. Now I get a way to do it without wishing.

I have a TUYA - 4 Gang Switch & 1 Gang Fan. Essentially this connect power 4 switch point + 1 FAN. I have used local tuya and able to integrate. The part I am struggling is to control FAN Speed. I can turn on/off all 5 of them. The FAN has a speed from 1 to 24.

My DPS Setting
Switches - 1 to 4
FAN - 5
Fan Speed - 105

I have even changed the FAN.PY config to reflect “0”…“24” and mapped them. But no luck

a. DO we need to add specific entries in configuration.yaml? If yes any guidance/sample config.
b. There is a service.yaml in local tuya for changing DPS setting. Any idea what this can be used for

@postlund - Can you advise please?.

@sajid2310, can you show us a link to excactly the model of the 4 Gang Switch & 1 Gang Fan you are trying to integrate here?

@Tamsy
this is the model I have. the DPS setting.As you can see id:3 is also a light siwthc. I can turn on and off all swithces. Unfortunately cannot control fan regulator. The fan speed is 1 to 24 as against 3 speed.

Any help or guidance would be much appreciated

devId:’,
dps: {
‘1’: false, (light on)
‘2’: false,(light on)
‘3’: false,(light on)
‘4’: false,(light on)
‘5’: false, (FAN ON/OFF)
‘7’: 0,
‘8’: 0,
‘9’: 0,
‘10’: 0,
‘11’: 0,
‘101’: 0,
‘102’: 0,
‘103’: 0,
‘104’: 2212,
‘105’: 12 (Fan speed)
4Light1FAN

anyone can share their configuration for cover? i tried few times and it doesnt work

The OTA doesn’t work, :sweat:

What do you mean by OTA. For local tuya you need to do several things before you could actually set it up. But for tuya device that is not supported will be very difficult to install

Have localtuya up and running and all my 9 lights working in HA. After this I used iptables on my DNS server to drop all requests coming from the lights and blocked these IPs from accessing the internet.

Now, in the Smart Life app on my phone, 7 out of 9 lights have went offline. I actually expected all lights to go offline in the app. Correct?

Strange thing about those 2 lights that are still online in the smart life app, they keep switching off and online and when they are online for a few seconds, I can control the lights. On the USG firewall, I can see requests from just one of these two lights coming in and getting dropped. All kind of strange. I powered off both lights and then on again, but that doesn’t change anything.

Questions:

  • Will they maybe remove themselves in a few days from the app???
  • If I can still control them through my phone using the smart life app, does this mean there is still a connection to the internet somehow?
  • Is my assumption correct that they should all be offline in the Smart Life app?

Thx

  1. More in a few couple of minutes (can take >20 minutes though) than in a few days.

  2. Most probably yes. Readme.md says

    NOTE - Nov 2020: If you plan on integrating these devices on a network that has internet and blocking their internet access, you must block DNS requests too (to the local DNS server eg 192.168.1.1). If you only block outbound internet then the device will sit in zombie state, it will refuse / not respond to any connections with the localkey. Connect the devices first with an active internet connection, grab each device localkey and then implement the block.

  3. Your assumption is correct.

Thank you for your reply. Strange then that some are still visible in the app though I specifically blocked them. Have to further investigate that.

My understanding of the smartlife app is it actually connects local to the device using the local keys if the phone is on the same wifi network as the devices, and doesn’t always route through the cloud. There was actually a method (not sure if it still works) where you can get the tuya keys for devices off a rooted android phone.

Therefore, I could see the devices still being controllable on the local network with the smartlife app even if the devices are blocked from accessing the internet.

Do you see a difference with the way the devices are listed in the smartlife app between being on wifi vs cell connection?