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 🙏

© 2025 – Pkg Stats / Ryan Hefner

homebridge-tasmota-zbbridge

v1.13.1

Published

Control Zigbee Devices Using Tasmota ZbBridge

Downloads

219

Readme

verified-by-homebridge npm npm GitHub pull requests GitHub issues

Homebridge Tasmota Zigbee Bridge

This Homebridge plugin can controll Tasmota or Zigbee devices connected to a MQTT broker.

Devices flashed with Tasmota firmware (Outlet Switch, Lightbulb, RGB Stripe, Button, Contact Sensor, Valve, Lock Mechanism, Sensor, etc.) are suported directly. Zigbee devices can be controlled using Zigbee2Tasmota or Zigbee2MQTT gateway/bridge.

By configuring a powerTopic it is possible to combine devices to a singe HomeKit appliance - Tasmota controlled switch can turn on a Zigbee lightbulb and then change the brightness or the collor over the Zigbee network (the lightbulb should be configured to turn on automatically when power is applied).

Installation

  • Flash your device(s) with Tasmota
  • Install homebridge npm install -g homebridge
  • Install the plugin npm install -g homebridge-tasmota-zbbridge
  • Alternatively use the great Homebridge Config UI X plugin to install and configure

Configuration

{
    "name": "ZbBridge",
    "zigbee2TasmotaDevices": [
        {
            "addr": "0x8E8E",
            "type": "light1",
            "name": "Hue Lamp",
            "powerTopic": "shelly-kitchen",
            "powerType": "POWER2"
        },
        {
            "addr": "0x001788011234567F",
            "type": "light3",
            "name": "Go"
        },
        {
            "addr": "0xAC3C:1",
            "type": "switch",
            "name": "Switch-1",
        },
        {
            "addr": "0xAC3C:2",
            "type": "switch",
            "name": "Switch-2",
        },
        {
            "addr": "0xAD0B",
            "type": "switch",
            "name": "Kitchen Outlet"
        },
        {
            "addr": "0x43D0",
            "type": "sensor",
            "name": "Garage Door",
            "sensorService": "ContactSensor",
            "sensorCharacteristic": "ContactSensorState",
            "sensorValuePath": "Contact"
        },
        {
            "addr": "0xD394",
            "type": "sensor",
            "name": "Sensor3",
            "sensorService": "StatelessProgrammableSwitch",
            "sensorValuePath": "Click",
            "sensorValueMapping": [
                { "from": "single", "to": "0" },
                { "from": "double",  "to": "1" },
                { "from": "hold", "to": "2" }
            ]
        }
    ],
    "zigbee2mqttDevices": [
        {
            "ieee_address": "0x002788011234567F",
            "name": "Light Bulb"
        }
    ],
    "tasmotaDevices": [
        {
            "topic": "sonoff",
            "type": "SWITCH",
            "name": "SonoffTM"
        },
        {
            "topic": "sonoff",
            "type": "SENSOR",
            "name": "SonoffTM TH Sensor"
        },
        {
            "topic": "sonoff-4ch",
            "type": "SWITCH",
            "index": 2,
            "name": "Sonoff 4CH Channel 2"
        }
    ],
    "mqttBroker": "raspi2",
    "zigbee2tasmotaTopic": "zbbridge",
    "zigbee2mqttTopic": "zigbee2mqtt",
    "logTimeouts": false,
    "logUnexpected": false,
    "platform": "TasmotaZbBridge"
}

zigbee2TasmotaDevices - Zigbee devices connected to the Zigbee2Tasmota gateway/bridge

  • addr - Device hardware or short address and optional endpoint (for example Tuya 2ch switch). The hardware address (64 bits) is unique per device and factory assigned so once configured it will still work even if the device have to be paired again. Example: Use 0xAC3C:1 for address 0xAC3C, endpoint 1.
  • type - Device type (light0, light1, light2, light3, light4, light5, switch, sensor) see descriptions in config.schema.json. Alternatively use generic light adding supported features: _B for brigthness, _CT for color temperature, _HS for hue and saturation and _XY for XY color support (for example light_B_CT_XY). Configure desired sensor type using the specific fields below.
  • name - Accessory name to be used in the Home applicaiton. Should be unique. Will update ZbBridge Friendly Name if endpoint is not used.
  • Advanced settings
    • powerTopic - (optional) Use another tasmota device to controll the power (configure it's identifying topic)

    • powerType - (optional) Tasmota switch topic used to turn on/off the zigbee device, (default: POWER)

    • sensorService - (optional) Sensor service name as defined here (default: ContactSensor)

    • sensorCharacteristic - (optional) Service characteristic name (default: ContactSensorState)

    • sensorValuePath - (optional) Path of the sensor value in the SENSOR message (default: Contact).

    • sensorValueMapping - (optional) Map sensor from value to homebridge to value. All other values will be ignored.

      For example CONTACT_DETECTED will be reported when following message is received:

      {"ZbReceived":{"0x43D0":{"Device":"0x43D0","Name":"ContactSensorExample","Contact":0,"Endpoint":1,"LinkQuality":66}}}

zigbee2mqttDevices - Zigbee devices connected to Zigbee2MQTT gateway/bridge

  • ieee_address
  • name - Accessory name to be used in the Home application. Should be unique.
  • powerTopic - (optional) Use another Tasmota device to control the power (configure its identifying topic).
  • powerType - (optional) Tasmota switch topic used to turn on/off the Zigbee device (default: POWER).

tasmotaDevices - Tasmota flashed devices

  • topic - Topic to control the device as configured in the "Configure MQTT" menu on the device web interface.
  • type - Device type (SWITCH, LIGHTBULB, BUTTON, CONTACT, VALVE, LOCK, SENSOR, CUSTOM, etc.).
  • index - (optional) Optional index used to control the device (POWER1, POWER2, Switch1, Switch2, etc.).
  • custom - (optional) Custom device definition (when type='CUSTOM') as a JSON string. See here for details.
  • name - Accessory name to be used in the Home application. Should be unique.

mqttBroker - MQTT Broker hostname if not localhost.

mqttUsername - MQTT Broker username if password protected.

mqttPassword - MQTT Broker password if password protected.

zigbee2tasmotaTopic - Zigbee2Tasmota gateway/bridge base topic (default: zbbridge).

zigbee2mqttTopic - Zigbee2MQTT gateway/bridge base topic (default: zigbee2mqtt).

logTimeouts - (optional) Log MQTT command response timeouts (default: false).

logUnexpected - (optional) Log unexpected response messages while waiting for an MQTT command response (default: false).

Zigbee2MQTT

It is also possible to control devices using the Zigbee2MQTT gateway/bridge. This is useful if you want to combine Zigbee and Tasmota devices using the powerTopic.

Almost all accessory types are supported, but currently, some characteristics are not mapped correctly (work in progress). Supported features are queried directly from Zigbee2MQTT and configured automatically.