LocalTuya or tuya-local can control a supported Tuya Wi-Fi device over your home network. That makes blocking its internet access a reasonable next step, but it needs testing: some firmware stops responding locally when it cannot reach Tuya’s servers.
The problem is documented in both projects. There is also a DNS-blocking workaround, though it does not work for every device. The useful question is whether your exact device stays controllable after a long disconnection and a restart, rather than whether its app briefly shows it as offline.
If you have already considered what Tuya’s cloud collects and want to reduce that connection, the steps below give you a way to test the change and reverse it if necessary.
Why a simple internet block can interrupt local control
A local_key authenticates supported local commands; it does not change how the device’s firmware handles a lost cloud connection. A device may remain connected to Wi-Fi and answer a ping while its local integration reports it as unavailable.
tuya-local’s offline-operation notes warn that many devices stop responding after an extended period without Tuya’s servers. The notes describe blocking DNS as well as TCP connections as something that reportedly helps some devices. That is useful troubleshooting advice, rather than a guarantee of permanent offline operation.
What Tuya’s heartbeat documentation does tell us
The Tuya MQTT Standard Protocol describes keep-alives between a device and Tuya’s cloud. It permits a 60-second interval and says the platform closes the connection and marks the device offline after 1.5 times the interval without a message. The Chinese version gives the corresponding 90-second example; the English page’s numerical example is inconsistent with that formula.
This explains a cloud connection’s offline status. It does not establish why a particular device stops answering commands on the LAN. A cloud timeout, firmware retries and the local command listener are separate things; a report of failure after five minutes cannot be diagnosed from a 90-second keep-alive calculation.
Tuya also has module-specific reconnection guidance. Its timings should not be treated as a common specification for every OEM product running Tuya firmware.
The zombie state and the limits of blocking DNS
LocalTuya’s usage instructions call an unresponsive but still network-connected device a zombie. They recommend blocking the device’s access to its local DNS server as well as its internet access after setup.
Blocking selected Tuya domains is different from denying the device access to DNS entirely. The former still permits a successful lookup of any domain outside the list. Neither approach proves that all cloud traffic has stopped: cached or hardcoded addresses can bypass a hostname block.
The two integrations phrase the workaround differently: LocalTuya gives a firm DNS-blocking instruction, while tuya-local says it reportedly helps some devices. Neither provides evidence of a special failure window between applying two firewall rules. Treat the advice as something to validate on your device, rather than a sequence that guarantees success.
Pair first, test local control, then block
For the usual stock-firmware setup, complete the manufacturer’s app onboarding while internet access is available. Obtain the device ID and current local_key using the method supported by your chosen integration, then configure it and test both commands and incoming state changes.
The key is not necessarily extracted directly from a LAN pairing handshake. LocalTuya can retrieve it through an optional cloud account or accept it manually. tuya-local also documents key-retrieval options. Save the details securely: re-pairing can change the key, leaving a previously working configuration unable to authenticate.
- Give the device a DHCP reservation and record its address, model and firmware. Check that the local integration supports it before changing network access.
- Verify local commands and state reports. Close the Tuya app during integration setup if its connection interferes with the local client.
- Apply a reversible internet-deny rule for that device, while preserving Home Assistant’s LAN access and the network services you intend to allow.
- Wait beyond the first successful command. Test again after several minutes, after Home Assistant reconnects, and after an ordinary device power cycle where it is safe to do so.
- If it becomes unavailable, inspect the integration logs and address/key settings. Try the documented DNS-blocking workaround as a separate controlled test, then repeat the same checks.
Change one device first. A working lamp is easier to diagnose than a whole VLAN of newly unavailable equipment.
What an internet block still cannot fix
DPS are the device’s data-point values: the states and measurements the integration needs to interpret. If those values are missing after a restart, a successful network connection alone does not give Home Assistant usable state. Check the logs for received data as well as connection attempts before assuming that the firewall rule is the only problem.
LocalTuya documents an optional reset-DPID setting for certain devices that connect but stop responding after power cycling. Use only the data points appropriate to the device; copying arbitrary DPID numbers is not a general repair. If the device cannot reliably recover while isolated, decide whether an occasional cloud reconnection is acceptable or whether different hardware suits the job better.
Include the functions you actually use in the test. A relay turning on locally does not prove that energy readings, schedules or recovery after a long outage also work.
Three ways to restrict Tuya’s cloud access
- Pi-hole or AdGuard Home domain blocking. A convenient trial when the device uses your resolver. It only filters the names covered by your rules and does not stop a direct IP connection or use of an allowed alternative resolver. It is not equivalent to a WAN firewall block.
- A firewall rule for the device. Use the router’s device-control feature or a reserved address in an IP rule. A MAC-based policy, where the router supports one, does not inherently need rewriting because a DHCP address changes; an IP-based rule can miss the device if that address changes. Check both IPv4 and IPv6 where enabled.
- An IoT VLAN with an explicit internet-deny policy. A useful way to manage several devices, alongside the site’s IoT segmentation guide. Keep the required local paths available: Home Assistant must reach the device, and DHCP and any chosen local DNS or time service must still work. Merely creating a VLAN does not block the internet or configure these exceptions.
pfSense aliases illustrate the use of address groups, while its rule guidance explains how rule order and existing states affect testing. Use the equivalent controls on your router and verify traffic rather than relying on a rule’s name.
Where this approach applies
This guide concerns supported Tuya Wi-Fi devices using a local command channel. Support depends on model, protocol and data points; a Wi-Fi radio alone does not mean that LocalTuya or tuya-local can control everything a device does.
Tuya Zigbee devices paired directly to Zigbee2MQTT or ZHA take a different route. Their Zigbee commands go through your coordinator, without a Tuya Wi-Fi cloud connection to block. Other integrations or services in the overall setup may still use the internet.
For cameras and video doorbells, test live viewing, recording and alerts separately. Local control of a switch-like setting does not establish that video storage or remote access is local. A cloud-based Alexa or Google Home path will also fail when the device cannot reach that cloud; a separately configured local bridge is a different path.
The Chinese phrase 摆脱云依赖 means escaping cloud dependency. For this job, that means proving that the required functions and recovery steps work with the connection removed, rather than treating the presence of a local key as the end of the work.
Frequently asked questions
Why did my Tuya device stop responding after I blocked internet access?
Check the LAN route, address, key and integration logs first. Some firmware also behaves badly when its cloud connection fails. DNS blocking is a documented workaround for some devices, but not a reliable diagnosis or cure for all of them.
Must I block DNS as well?
LocalTuya recommends it for the zombie-state problem, and tuya-local reports that it helps some devices. Test your exact firmware. Blocking DNS alone does not ensure internet isolation.
Can a Tuya Wi-Fi device stay completely offline?
Some supported devices can provide the required local functions. Confirm sustained operation and recovery after a power cycle before depending on that result.
Does an isolated VLAN preserve local control automatically?
No. The required Home Assistant-to-device path must be allowed, and the device must tolerate losing the cloud connection. A working local DNS resolver by itself does not establish either condition.
