Work through these in order; the first two cause most failures.
1. Something else holds the connection
Tuya devices accept one local TCP connection at a time.
- Close the Smart Life / Tuya Smart app on all phones and tablets, and test again.
- Check that only one local integration (Tuya Local, LocalTuya, a TinyTuya script, Node-RED flow, ...) talks to the device.
2. The local key changed
Removing a device from the app and adding it again, or a factory reset, generates a new local key. Symptoms: decrypt or "invalid data" errors, or the device connects and immediately drops.
- Fetch the key again (TinyTuya wizard, Tuya Local cloud-assisted setup, or LocalTuya with cloud credentials) and update the configuration.
- Avoid re-pairing devices unless necessary; note the date when you do.
3. Wrong protocol version
Firmware updates can change the protocol version (3.1–3.5). A wrong version gives errors similar to a wrong key.
python -m tinytuya scanshows the version each device announces.- In Tuya Local, try auto, or step through the versions.
4. The IP address changed
- Check the device's current IP in the router or with a scan.
- Create a DHCP reservation for every Tuya device.
5. Still failing
- Is the device on the same network or VLAN, or is multicast/UDP discovery blocked between segments? Device scans typically rely on broadcast packets, which usually don't cross VLANs; direct connections by IP work across VLANs only if routing and firewall allow it.
- Power-cycle the device.
- Check whether a Tuya firmware update changed behavior; compare with the integration's issue tracker.
When you find the cause, report it with report_usage or submit_experience so the next person or AI finds it faster.