npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

signalk-tuya

v1.0.5

Published

Tuya WiFi sockets as native Signal K — switch state, metering and control over the local LAN protocol 3.3. No MQTT, no cloud in the control path.

Readme

signalk-tuya

Control and monitor Tuya / Smart Life WiFi sockets from Signal K over the local LAN protocol (3.3) — no cloud in the control path.

What it does

  • LAN-only control. Switching and reading go direct to the socket (tcp/6668) with its local key; works with the internet unplugged. The cloud is used only to fetch those keys, and only if you give it credentials.
  • State + metering. Publishes <basePath>.state, plus .power / .voltage / .current for plugs that meter (only when the device reports them).
  • PUT control. A Signal K PUT to <basePath>.state throws the relay.
  • Drops cleanly. After a few failed polls a socket's paths go to no-data rather than reading stale.
  • Autodiscovery. A LAN scan fills the Device dropdown, so you pick a socket instead of typing an id.

Requirements

  • A Signal K server.
  • tinytuya on the host. python3 and pip3 are already in the official Docker image; you only install tinytuya — see INSTALL.md.
  • A free Tuya IoT Platform developer account (iot.tuya.com) — not your Smart Life login — to fetch each socket's local key. Its cloud project runs on a free trial that expires and must be renewed to keep fetching keys; once keys are cached the plugin runs without it.
  • The host must be on the sockets' LAN and able to broadcast to them.

Install

Signal K Appstore (search signalk-tuya), or by hand:

cd ~/.signalk/node_modules && npm install signalk-tuya

Install tinytuya (INSTALL.md has the per-platform detail) and restart the server.

Configure (admin UI)

Server → Plugin Config → Tuya WiFi sockets, enable it.

  1. Tuya IoT cloud. Enter the Access ID, Access Secret and region of a Tuya IoT cloud project — the plugin fetches and caches each socket's local key (see Getting the local keys).
  2. Sockets. One row each: pick the Device from the dropdown (or paste an id), and a Signal K path (e.g. electrical.switches.tuya.fan.state/.power/.voltage/.current are appended). Leave IP blank unless the scan can't see it.
  3. python3 executable — blank uses python3 from PATH; set it for a virtualenv.

The status line says what it is waiting for.

Getting the local keys

A Tuya device needs its local key, which comes from Tuya, not the network. Either:

Keys are cached (mode 0600) in the plugin data directory, so they survive upgrades. Once cached the cloud credentials are optional.

Architecture

index.js spawns plugin.py and pipes its deltas into Signal K; all Tuya logic — tinytuya, the per-device lock Tuya's id-less protocol needs, socket rebuild, stale-echo avoidance — lives in plugin.py. The sk-plugin-python-demo pattern.

Troubleshooting

| Status / symptom | What it means | | --- | --- | | Python module 'tinytuya' is not installed… | Install it against the python3 Signal K uses, or set python3 executable. See INSTALL.md. | | No sockets configured | Add a row under Sockets. | | … with no local key | Add Tuya IoT cloud credentials, or seed the cache with tinytuya wizard. | | … not seen by the LAN scan yet | The socket is off, on another subnet, or broadcast is blocked. Set its IP by hand. | | Tuya cloud rejected the credentials | Check the Access ID/secret, and that the region matches your project's data centre. | | Device dropdown is empty | No scan has completed yet — wait ~60 s and reload. |

License

MIT.