SØNDAG
2026-09-13

Too many projects, too many ideas, too few hours — one learning a day anyway

SignalK Tuya plugin

part of Maracaibo

Tuya and Smart Life WiFi sockets in SignalK over the local LAN protocol — no cloud in the control path.

Cheap Tuya sockets are everywhere, and almost every integration for them routes switching through a vendor cloud. That is the wrong shape for a boat, so this plugin talks the local LAN protocol instead: switching and reading go straight to the socket over tcp/6668 with its local key, and keep working with the internet unplugged. Each socket publishes its state, plus power, voltage and current when the hardware actually meters them, and a SignalK PUT to its .state path throws the relay. A LAN scan fills the device dropdown, so you pick a socket in the admin UI rather than typing an id.

The cloud is in exactly one place and only if you let it: Tuya’s local keys come from Tuya, not the network, so a free Tuya IoT developer account fetches them once. After that they are cached in SignalK’s plugin data directory — mode 0600, and outside the install, so an upgrade does not throw them away — and the credentials become optional. Everything that can be missing on a first run is treated as a state, not a crash: a missing tinytuya, no sockets configured, a socket without a key, a socket the scan has not seen yet, credentials Tuya rejected — each of those says so in the admin status line. Sockets that stop answering drop to no-data instead of reporting a stale value, which matters more than it sounds when a switch panel is telling you what is on.

Same shape as its sibling: a thin index.js spawning a Python worker that owns the Tuya protocol details, piping deltas back into SignalK. On npm as signalk-tuya (1.0.5) and in the SignalK Appstore: github.com/dennismilton/signalk-tuya · npm signalk-tuya.

CODE
  • Sockets re-bind when their IP changes
  • Packaged and documented for a clean install
  • Tuya sockets as a real SignalK plugin
POSTS

No posts from this project yet — they'll gather here as they publish.