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

homebridge-homemate

v1.0.6

Published

Homebridge plugin for Tuya HomeMate 3+1 switch (3 lights + 1 fan with speed control)

Readme

homebridge-homemate

A Homebridge plugin to add local support for HomeMate 3+1 switches — 3 light switches + 1 fan with 4-speed control — devices that aren't supported by the main homebridge-tuya plugin.

This solves the problem described in homebridge-tuya issue #311.


How it works

Your HomeMate wall switch has these Data Points (DPs):

| DP | Type | Description | |-----|---------|----------------------| | 1 | boolean | Light switch 1 | | 2 | boolean | Light switch 2 | | 3 | boolean | Light switch 3 | | 101 | boolean | Fan on/off | | 102 | enum | Fan speed (level_1–4)|

HomeKit doesn't have a native "4-speed fan enum" — so this plugin maps the enum to a 0–100% rotation speed slider in Home app:

| Tuya value | HomeKit % | |------------|-----------| | level_1 | 25% | | level_2 | 50% | | level_3 | 75% | | level_4 | 100% |

The 3 lights appear as individual Switch tiles. The fan appears as a Fan tile with an on/off toggle and speed slider.


Installation

npm install -g homebridge-homemate

Or via Homebridge UI, search for homebridge-homemate.


Prerequisites: Get Your Device ID and Local Key

You need your device's ID and local key to use local control. Follow the instructions from homebridge-tuya.

The short version:

  1. Set up the device in the Tuya Smart or Smart Life app
  2. Use tuyapi/cli or scan with LocalTuya HACS addon to get the ID and key
  3. Find the device IP in your router's DHCP table (set a static lease so it doesn't change)

Configuration

Add to your config.json (or use Homebridge UI):

{
  "platforms": [
    {
      "platform": "TuyaHomeMate",
      "name": "TuyaHomeMate",
      "devices": [
        {
          "name": "Living Room Panel",
          "id": "YOUR_DEVICE_ID",
          "key": "YOUR_LOCAL_KEY",
          "ip": "192.168.1.123",
          "version": "3.3",
          "manufacturer": "HomeMate",
          "model": "3+1 Wall Switch",
          "lights": [
            { "name": "Main Light",    "dp": 1 },
            { "name": "Side Light",    "dp": 2 },
            { "name": "Accent Light",  "dp": 3 }
          ],
          "fan": {
            "name": "Ceiling Fan",
            "dpSwitch": 101,
            "dpSpeed": 102,
            "speedValues": ["level_1", "level_2", "level_3", "level_4"]
          }
        }
      ]
    }
  ]
}

Config options

| Field | Required | Description | |-------|----------|-------------| | name | ✓ | Display name of the device in Home app | | id | ✓ | Tuya device ID | | key | ✓ | Local encryption key | | ip | ✓ | Local IP address of the device | | version | | Protocol version: "3.1", "3.2", "3.3" (default), "3.4" | | lights | | Array of { name, dp } for each light switch | | fan.name | | Name for the fan accessory | | fan.dpSwitch | | DP number for fan on/off (boolean) | | fan.dpSpeed | | DP number for fan speed (enum) | | fan.speedValues | | Array of enum strings from slow→fast. Default: ["level_1","level_2","level_3","level_4"] |


Different speed values?

Some devices use different strings. Check your device's actual DP values using:

npx @tuyapi/cli wizard

Or look at your Homebridge logs — when the device connects, all DP values are logged. Then update speedValues to match exactly what your device sends. For example some devices use "1", "2", "3", "4" as plain numbers.


Troubleshooting

Device won't connect

  • Make sure the IP is correct and the device is on the same network as Homebridge
  • Try setting a static DHCP lease for the device
  • Check the protocol version (most new devices use 3.3, some newer ones 3.4)

Fan shows wrong speed

  • Enable debug logging in Homebridge and check the raw DP values
  • Update speedValues in your config to match exactly what your device reports

Lights work but fan doesn't

  • Verify your dpSwitch and dpSpeed DPs using the Tuya app or tuyapi/cli

Testing with your device

Since you have the device to test, here's how to verify DPs quickly:

# Install tuyapi/cli globally
npm install -g @tuyapi/cli

# Get device status (raw DPs)
npx @tuyapi/cli get --id YOUR_ID --key YOUR_KEY --ip 192.168.1.123

# Set a specific DP (e.g. turn on fan)
npx @tuyapi/cli set --id YOUR_ID --key YOUR_KEY --ip 192.168.1.123 --dps 101 --set true

# Set fan speed
npx @tuyapi/cli set --id YOUR_ID --key YOUR_KEY --ip 192.168.1.123 --dps 102 --set "level_2"

License

MIT