I’ve successfully connected my pool pump to this local Tuya integration and, for the most part, it works great….as long as the Tuya app is open and the pump controls are visible. If I force close the Tuya app, the pump becomes unresponsive until I start the app and choose the pump to display its controls again.
I’ve tried adding a 30 sec polling time but it still reacts the same way. I feel like the app might be initializing the connection somehow and I can’t figure out if it’s using a DP for that step or not.
Maybe I’ve misunderstood the way that local tuya works as I’ve deleted the pump from the Tuya app and now all the associated HA entities are not available anymore. I would’ve thought the app, nor the connection to the Internet would’ve been needed after getting the device ID and the local key.
I got some local-tuya stuff working last year and am currently hacking on it now, so this is mostly from memory. When you block Tuya devices from accessing the Internet, I believe you must block their access to EVERYTHING: even services (DNS, NTP) on your firewall itself.
What you’re describing with the app though seems very odd. If anything I’ve ran into more issues with the phone app and the HA component stepping on each others’ toes in accessing what seems to be a single “slot” on Tuya devices to respond to local control.
I have zero experience with Tuya pump devices though.
I’m running Unifi equipment here and I’m pretty sure I’m blocking the pump from everthing…at least I think I am…and it still quits updating sensor values when disconnected.
This AI answer about lines up with what I remember. I’d give the DNS blackhole option a shot:
The Community “Gold Standard”: DNS Spoofing + Allow NTP
Verdict:Most Effective (Best for preventing offline states).
Instead of blocking DNS or letting it resolve to the real cloud, you configure your DNS resolver (Pi-hole, AdGuard, or Router) to rewrite the Tuya cloud domain (e.g., m2.tuyaus.com , a1.tuyaeu.com ) to a dummy IP address (like 127.0.0.1 or 0.0.0.0 ).
Why this works best: Tuya firmware often has a “watchdog” timer. If the device cannot resolve a domain name, the firmware assumes the Wi-Fi chip has crashed and forces a hardware reboot to “fix” it. This reboot causes the device to become “Unavailable” in HA for 30–60 seconds.
The Mechanism: By spoofing the address, the device believes it successfully resolved the cloud IP. It then tries to connect to 0.0.0.0 , fails immediately (TCP Connection Refused), and returns to its main loop. This keeps the Wi-Fi radio active and the Local Control port (6668) open for Home Assistant.
Crucial Add-on (NTP): Community members strongly report that you must allow UDP Port 123 (NTP) out to the internet. If the device thinks the year is 1970, or if the internal clock drifts too far, the encryption handshake with Home Assistant can fail, or the device may enter a reboot loop trying to get the time.
I really appreciate you assistance. I did try the DNS blackhole option and allowing port 123 for NTP updates but I think something else is going on here.
With the device completely blocked, the switch to turn on/off the pump works as expected. The number entity to change speed is working too.
What isn’t working are the sensors for power, flow and the dedicated speed indication. They aren’t unavailable, they just don’t update unless I pause the firewall rule.
I’ll keep digging but it may just not be possilbe.