Summary
The official Tuya integration fails in two distinct, compounding ways:
-
MQTT channel freezes every ~2-3h: the
tuya_sharingMQTT thread dies withAPI_QPS_LIMIT_OR_DEGRADEand never reconnects. All Tuya sensors gounavailable/ stay frozen at their last value until the integration is manually reloaded. This has been happening for weeks and requires an automation to auto-reload every 3h as a workaround. -
A config entry can die permanently: one of my two Tuya entries (same Tuya account, same HA instance) now returns
sign invalid/token is expiredon EVERY API call, includingGET /v1.0/m/token/{refresh_token}(the refresh token itself is dead). The entry cannot be recovered by reloading, byhomeassistant.reload_config_entry, or by any API call. The other entry (same account) still works fine and sees 25 devices.
Environment
- Home Assistant Core (container), latest 2026.x
- Integration: tuya (official), 2 config entries, same account
- Devices affected: 3 Tuya covers (blinds) + 3 background lights + 1 scene in the dead entry; ~25 devices in the working entry
- All devices work fine in the Tuya/SmartLife app — the problem is purely the HA ↔ Tuya Cloud integration
What I did
homeassistant.reload_config_entryon the dead entry → no change- Tried refreshing the token via the SDK’s own refresh flow (
Manager+SharingTokenListener+refresh_access_token_if_need) → refresh never fires (bug:CustomerTokenInfohas no.get(), refresh silently fails) - Tried direct
GET /v1.0/m/token/{refresh_token}→token is expired(1010) even when signing with the refresh_token - Tried re-querying the devices with the OTHER (working) entry’s token →
permission deny(1106) — the devices belong to a home/project that this entry can no longer see - Devices are reachable on the LAN (Tuya protocol 3.3, found via broadcast) but the
local_keyHA has is stale (rotated by Tuya), so local control is also impossible
Expected behavior
A config entry whose token expires should be recoverable via its refresh_token, or at least fail in a way that surfaces clearly (not silently freezing all entities for days). Losing a whole entry permanently, with no recovery path other than scanning a QR with the phone, is a serious reliability problem.
Actual behavior
- The entry is permanently dead from HA’s side; only re-authenticating with a QR scan (or moving devices to another home in the app) recovers it
- The community workaround (auto-reload every 3h) fixes the freeze but not the dead entry
- Community threads with identical symptoms: #915171 (Tuya Online Acting Strange), #701217, #748635, GitHub #116299
Logs
ERROR (Thread-X) [root] Uncaught thread exception
.../tuya_sharing/mq.py ... API_QPS_LIMIT_OR_DEGRADE
Exception: network error:(-9999999) API_QPS_LIMIT_OR_DEGRADE
network error:(1010) token is expired (on refresh endpoint)
network error:(-9999999) sign invalid (on all entry API calls)
network error:(1106) permission deny (querying dead entry's devices with working entry token)
Questions
- Is there any supported way to force a token refresh of a Tuya config entry without a QR scan?
- Is the
refresh_access_token_if_needbug (CustomerTokenInfo.get missing) known? It makes automatic token renewal impossible. - Should the integration detect a permanently-dead entry and alert the user instead of silently freezing entities for days?