Universal Tuya docsHomeSupported devicesRequest a deviceFAQChangelogArchitectureKnowledge baseCreditsSourcesContributing

Homey forum 154077 — "[APP][Pro] Tuya Local" (read 2026-10-11)

Source: https://community.homey.app/t/app-pro-tuya-local/154077 — author/dev Andi Wirz (@andiwirz), app com.tuyalocal (MIT, https://github.com/andiwirz/com.tuyalocal). Read-only, posts #1–#509 (501 posts, 2026-04-21 → 2026-10-10) via Discourse JSON. Nothing posted. No code copied: below is our own summary; each item cites the post it comes from.

Dev approach (summary)

Lessons → status in our repo

#Lesson (thread)Our status
#3283.3 has no session handshake: a TCP accept from a 3.4 device counted as success, reset the failure counter, rotation never kicked in (ECONNRESET loop).Fixed P2700: TuyaLocalClient confirms a session only on first real DPS; ≥2 drops <10 s without data rotate the protocol (auto only).
#337"Connected on X" persisted a version that collapsed ms later; user asked for "Lock protocol version".Fixed P2700: version-resolved (persists protocol_version) fires on first DPS only. Manual version = locked; optional lock_protocol setting honoured if present.
#296After power cut, 3.4/3.5 key exchange never answered → app waited forever, no log.Fixed P2700: connect/handshake wrapped in timeout (≥10 s), logged, counted as early drop, reconnect scheduled.
#74, #4961 s polling causes resets; push devices → polling 0.FixIt note added (P2700). Stale-data watchdog already (P2641).
#185, #259, #428One local TCP session per device; never pair twice; close Smart Life.Single-session note existed (P2657); "never pair twice" added.
#81, #486Outdoor plugs drop TCP on SET → fire-and-forget.Already (P2642).
#323Per-device command gap (default 100 ms).Already (P2619).
#389Cloud key check must not overwrite a working stored key.Already safe: WifiFixIt only advises for unavailable devices, never writes.
#433, #446, #453Numeric enums need label=raw mapping; flow dropdowns must use the same map.P2703: OemEnumTokens.parseEnumValueMap / enumLabelToDevice / enumDeviceToLabel / enumFlowOptions (label=raw, raw tokens accepted, dropdown ids = labels). Library only: our WiFi drivers have fixed DP maps and no user mode lists yet, so no driver consumes it.
#473Tuya spec ranges are raw + scale (pir_delay 50–36000 = 5–3600.0 s).P2703: DPValueParser.specRangeToReal / realToSpecRaw. Library only: nothing reads the cloud spec ranges today.
#435Echo of own SET is not proof the device reports that DP.N/A: we have no 'DP reports itself' fallback; any decrypted packet (echo included) proves only that the protocol is right, which is what P2700 uses it for.
#454, #74Triggers compare against value persisted across restart → false trigger on reconnect.P2702: first value per capability after init only seeds the baseline (no generic changed trigger); unchanged values never trigger.
#499Refresh (cmd 18) request must list measurement DPs only — naming switch DP 1 broke one plug.Our refresh uses tuyapi default list (no DP 1): OK.
#13, #16, #123, #140, #398Battery/BLE devices and BLE-behind-gateway are cloud-only.Already in LAN_LIMITATION_NOTES.
#493Zigbee/BLE sub-devices via gateway cid.Existing TuyaZigbeeBridge; nothing new.

Energy multipliers seen (user reports, NOT yet verified against tuya-local yaml)

These stay pistes until cross-checked with make-all/tuya-local device yaml + localtuya; no ids added.

Not done in this pass

DP/device-id extraction (needs per-device cross-check against tuya-local yaml), items marked Pending.

Pass 2 (2026-10-11 ~02:00 Paris)

P2705 — DP17 energy auto-detection (decision 2026-10-11, master only during soak)

← Knowledge base index · source