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

zigbee-api

v0.0.7

Published

description

Downloads

17

Readme

Description

Zigbee API base on Nest framework inspired by zigbee2mqtt.

Supported devices

See Supported devices on Zigbee2mqtt documentation to check whether your device is supported. There is quite an extensive list, including devices from vendors like Xiaomi, Ikea, Philips, OSRAM and more.

Installation

$ git clone https://github.com/apiel/zigbee-api.git
$ cd zigbee-api
$ npm install

Getting started

The documentation from zigbee2mqtt provides you all the information needed to get up and running! Make sure you don't skip sections if this is your first visit, as there might be important details in there for you.

If you aren't familiar with Zigbee terminology make sure you read this to help you out.

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

REST API

  • GET /api/devices Get the list of registered devices.
  • GET /api/devices/{addr} Get the details of a device, where addr is the address of the device, for example 0xd0cf5efffe3070a1.
  • GET /api/events Get the list of events from the last 5 minutes, for example new device incoming or messages receive from a remote.
  • POST /api/devices/{addr}/action Send an action to a device, where addr is the address of the device and the request body should contain the command in JSON format, for example { "action": { "state": "on" }, "type": "set" }

Build-in documentation

There is build-in documentation, using standard OpenAPI Specification. To access it, go to the url http://127.0.0.1:3000/docs .

swagger documentation

From this user interface, you can run some test queries, for example to change the state of a device:

swagger tryout

GraphQL

You can access the GraphQL playground under the url http://127.0.0.1:3000/graphql

graphql playground

From there you can try your GraphQL queries:

  • to get the list of devices
{
    getDevices {
      type
      ieeeAddr
      manufName
      modelId
    }
}
  • to get a single device information
{
    device (addr: "0xd0cf5efffe3070a1") {
      type
      ieeeAddr
      manufName
      modelId
    }
}
  • to get device config information
{
  getDeviceConfig(addr: "0xd0cf5efffe3070a1") {
    device {
      type
      ieeeAddr
      modelId
    }
    config
  }
}
  • to get the list of events from the last 5 minutes
{
    getEvents {
      type
      payload
      time
    }
}
  • to send an action to a device
mutation {
    sendAction(
        addr: "0xd0cf5efffe3070a1"
        action: "{\"action\": {\"state\": \"on\"}, \"type\": \"set\"}"
    )
}

It is also possible to have real-time subscription, to receive events:

subscription {
    events {
      type
      payload
      time
    }
  }

Read more about the GraphqQL subscriptions here.

Microservice

Nest framework provide a micro-servive interface. It provide multiple communication protocole like TCP, MQTT, AMQP with RabbitMQ, Redis pub/sub... For more information look at the nest documentation.