Next: tuya-gateway, Previous: adapter-transport, Up: Transports [Contents]
Warning: this transport was written to drive Tuya devices on the LAN, but it has not been tested end-to-end yet. During setup the devices under test did not expose a local connection, so the plugin could not be exercised against real hardware.
Talks to a Tuya device on the LAN at host:port (default
port 6668). Payloads toward readers/writers are DPS-only JSON
objects such as { "1": true, "2": 210 }. Protocol framing stays
inside the transport.
Read and write transports for the same device should share one
TCP connection via the same <socket-group> id. Omit
socket-group for a private socket.
<transport id="tuya-rx" plugin="tuya-direct"> <socket-group>demo-device</socket-group> <host>192.168.1.50</host> <port>6668</port> <device-id>REPLACE_DEVICE_ID</device-id> <local-key>0123456789abcdef</local-key> <mode>read</mode> <heartbeat-s>9</heartbeat-s> <status-on-connect>true</status-on-connect> <stale-timeout-s>120</stale-timeout-s> </transport>
See also examples/tuya-direct/tuya-direct.stcs.xml.
hostDevice IP or hostname.
portTCP port (default 6668).
device-idTuya device id.
local-keyLocal encryption key (do not commit real keys).
moderead or write.
socket-groupOptional shared-socket registry key across transports.
protocol-versionauto (default) or forced 3.1 / 3.2 / 3.3 /
3.4 / 3.5.
heartbeat-sHeartbeat interval in seconds (default 9).
status-on-connectIf true (default), query device status when the socket becomes ready.
stale-timeout-sSeconds without traffic before a status refresh (default 120).
Tip: for command and feedback on one device, declare two
transports (read + write) with the same <socket-group> so they
share one TCP connection (see Configuration Tips).